wrapper class around struct faidx_t in libhts
More...
#include <yat/omic/Fasta.h>
wrapper class around struct faidx_t in libhts
Class handling a fasta file. Class assumes the fasta file has an index file created by e.g. 'samtools faidx'.
- Since
- New in yat 0.14
theplu::yat::omic::Fasta::Fasta |
( |
const std::string & |
fn | ) |
|
Tries to open index for fasta file fn. It is assumed that the index file is called fn + ".fai". If open fails, constructor tries to create an index file from fasta file fn (see fai_build in htslib). If that also fails, an exception is thrown.
- Exceptions
-
std::string theplu::yat::omic::Fasta::name |
( |
size_t |
i | ) |
const |
- Returns
- name of sequence i
int theplu::yat::omic::Fasta::nseq |
( |
void |
| ) |
const |
- Returns
- number of sequences
bool theplu::yat::omic::Fasta::present |
( |
const std::string & |
name | ) |
const |
- Returns
- true if there exist a sequence called name
Sequence theplu::yat::omic::Fasta::sequence |
( |
const std::string & |
chr | ) |
const |
- Returns
- entire sequence from sequence chr
Sequence theplu::yat::omic::Fasta::sequence |
( |
const std::string & |
chr, |
|
|
int |
beg, |
|
|
int |
end |
|
) |
| const |
- Parameters
-
chr | sequence name |
beg | beginning position (0-based) |
end | end position (0-based) |
- Returns
- sub-sequence of chr as indicated by beg and end
int theplu::yat::omic::Fasta::sequence_length |
( |
const std::string & |
name | ) |
const |
- Returns
- length of sequence with name name
- Exceptions
-
The documentation for this class was generated from the following file: