31 #include <QTextStream>
32 #include <QDataStream>
34 #include "../exception/exceptionoutofrange.h"
40 : m_fasta_file(fastaFile.absoluteFilePath())
54 throw PappsoException(QObject::tr(
"ERROR opening FASTA file %1 for read")
55 .arg(fastaFile.fileName()));
60 : m_fasta_file(other.m_fasta_file.fileName())
84 while(!bin_in.atEnd() && (char_in < (qint8)21))
89 while(!bin_in.atEnd())
93 if(char_in == (qint8)
'>')
104 while(!bin_in.atEnd() && (char_in > (qint8)20))
112 if(!bin_in.atEnd() && (char_in < (qint8)21))
132 throw PappsoException(QObject::tr(
"ERROR opening FASTA file %1 for read")
154 qDebug() <<
" goto=" << index <<
" pos=" <<
m_indexArray[index];
166 "sequence %1, position %2 failed")
176 QObject::tr(
"ERROR reading FASTA file %1 : sequence index %2 "
177 "unreachable, array size=%3")
189 return std::make_shared<FastaFileIndexer>(*
this);
FastaFileIndexer(const QFileInfo &fastaFile)
virtual ~FastaFileIndexer()
FastaFileIndexerSPtr makeFastaFileIndexerSPtr() const
QTextStream * mpa_sequenceTxtIn
std::vector< qint64 > m_indexArray
void getSequenceByIndex(FastaHandlerInterface &fasta_handler, std::size_t index) override
void parseOnlyOne(QTextStream &p_in)
Quick random access to sequences in a fasta file using an index.
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
std::shared_ptr< FastaFileIndexer > FastaFileIndexerSPtr