| FaInput {Rsamtools} | R Documentation |
Scan indexed fasta (or compressed fasta) files and their indicies.
indexFa(file, ...) ## S4 method for signature 'character' indexFa(file, ...) scanFaIndex(file, ...) ## S4 method for signature 'character' scanFaIndex(file, ...) countFa(file, ...) ## S4 method for signature 'character' countFa(file, ...) scanFa(file, param, ...) ## S4 method for signature 'character,GRanges' scanFa(file, param, ...) ## S4 method for signature 'character,RangesList' scanFa(file, param, ...) ## S4 method for signature 'character,RangedData' scanFa(file, param, ...) ## S4 method for signature 'character,missing' scanFa(file, param, ...)
file |
A character(1) vector containing the fasta file path. |
param |
An optional |
... |
Additional arguments, currently unused. |
indexFa visits the path in file and create an index file
at the same location but with extension ‘.fai’).
scanFaIndex reads the sequence names and and widths of recorded
in an indexed fasta file, returning the information as a
GRanges object.
countFa returns the number of records in the fasta file.
scanFa return the sequences indicated by param as a
DNAStringSet instance. seqnames(param)
selects the sequences to return; start(param) and
end{param} define the (1-based) region of the sequence to
return. Values of end(param) greater than the width of the
sequence are set to the width of the sequence. When param is
missing, all records are selected. When param is
GRanges(), no records are selected.
Martin Morgan <mtmorgan@fhcrc.org>.
http://samtools.sourceforge.net/ provides information on
samtools.
fa <- system.file("extdata", "ce2dict1.fa", package="Rsamtools")
countFa(fa)
(idx <- scanFaIndex(fa))
(dna <- scanFa(fa, idx[1:2]))
ranges(idx) <- narrow(ranges(idx), -10) # last 10 nucleotides
(dna <- scanFa(fa, idx[1:2]))