& rawDefStr,
74 stringdefStr = rawDefStr.substr(1);
86 boolwaitingForSeqData =
false;
87vector<unsigned> expectedDataSizes;
88 unsignedcurrentDataLineIndex = 0;
89 boolprocessingFirstSequence =
true;
90 unsignedexpectedNumLines = 0;
94 while(iStr.
ReadLine(line, lineNumber)) {
100 if(waitingForSeqData) {
102waitingForSeqData =
false;
103processingFirstSequence =
false;
108 if(processingFirstSequence) {
109expectedDataSizes.push_back(seqData.size());
113 if(!expectedNumLines) {
114expectedNumLines =
static_cast<unsigned>(expectedDataSizes.size());
116 autocurrentDataSize = seqData.size();
117 autoexpectedDataSize = (currentDataLineIndex < expectedNumLines) ?
118expectedDataSizes[currentDataLineIndex] :
120 if(currentDataSize != expectedDataSize) {
130 mSequences.back().push_back({seqData, lineNumber});
131currentDataLineIndex++;
145 "Invalid Fasta definition line. \">\" must be followed by a sequence_ID.");
155 "Duplicate ID: \"%s\" has already appeared at line %d.",
156seqId.c_str(), existingInfo.
mNumLine);
160 "Conflicting IDs: \"%s\" differs only in case from \"%s\" at line %d.",
161seqId.c_str(), existingInfo.
mData.c_str(), existingInfo.
mNumLine);
169 mSeqIds.push_back({seqId, lineNumber});
170 mDeflines.push_back({defLine, lineNumber});
172waitingForSeqData =
true;
173currentDataLineIndex = 0;
string BadCharCountPrintf(int expectedCount, int actualCount)
END_ENUM_INFO string ErrorPrintf(const char *format,...)
static void sSplitFastaDef(const string &rawDefStr, string &seqId, string &defLine)
void xImportAlignmentData(CSequenceInfo &, CLineInput &) override
vector< TLineInfo > mSeqIds
vector< vector< TLineInfo > > mSequences
ESeqIdComparison xGetExistingSeqIdInfo(const string &seqId, TLineInfo &existingInfo)
vector< TLineInfo > mDeflines
virtual bool ReadLine(string &line, int &lineNum)=0
The NCBI C++ standard methods for dealing with std::string.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
void StripBlanks(const string &line, string &stipped)
@ eAlnSubcode_BadDataCount
@ eAlnSubcode_UnexpectedSeqId
@ eAlnSubcode_IllegalDefinitionLine
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4