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
|
\name{Compression}
\Rdversion{1.1}
\alias{bgzip}
\alias{razip}
\title{
File compression for tabix (bgzip) and fasta (razip) files.
}
\description{
These functions compress files for use in other parts of
\pkg{Rsamtools}: \code{bgzip} for tabix files, \code{razip} for
random-access fasta files.
}
\usage{
bgzip(file, dest=sprintf("\%s.bgz", sub("\\\\.gz$", "", file)),
overwrite = FALSE)
razip(file, dest=sprintf("\%s.rz", sub("\\\\.gz$", "", file)),
overwrite = FALSE)
}
\arguments{
\item{file}{A character(1) path to an existing uncompressed or
gz-compressed file. This file will be compressed.}
\item{dest}{A character(1) path to a file. This will be the compressed
file. If \code{dest} exists, then it is only over-written when
\code{overwrite=TRUE}.}
\item{overwrite}{A logical(1) indicating whether \code{dest} should
be over-written, if it already exists.}
}
\value{
The full path to \code{dest}.
}
\references{
\url{http://samtools.sourceforge.net/}
}
\author{
Martin Morgan <mtmorgan@fhcrc.org>
}
\seealso{
\code{\link{TabixFile}}, \code{\link{FaFile}}.
}
\examples{
from <- system.file("extdata", "ex1.sam", package="Rsamtools",
mustWork=TRUE)
to <- tempfile()
zipped <- bgzip(from, to)
}
\keyword{ manip }
|