Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zip

File compression for tabix (bgzip) and fasta (razip) files. IMPORTANT NOTE: Starting with Rsamtools 1.99.0 (Bioconductor 3.9), razip() is defunct. Please use bgzip() instead.


Description

bgzip compresses tabix (e.g. SAM or VCF) or FASTA files to a format that allows indexing for later fast random-access.

Usage

bgzip(file, dest=sprintf("%s.bgz", sub("\\.gz$", "", file)),
      overwrite = FALSE)

## Defunct!
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

See Also

Examples

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

Rsamtools

Binary alignment (BAM), FASTA, variant call (BCF), and tabix file import

v2.6.0
Artistic-2.0 | file LICENSE
Authors
Martin Morgan, Hervé Pagès, Valerie Obenchain, Nathaniel Hayden
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.