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

indexTabix

Compress and index tabix-compatible files.


Description

Index (with indexTabix) files that have been sorted into ascending sequence, start and end position ordering.

Usage

indexTabix(file,
           format=c("gff", "bed", "sam", "vcf", "vcf4", "psltbl"),
           seq=integer(), start=integer(), end=integer(),
           skip=0L, comment="#", zeroBased=FALSE, ...)

Arguments

file

A characater(1) path to a sorted, bgzip-compressed file.

format

The format of the data in the compressed file. A characater(1) matching one of the types named in the function signature.

seq

If format is missing, then seq indicates the column in which the ‘sequence’ identifier (e.g., chrq) is to be found.

start

If format is missing, start indicates the column containing the start coordinate of the feature to be indexed.

end

If format is missing, end indicates the column containing the ending coordinate of the feature to be indexed.

skip

The number of lines to be skipped at the beginning of the file.

comment

A single character which, when present as the first character in a line, indicates that the line is to be omitted. from indexing.

zeroBased

A logical(1) indicating whether coordinats in the file are zero-based.

...

Additional arguments.

Value

The return value of indexTabix is an updated instance of file reflecting the newly-created index file.

Author(s)

Martin Morgan <mtmorgan@fhcrc.org>.

References

Examples

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

tab <- TabixFile(zipped, idx)

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.