File compression for tabix (bgzip) and fasta (razip) files.

Share:

Description

These functions compress files for use in other parts of Rsamtools: bgzip for tabix files, razip for random-access fasta files.

Usage

1
2
3
4
bgzip(file, dest=sprintf("%s.bgz", sub("\\.gz$", "", file)),
      overwrite = FALSE)
razip(file, dest=sprintf("%s.rz", sub("\\.gz$", "", file)),
      overwrite = FALSE)

Arguments

file

A character(1) path to an existing uncompressed or gz-compressed file. This file will be compressed.

dest

A character(1) path to a file. This will be the compressed file. If dest exists, then it is only over-written when overwrite=TRUE.

overwrite

A logical(1) indicating whether dest should be over-written, if it already exists.

Value

The full path to dest.

Author(s)

Martin Morgan <mtmorgan@fhcrc.org>

References

http://samtools.sourceforge.net/

See Also

TabixFile, FaFile.

Examples

1
2
3
4
from <- system.file("extdata", "ex1.sam", package="Rsamtools",
                    mustWork=TRUE)
to <- tempfile()
zipped <- bgzip(from, to)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.