| 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, ...,
as=c("DNAStringSet", "RNAStringSet", "AAStringSet"))
## S4 method for signature 'character,GRanges'
scanFa(file, param, ...,
as=c("DNAStringSet", "RNAStringSet", "AAStringSet"))
## S4 method for signature 'character,IntegerRangesList'
scanFa(file, param, ...,
as=c("DNAStringSet", "RNAStringSet", "AAStringSet"))
## S4 method for signature 'character,missing'
scanFa(file, param, ...,
as=c("DNAStringSet", "RNAStringSet", "AAStringSet"))
file |
A character(1) vector containing the fasta file path. |
param |
An optional |
as |
A character(1) vector indicating the type of object to
return; default |
... |
Additional arguments, passed to |
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, RNAStringSet,
AAStringSet 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",
mustWork=TRUE)
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]))