1 #ifndef OBJTOOLS_READERS___ALN_READER__HPP
2 #define OBJTOOLS_READERS___ALN_READER__HPP
81 const string&
GetID()
const {
return m_ID; }
82 const string&
GetMsg()
const {
return m_Message; }
152 objects::CAlnErrorReporter*)>;
155 function<void(
const objects::CSeq_id&,
157 objects::CAlnErrorReporter*)>;
170 const string& GetAlphabet(
void)
const;
171 void SetAlphabet(
const string&
value);
175 const string& GetBeginningGap(
void)
const;
176 void SetBeginningGap(
const string&
value);
178 const string& GetMiddleGap(
void)
const;
179 void SetMiddleGap(
const string&
value);
181 const string& GetEndGap(
void)
const;
182 void SetEndGap(
const string&
value);
189 void SetAllGap(
const string&
value);
191 const string&
GetMissing(
void)
const {
return mSequenceInfo.Missing();};
194 const string&
GetMatch(
void)
const {
return mSequenceInfo.Match();};
199 void SetFastaGap(EAlphabet alpha);
200 void SetClustal (EAlphabet alpha);
201 void SetPhylip (EAlphabet alpha);
202 void SetPaup (EAlphabet alpha);
210 fGenerateLocalIDs = 1
217 bool generate_local_ids=
false,
218 objects::ILineErrorListener* pErrorListener=
nullptr);
222 objects::ILineErrorListener* pErrorListener=
nullptr);
225 const vector<string>&
GetIds(
void)
const {
return m_IdStrings;};
226 const vector<string>&
GetSeqs(
void)
const {
return m_Seqs;};
228 const vector<string>&
GetDeflines(
void)
const {
return m_Deflines;};
239 objects::ILineErrorListener* pErrorListener=
nullptr);
241 objects::ILineErrorListener* pErrorListener=
nullptr);
244 objects::CSeq_inst::EMol GetSequenceMolType(
245 const string& alphabet,
246 const string& seqData,
247 objects::ILineErrorListener* pErrorListener=
nullptr
259 int repeat_interval)
const;
261 void x_VerifyAlignmentInfo(
266 const string& seqData)
const;
268 objects::CSeq_inst::EMol x_GetSequenceMolType(
269 const string& alphabet,
270 const string& seqData,
271 const string& seqId=
"",
272 objects::ILineErrorListener* pErrorListener=
nullptr);
313 void x_CalculateMiddleSections();
316 void x_AssignDensegIds(
318 objects::CDense_seg& denseg);
320 void x_ParseAndValidateSeqIds(
325 void x_AddMods(
const TLineInfo& defline_info,
326 objects::CBioseq& bioseq,
327 objects::ILineErrorListener* pErrorListener);
329 void x_AddTitle(
const string& defline, objects::CBioseq& bioseq);
342 void ParseDefline(
const string& defline,
350 objects::ILineErrorListener* pMessageListener);
struct SLineInfo SLineInfo
struct SAlignmentFile SAlignmentFile
EAlnErr GetCategory() const
const string & GetMsg() const
const string & GetID() const
const string & GetMessage() const
const_iterator end(void) const
TErrors::const_iterator const_iterator
void push_back(const CAlnError &)
size_t GetErrorCount(CAlnError::EAlnErr) const
list< CAlnError > TErrors
const_iterator begin(void) const
class CAlnReader supports importing a large variety of text-based alignment formats into standard dat...
vector< string > m_IdStrings
EAlignFormat GetLastAlignmentFileFormat(void) const
const vector< TLineInfo > & GetDeflineInfo(void) const
@ eAlpha_Rna_no_ambiguity
@ eAlpha_Dna_no_ambiguity
objects::CFastaDeflineReader::TIgnoredProblems TIgnoredProblems
const TErrorList & GetErrorList(void) const
int x_GetGCD(const int a, const int b) const
const vector< string > & GetSeqs(void) const
objects::CFastaDeflineReader::SDeflineParseInfo SDeflineParseInfo
bool x_IsReplicatedSequence(const char *sequence_data, int sequence_length, int repeat_interval) const
CAlnReader & operator=(const CAlnReader &value)
void SetUseNexusInfo(bool useNexusInfo)
void Read(TReadFlags=fReadDefaults, objects::ILineErrorListener *pErrorListener=nullptr)
vector< string > m_SeqVec
void Read(bool guess, bool generate_local_ids=false, objects::ILineErrorListener *pErrorListener=nullptr)
TAlignMiddles m_MiddleSections
function< void(const list< CRef< objects::CSeq_id > > &, int, objects::CAlnErrorReporter *)> FValidateIds
static string GetAlphabetLetters(EAlphabet)
vector< TSeqPos > m_SeqLen
const string & GetMiddleGap(void) const
vector< string > m_Deflines
void SetMatch(const string &value)
int TReadFlags
binary OR of EReadFlags
objects::CDense_seg::TDim TNumrow
vector< string > m_Organisms
EReadFlags
Read the file This are the main functions.
const string & GetAlphabet(void) const
pair< TSeqPos, TSeqPos > TAlignMiddleInterval
characters have different contexts, depending on whether they are before the first non-gap character,...
objects::CFastaDeflineReader::TFastaFlags TFastaFlags
bool GetUseNexusInfo() const
function< void(const objects::CSeq_id &, int, objects::CAlnErrorReporter *)> FIdValidate
const vector< string > & GetDeflines(void) const
ncbi::objects::CSequenceInfo mSequenceInfo
const vector< string > & GetIds(void) const
Parsed result data accessors.
objects::CFastaDeflineReader::SLineTextAndLoc SLineTextAndLoc
EAlignFormat m_AlignFormat
const vector< string > & GetOrganisms(void) const
void SetMiddleGap(const string &value)
bool IsAlphabet(EAlphabet alpha) const
objects::CFastaIdHandler m_FastaIdHandler
CNcbiIstream & m_IS
Other internal data.
objects::SLineInfo TLineInfo
CRef< objects::CSeq_entry > m_Entry
const string & GetEndGap(void) const
void SetEndGap(const string &value)
void SetBeginningGap(const string &value)
CAlnReader(const CAlnReader &value)
Prohibit copy constructor and assignment operator.
const string & GetMissing(void) const
const string & GetMatch(void) const
objects::CFastaDeflineReader::TSeqTitles TSeqTitles
void SetAlphabet(const string &value)
CRef< objects::CSeq_align > m_Aln
void SetMissing(const string &value)
void SetAllGap(const string &value)
Convenience function for setting beginning, middle, and end gap to the same thing.
list< CRef< objects::CSeq_id > > TIdList
Parsed result data (analogous to SAlignmentFile) Seqs are upper-case strings representing the sequenc...
vector< TLineInfo > m_DeflineInfo
vector< TAlignMiddleInterval > TAlignMiddles
const string & GetBeginningGap(void) const
CAlnErrorContainer TErrorList
Include a standard set of the NCBI C++ Toolkit most basic headers.
Operators to edit gaps in sequences.
static unsigned int line_num
unsigned int TSeqPos
Type for sequence locations and lengths.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
#define NCBI_XOBJREAD_EXPORT
const GenericPointer< typename T::ValueType > T2 value
#define row(bind, expected)