1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
\name{lastal}
\alias{lastal}
\title{
lastal wrapper
}
\description{
Wrapper function of \command{lastal} to do the pairwise whole genome alignment.
This function doesn't work on Windows platform.
}
\usage{
lastal(db, queryFn,
outputFn=sub("\\\.(fa|fasta)$", ".maf",
paste(basename(db), basename(queryFn), sep = ","),
ignore.case = TRUE),
distance=c("far", "medium", "near"), binary="lastal",
mc.cores=getOption("mc.cores", 2L), echoCommand=FALSE)
}
\arguments{
\item{db}{
\code{character}(1): the file name of target assembly's lastal index.
}
\item{queryFn}{
\code{character}(1): the file name of query assembly \emph{fasta} file.
}
\item{outputFn}{
\code{character}(1): the file name of the output \emph{maf} file.
}
\item{distance}{
It can be "far", "medium" or "near". It decides the score matrix used in
\emph{lastz} aligner.
See `?scoringMatrix` for more details.
}
\item{binary}{
\code{character}(1): the name/filename of the binary \command{lastal} to call.
}
\item{mc.cores}{
\code{integer}(1): the number of threads to use.
By default, \code{getOption("mc.cores", 2L)}.
}
\item{echoCommand}{
\code{boolean}(1): When \code{TRUE},
only the command to run \command{lastal} is returned.
}
}
\value{
A \code{character}(1) vector of ouput \emph{maf} file names.
}
\references{
\url{http://last.cbrc.jp/}
}
\author{
Ge Tan
}
\note{
\command{lastal} aligner must be installed on the machine to use this function.
}
\seealso{
\code{\link{lastz}}
}
\examples{
\dontrun{
assemblyDir <- "/Users/gtan/OneDrive/Project/CSC/CNEr/2bit"
## Build the lastdb index
system2(command="lastdb", args=c("-c", file.path(assemblyDir, "danRer10"),
file.path(assemblyDir, "danRer10.fa")))
## Run lastal aligner
lastal(db=file.path(assemblyDir, "danRer10"),
queryFn=file.path(assemblyDir, "hg38.fa"),
outputFn=file.path(axtDir, "danRer10.hg38.maf"),
distance="far", binary="lastal", mc.cores=4L)
## maf to psl
psls <- file.path(axtDir, "danRer10.hg38.psl")
system2(command="maf-convert",
args=c("psl", file.path(axtDir, "danRer10.hg38.maf"),
">", psls))
}
}
|