{
CAgpErr::E_SameGapLength,
"same gap_length=X in all gap lines, and component_type='N' ('U' is required for gaps of unknown size)"},
80{
CAgpErr::W_GapObjEnd,
"gap at the end of object (OK if X is the circular chromosome/plasmid)"},
83 "a scaffold, two non scaffold-breaking gaps, ...)"},
136{
CAgpErr::W_GnlId,
"\"gnl|\" prefix in X is deprecated inside AGP files (no \"prefix|\" is best)"},
147{
CAgpErr::G_BadObjLen,
"final object_end (column 3) not equal to object length in FASTA file(s)"},
156 "expecting 9 tab-separated columns",
157 "column X is empty",
159 "invalid value for X",
162 "X must be a positive integer",
163 "X must not exceed 4294967294",
164 "object_end is less than object_beg",
165 "component_end is less than component_beg",
166 "object range length not equal to the gap length",
167 "object range length not equal to component range length",
169 "duplicate object ",
170 "first line of an object must have object_beg=1",
171 "first line of an object must have part_number=1",
172 "part number (column 4) != previous part number + 1",
173 "'na' or ? (formerly 0) component orientation may only be used in a singleton scaffold",
175 "object_beg != previous object_end + 1",
176 "no valid AGP lines",
177 "consequtive gaps lines with the same type and linkage",
178 "in \"Scaffold from component\" file, invalid scaffold-breaking gap",
179 "in \"Chromosome from scaffold\" file, invalid \"within-scaffold\" gap",
181 "scaffold X was not defined in any of \"Scaffold from component\" files",
182 "scaffold X is not used in any of \"Chromosome from scaffold\" files",
184 "same gap_length=X in all gap lines, and component_type='N' ('U' is required for gaps of unknown size)",
186 "invalid use of \"|\" character",
188 "singleton object has component_beg=1 and in minus orientation",
195 "gap at the end of object (OK if X is the circular chromosome/plasmid)",
196 "gap at the beginning of object ",
197 "two consequtive gap lines (e.g. a gap at the end of " 198 "a scaffold, two non scaffold-breaking gaps, ...)",
199 "no components in object",
200 "the span overlaps a previous span for this component",
202 "component span appears out of order",
203 "duplicate component with non-draft type",
204 "line with component_type X appears to be a gap line and not a component line",
205 "line with component_type X appears to be a component line and not a gap line",
206 "extra tab or space at the end of line",
208 "gap line missing column 9 (null)",
209 "missing line separator at the end of file",
210 "extra text in the column 9 of the gap line",
211 "object names appear sorted, but not in a numerical order",
212 "component_id looks like a WGS accession, component_type is not W",
214 "component_id looks like a non-WGS accession, yet component_type is W",
216 "object name (column 1) is the same as component_id (column 6)",
220 "gap length (column 6) is not 100 for a gap of unknown size (an INSDC standard)",
221 "same component_id found on different scaffolds",
232 "in unplaced singleton scaffold, component is not used in full",
234 "in unplaced singleton scaffold, component orientation is not \"+\"",
235 "gap shorter than 10 bp",
236 "space in object name ",
237 "comments only allowed at the beginning of the file in AGP 2.0",
238 "orientation '0' is deprecated in AGP 2.0; use '?' instead",
240 "linkage (column 9) should be 'na' for a gap with linkage 'no' (AGP 2.0)",
241 "old gap type; not used in AGP 2.0",
242 "assuming AGP version X",
243 "in \"Chromosome from scaffold\" file, scaffold is not used in full",
244 "missing linkage evidence (column 9) (AGP 2.0)",
247 "AGP version comment is invalid, expecting ##agp-version 1.1 or ##agp-version 2.0",
248 "ignoring AGP version comment - version already set to X",
249 "linkage evidence term X appears more than once",
250 "component_id X is not an HTG accession, but is used with component_type A, D, or F",
251 "all objects are singletons with component_beg=1",
253 "\"gnl|\" prefix in X is deprecated inside AGP files (no \"prefix|\" is best)",
254 "component_id X is a not an accession, but is used with component_type other than W",
260 "invalid component_id",
261 "component_id not in GenBank",
262 "component_id X is ambiguous without an explicit version",
263 "component_end greater than sequence length",
264 "sequence data is invalid or unavailable",
266 "taxonomic data is not available",
267 "object X not found in FASTA file(s)",
268 "final object_end (column 3) not equal to object length in FASTA file(s)",
269 "run(s) of Ns within the component span",
281 autoit = sMessageMap.find(
static_cast<EErrCode>(
code));
282 if(it != sMessageMap.end()) {
283 returnit->second.data();
291 if( details.size()==0 )
return msg;
296 return msg.substr(0, pos) + details +
msg.substr(pos+1);
298 else if(details.size()>2 && details[0]==
'X'&& details[1]==
' '&&
msg==
"no valid AGP lines"){
300 returndetails.substr(2);
303 return msg+ details;
378m_agp_version(agp_version), m_reader(reader),
384m_agp_version(agp_version), m_reader(reader),
401 int*perror_code,
boollog_errors)
412 if(perror_code && 0==*perror_code) {
413*perror_code = error_code;
420ret_value =
static_cast<TAgpPos>(pos);
431 booltabsStripped=
false;
432 boolextraTabOrSpace=
false;
436 if( line[
pcomment-1]==
'\t') tabsStripped=
true;
449 if(line[pos-1]==
' ') {
452}
while(pos>0 && line[pos-1]==
' ');
455extraTabOrSpace=
true;
464 if(
cols.size()==10 &&
cols[9]==
"") {
467 else if(
cols.size() < 8 ||
cols.size() > 9 ) {
470 string(
", found ") +
i2s(
cols.size()) );
478 if( (
NPOS!= p_space && p_space<
pcomment) || line[0]==
' '|| line[
cols[0].
size()-1]==
' ') {
484 for(
int i=0;
i<8;
i++) {
498 if(error_code)
returnerror_code;
521 if(
cols.size()==8) {
535 if(component_range_len != object_range_len) {
537 i2s(object_range_len ) +
" != "+
538 i2s(component_range_len)
557 if(
cols.size()==8 && tabsStripped==
false) {
573 if(
cols.size()==9 &&
cols[8].size()>0 &&
583 i2s(object_range_len ) +
" != "+
610 if(error_code)
returnerror_code;
626 switch( orientation_char )
721 msg=
"1.1 since linkage evidence (column 9) is empty";
725 msg=
"2 since linkage evidence (column 9) is NOT empty";
770 "linkage_evidence (column 9): 'na' can only be used for gaps with linkage 'no'");
774vector<string> raw_linkage_evidences;
776 boolhas_unspecified=
false;
777 ITERATE( vector<string>, evid_iter, raw_linkage_evidences ) {
794 if(has_unspecified && raw_linkage_evidences.size()>1) {
798 "linkage_evidence (column 9) -- \"unspecified\" cannot be combined with other terms");
823(
linkage?
"yes":
"no") +
"\t";
852 if( comp_end > comp_len) {
853 stringdetails=
": ";
854details +=
i2s(comp_end);
857details +=
" length = ";
858details +=
i2s(comp_len);
892 if(res.size())
returnres;
895 if(res.size()) res +=
";";
907 if( !
result.empty() ) {
910 const char*
le=
le_str( *evid_iter );
912 else result+=
"ERROR:UNKNOWN_LINKAGE_EVIDENCE_TYPE:"+
i2s( (
int)*evid_iter );
916 return linkage?
"unspecified":
"na";
931 return "ERROR:UNKNOWN_ORIENTATION:"+
948 return "gap type=contig, linkage=no, linkage evidence=na";
962 return string(
"gap type=scaffold, linkage=yes, linkage evidence=")+
le_str(
le)+
" or unspecified";
972m_agp_version(agp_version)
980m_agp_version(agp_version)
1032 if(this_row->
is_gap) {
1040 const autoprevGapType = prev_row->
gap_type;
1041 const autocurrentGapType = this_row->
gap_type;
1042 if( prevGapType == currentGapType &&
1064 if( !
OnError() )
return false;
1199 if(filename.size()){
1212 if(filename.size()){
1230 static const char* kAgpVersionCommentStart =
"##agp-version";
1235strlen(kAgpVersionCommentStart) );
1239 if( versionStartPos !=
NPOS&& versionEndPos !=
NPOS) {
1241(versionEndPos - versionStartPos) + 1 );
1274 out<<
"### Errors within a single line. Lines with such errors are skipped, ###\n";
1275 out<<
"### i.e. not used for: further checks, object/component/gap counts. ###\n";
1279 out<<
" (X: 1..9)";
1282 out<<
" (X: component_type, gap_type, linkage, orientation)";
1285 out<<
" (X: object_beg, object_end, part_num, gap_length, component_beg, component_end)";
1290 out<<
"### Errors that may involve several lines ###\n";
1294 out<<
" in object_id";
1299 out<<
"### Warnings (most are errors in -sub mode) ###\n";
1303 if(lbl!=lbl_strict) lbl+=
"/"+lbl_strict;
1304 out<< lbl <<
"\t";
1306 out<<
GetMsg(
i) <<
" (no longer reported)";
1320 out<<
"### Errors for GenBank-based (-alt) and other component checks (-g, FASTA files) ###\n";
1326 "#\tErrors reported once at the end of validation:\n" 1327 "#\tunable to determine a Taxid for the AGP (less than 80% of components have one common taxid)\n" 1328 "#\tcomponents with incorrect taxids\n" 1329 "#Error with -sub, warning if no -sub option:\n" 1330 "#\tcomponent name(s)/object name(s) in FASTA not found in AGP\n" 1331 "#\tscaffold(s) not found in Chromosome from scaffold AGP\n" 1343 if( res[0]==
'w') {
1349 if(
code<10) res +=
"0";
1355 const string& filename,
intlinenum,
const string& content)
1357 stringline=content.size()<200 ? content : content.substr(0,160)+
"...";
1361 SIZE_TYPEposComment = line.find(
"#");
1362 if(posComment!=
NPOS) {
1363comment=line.substr(posComment);
1364line.resize(posComment);
1367 if(posSpace!=
NPOS) {
1369 if(posTab!=
NPOS&& posTab>posSpace+1 && posSpace!=0 ) {
1372posTab = line.find(
" ", posTab+1);
1373 if(posTab!=
NPOS) posSpace = posTab;
1376line = line.substr(0, posSpace) +
"<<<SPACE!"+ line.substr(posSpace);
1379 if(filename.size()) ostr << filename <<
":";
1380ostr<< linenum <<
":"<< line << comment <<
"\n";
1387p1 =
text.find(
"&#", p1);
1388 if(p1==
NPOS)
break;
1392 if(
text.substr(p1, p2-p1)==
"	") {
1398 text=
text.substr(0,p1) +
"...";
1405 const string& filename,
intlinenum,
const string& content,
1406 booltwo_lines_involved)
1408 stringattr=
"num=\""+
i2s(linenum)+
"\"";
1409 if(filename.size()) attr+=
" filename=\""+
NStr::XmlEncode(filename) +
"\"";
1410 if(two_lines_involved) attr+=
" two_lines=\"true\"";
1415ostr <<
" <line "<< attr <<
">"<< xml_content <<
"</line>\n";
1420 const string& details)
1439ostr <<
" <text>"<<
text<<
"</text>\n";
1441ostr <<
"</message>\n";
1490 "s_msg[] size != G_Last+1");
1494 "CAgpErrEx -- GetMsg(E_Last) not empty");
1498 "CAgpErrEx -- GetMsg(W_Last) not empty");
1500 "CAgpErrEx -- GetMsg(W_Last-1) is empty");
1502 "CAgpErrEx -- GetMsg(G_Last) not empty");
1504 "CAgpErrEx -- GetMsg(G_Last-1) is empty");
1617 "<line_num>current</line_num>",
1618 "<line_num>"+
i2s(
line_num)+
"</line_num>", m);
1657 stringres = skip_other ?
"Printing":
"Skipping";
1658 const static char* skipErr =
"Skipping errors, printing warnings.";
1659 const static char* skipWarn =
"Skipping warnings, printing errors.";
1664 if(
str==
"all") {
1668res+=
" all errors and warnings.";
1670 else if(
str==
"alt") {
1674res+=
" Accession/Length/Taxid errors.";
1676 else if(
str.substr(0,4)==
"warn"&&
str.size()<=8 ) {
1678res = skip_other ? skipErr : skipWarn;
1680 else if(
str.substr(0,4)==
"err"&&
str.size()<=6 ) {
1682res = skip_other ? skipWarn : skipErr;
1685 for(
int i=i_from;
i<i_to;
i++ )
m_MustSkip[
i] = !skip_other;
1693 if( matchesCode ||
string(
GetMsg(
i)).find(
str) !=
NPOS) {
1700 if(matchesCode)
break;
1721 boolstrictModeErrors =
false;
1722 boolstrictModeWarningsOnly=
false;
1734 else if(from==
G_Last) {
1743 for(
int i=from;
i<to;
i++) {
1746 if(strictModeErrors) {
1761 else if(from<
CODE_Last) { to=(from+1); }
1763ostr <<
"Internal error in CAgpErrEx::PrintMessageCounts().";
1768 for(
int i=from;
i<to;
i++) {
1770ostr <<
"<msg_summary>\n";
1773ostr <<
" <cnt>"<<
m_MsgCount[
i] <<
"</cnt>\n";
1774ostr <<
"</msg_summary>\n";
1778ostr <<
" <invalid_lines>"<<
m_lines_skipped<<
"</invalid_lines>\n";
1781 if(from<to) ostr<< setw(7) <<
"Count"<<
" Code Description\n";
1782 for(
int i=from;
i<to;
i++) {
1790 if(hints && (*hints).
find(
i)!=(*hints).end() ) {
1791ostr <<
" "<< (*hints)[
i] <<
"\n";
1796 " invalid lines were skipped (not subjected to all the checks, not included in most of the counts below).\n";
1803ostr <<
" <notes>"<< note_count <<
"</notes>\n";
1804ostr <<
" <warnings>"<< w_count <<
"</warnings>\n";
1805ostr <<
" <errors>"<< e_count <<
"</errors>\n";
1806ostr <<
" <skipped>"<< skipped_count <<
"</skipped>\n";
1811 if(e_count==0) ostr <<
"No errors, ";
1812 else if(e_count==1) ostr <<
"1 error, ";
1813 elseostr << e_count <<
" errors, ";
1815 if(w_count==0) ostr <<
"no warnings";
1816 else if(w_count==1) ostr <<
"1 warning";
1817 elseostr << w_count <<
" warnings";
1820ostr <<
", "<< note_count <<
" note";
1821 if(note_count>1) ostr <<
"s";
1824 if(skipped_count) {
1825ostr <<
"; "<< skipped_count <<
" not printed";
void ReplaceUnprintableCharacters(string &text)
MAKE_CONST_MAP(sMessageMap, CAgpErr::EErrCode, const char *, { {CAgpErr::E_ColumnCount, "expecting 9 tab-separated columns"}, {CAgpErr::E_EmptyColumn, "column X is empty"}, {CAgpErr::E_EmptyLine, "empty line"}, {CAgpErr::E_InvalidValue, "invalid value for X"}, {CAgpErr::E_InvalidLinkage, "invalid linkage"}, {CAgpErr::E_MustBePositive, "X must be a positive integer"}, {CAgpErr::E_MustFitSeqPosType, "X must not exceed 4294967294"}, {CAgpErr::E_ObjEndLtBeg, "object_end is less than object_beg"}, {CAgpErr::E_CompEndLtBeg, "component_end is less than component_beg"}, {CAgpErr::E_ObjRangeNeGap, "object range length not equal to the gap length"}, {CAgpErr::E_ObjRangeNeComp, "object range length not equal to component range length"}, {CAgpErr::E_DuplicateObj, "duplicate object "}, {CAgpErr::E_ObjMustBegin1, "first line of an object must have object_beg=1"}, {CAgpErr::E_PartNumberNot1, "first line of an object must have part_number=1"}, {CAgpErr::E_PartNumberNotPlus1, "part number (column 4) != previous part number + 1"}, {CAgpErr::E_UnknownOrientation, "'na' or ? (formerly 0) component orientation may only be used in a singleton scaffold"}, {CAgpErr::E_ObjBegNePrevEndPlus1, "object_beg != previous object_end + 1"}, {CAgpErr::E_NoValidLines, "no valid AGP lines"}, {CAgpErr::E_SameConseqGaps, "consequtive gaps lines with the same type and linkage"}, {CAgpErr::E_ScafBreakingGap, "in \"Scaffold from component\" file, invalid scaffold-breaking gap"}, {CAgpErr::E_WithinScafGap, "in \"Chromosome from scaffold\" file, invalid \"within-scaffold\" gap"}, {CAgpErr::E_UnknownScaf, "scaffold X was not defined in any of \"Scaffold from component\" files"}, {CAgpErr::E_UnusedScaf, "scaffold X is not used in any of \"Chromosome from scaffold\" files"}, {CAgpErr::E_SameGapLength, "same gap_length=X in all gap lines, and component_type='N' ('U' is required for gaps of unknown size)"}, {CAgpErr::E_InvalidBarInId, "invalid use of \"|\" character"}, {CAgpErr::E_Last, ""}, {CAgpErr::W_GapObjEnd, "gap at the end of object (OK if X is the circular chromosome/plasmid)"}, {CAgpErr::W_GapObjBegin, "gap at the beginning of object "}, {CAgpErr::W_ConseqGaps, "two consequtive gap lines (e.g. a gap at the end of " "a scaffold, two non scaffold-breaking gaps, ...)"}, {CAgpErr::W_ObjNoComp, "no components in object"}, {CAgpErr::W_SpansOverlap, "the span overlaps a previous span for this component"}, {CAgpErr::W_SpansOrder, "component span appears out of order"}, {CAgpErr::W_DuplicateComp, "duplicate component with non-draft type"}, {CAgpErr::W_LooksLikeGap, "line with component_type X appears to be a gap line and not a component line"}, {CAgpErr::W_LooksLikeComp, "line with component_type X appears to be a component line and not a gap line"}, {CAgpErr::W_ExtraTab, "extra tab or space at the end of line"}, {CAgpErr::W_GapLineMissingCol9, "gap line missing column 9 (null)"}, {CAgpErr::W_NoEolAtEof, "missing line separator at the end of file"}, {CAgpErr::W_GapLineIgnoredCol9, "extra text in the column 9 of the gap line"}, {CAgpErr::W_ObjOrderNotNumerical, "object names appear sorted, but not in a numerical order"}, {CAgpErr::W_CompIsWgsTypeIsNot, "component_id looks like a WGS accession, component_type is not W"}, {CAgpErr::W_CompIsNotWgsTypeIs, "component_id looks like a non-WGS accession, yet component_type is W"}, {CAgpErr::W_ObjEqCompId, "object name (column 1) is the same as component_id (column 6)"}, {CAgpErr::W_GapSizeNot100, "gap length (column 6) is not 100 for a gap of unknown size (an INSDC standard)"}, {CAgpErr::W_BreakingGapSameCompId, "same component_id found on different scaffolds"}, {CAgpErr::W_UnSingleCompNotInFull, "in unplaced singleton scaffold, component is not used in full"}, {CAgpErr::W_SingleOriNotPlus, "component orientation is not \"+\" in a single component scaffold"}, {CAgpErr::W_ShortGap, "gap shorter than 10 bp"}, {CAgpErr::W_SpaceInObjName, "space in object name "}, {CAgpErr::W_CommentsAfterStart, "comments only allowed at the beginning of the file in AGP 2.0"}, {CAgpErr::W_OrientationZeroDeprecated, "orientation '0' is deprecated in AGP 2.0; use '?' instead"}, {CAgpErr::W_NaLinkageExpected, "linkage (column 9) should be 'na' for a gap with linkage 'no' (AGP 2.0)"}, {CAgpErr::W_OldGapType, "old gap type; not used in AGP 2.0"}, {CAgpErr::W_AssumingVersion, "assuming AGP version X"}, {CAgpErr::W_ScafNotInFull, "in \"Chromosome from scaffold\" file, scaffold is not used in full"}, {CAgpErr::W_MissingLinkage, "missing linkage evidence (column 9) (AGP 2.0)"}, {CAgpErr::W_AGPVersionCommentInvalid, "AGP version comment is invalid, expecting ##agp-version 1.1 or ##agp-version 2.0"}, {CAgpErr::W_AGPVersionCommentUnnecessary, "ignoring AGP version comment - version already set to X"}, {CAgpErr::W_DuplicateEvidence, "linkage evidence term X appears more than once"}, {CAgpErr::W_CompIsNotHtgTypeIs, "component_id X is not an HTG accession, but is used with component_type A, D, or F"}, {CAgpErr::W_SingletonsOnly, "all objects are singletons with component_beg=1"}, {CAgpErr::W_GnlId, "\"gnl|\" prefix in X is deprecated inside AGP files (no \"prefix|\" is best)"}, {CAgpErr::W_CompIsLocalTypeNotW, "component_id X is a not an accession, but is used with component_type other than W"}, {CAgpErr::G_InvalidCompId, "invalid component_id"}, {CAgpErr::G_NotInGenbank, "component_id not in GenBank"}, {CAgpErr::G_NeedVersion, "component_id X is ambiguous without an explicit version"}, {CAgpErr::G_CompEndGtLength, "component_end greater than sequence length"}, {CAgpErr::G_DataError, "sequence data is invalid or unavailable"}, {CAgpErr::G_TaxError, "taxonomic data is not available"}, {CAgpErr::G_InvalidObjId, "object X not found in FASTA file(s)"}, {CAgpErr::G_BadObjLen, "final object_end (column 3) not equal to object length in FASTA file(s)"}, {CAgpErr::G_NsWithinCompSpan, "run(s) of Ns within the component span"}, })
@ eAgpVersion_auto
auto-detect using the first gap line
@ eAgpVersion_1_1
AGP spec 1.1.
@ eAgpVersion_2_0
AGP spec 2.0 or later.
ncbi::TMaskedQueryRegions mask
CAgpErrEx(CNcbiOstream *out=&cerr, bool use_xml=false, EOwnership eOwnsOut=eNoOwnership)
const char * ErrorWarningOrNoteEx(int code)
int m_MsgCount[CODE_Last]
string SkipMsg(const string &str, bool skip_other=false)
virtual void Msg(int code, const string &details, int appliesTo=fAtThisLine)
void PrintMessageCounts(CNcbiOstream &ostr, int from, int to=E_First, bool report_lines_skipped=false, TMapCcodeToString *hints=nullptr)
AutoPtr< CNcbiOstrstream > m_messages
char m_MustSkip[CODE_Last]
static void PrintLine(CNcbiOstream &ostr, const string &filename, int linenum, const string &content)
vector< string > m_InputFiles
bool m_two_lines_involved
virtual void PrintMessage(CNcbiOstream &ostr, int code, const string &details=NcbiEmptyString)
Print the message by code, preceded by "ERROR" or "WARNING".
@ CODE_Last
This is one past the last code allowed, after built-in and user errors.
string GetPrintableCode(int code, bool strict=false) const
bool TreatAsError(int code) const
void PrintAllMessages(CNcbiOstream &out) const
AutoPtr< CNcbiOstream > m_out_destroyer
virtual void PrintMessageXml(CNcbiOstream &ostr, int code, const string &details, int appliesTo)
virtual void LineDone(const string &s, int line_num, bool invalid_line=false)
static void PrintTotalsXml(CNcbiOstream &ostr, int e_count, int w_count, int note_count, int skipped_count)
void StartFile(const string &s)
static void PrintTotals(CNcbiOstream &ostr, int e_count, int w_count, int note_count, int skipped_count)
int GetCount(EErrCode code) const
static void PrintLineXml(CNcbiOstream &ostr, const string &filename, int linenum, const string &content, bool two_lines_involved)
static bool IsStrictModeWarning(int code)
int CountTotals(int from, int to=E_First)
virtual void Msg(int code, const string &details, int appliesTo=fAtThisLine)
static const char * ErrorWarningOrNote(int code)
static const char * GetMsg(int code)
virtual int AppliesTo(int mask=0xFFFFFFFF)
@ W_AGPVersionCommentUnnecessary
@ W_BreakingGapSameCompId
@ W_AGPVersionCommentInvalid
@ W_UnSingleCompNotInFull
@ W_OrientationZeroDeprecated
static string FormatMessage(const string &msg, const string &details)
string m_messages_prev_line
static const TStr s_msg[]
virtual string GetErrorMessage(int mask=0xFFFFFFFF)
Detects scaffolds, object boundaries, errors that involve 2 consecutive lines, and is intended as a s...
EFinalize
Whether or not the function should call Finalize() when it's done successfully.
CAgpReader(CAgpErr *arg, EAgpVersion agp_version=eAgpVersion_auto)
virtual void OnObjectChange()
virtual int Finalize()
This is called at the end of the file, usually automatically but can be called manually if the automa...
CRef< CAgpRow > m_prev_row
CRef< CAgpRow > m_this_row
virtual void OnScaffoldEnd()
EAgpVersion m_agp_version
void x_CheckPragmaComment(void)
virtual void SetVersion(EAgpVersion ver)
Change what AGP version to use for the next input that's read.
virtual void OnGapOrComponent()
virtual string GetErrorMessage(const string &filename=NcbiEmptyString)
Return a string with one (or two, depending on error) source line(s) on which the error occured,...
virtual int ReadStream(CNcbiIstream &is, EFinalize eFinalize=eFinalize_Yes)
Read an AGP file from the given input stream.
bool ProcessThisRow()
Invoked from ReadStream(), after the row has been parsed, and seldom needs to be invoked by user.
void SetErrorHandler(CAgpErr *arg)
A container for both the original string column values (Get*() methods) and the values converted to i...
@ fLinkageEvidence_strobe
@ fLinkageEvidence_HIGHEST_BIT_MASK
@ fLinkageEvidence_align_genus
@ fLinkageEvidence_paired_ends
@ fLinkageEvidence_align_xgenus
@ fLinkageEvidence_align_trnscpt
@ fLinkageEvidence_within_clone
@ fLinkageEvidence_INVALID
@ fLinkageEvidence_clone_contig
@ fLinkageEvidence_proximity_ligation
@ fLinkageEvidence_unspecified
int ParseComponentCols(bool log_errors=true)
int ParseGapCols(bool log_errors=true)
string LinkageEvidencesToString(void)
string SubstOldGap(bool do_subst)
Returns a string describing suggested replacement, or "" if none is needed.
string & GetComponentId()
virtual void SetVersion(EAgpVersion ver)
string OrientationToString(EOrientation orientation)
static bool CheckComponentEnd(const string &comp_id, TAgpPos comp_end, TAgpLen comp_len, CAgpErr &agp_err)
static CRef< CAgpRow > New(CAgpErr *arg, EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
string LinkageEvidenceFlagsToString()
string ToString(bool reorder_linkage_evidences=false)
int linkage_evidence_flags
a bit map which holds summary of info in linkage_evidences.
map< string, EGap > TMapStrEGap
bool GapEndsScaffold() const
string & GetOrientation()
static bool GapValidAtObjectEnd(EGap gap_type)
TAgpPos ReadSeqPos(const CTempString seq_pos_str, const string &details, int *perror_code, bool log_errors=true)
static const TStr gap_types[eGapCount]
static int str_to_le(const string &str)
EAgpVersion m_agp_version
CAgpRow(CAgpErr *arg, EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
string & GetComponentType()
static TMapStrEGap * gap_type_codes_creator(void)
static const char * le_str(ELinkageEvidence le)
int FromString(const string &line)
TLinkageEvidenceVec linkage_evidences
void SetErrorHandler(CAgpErr *arg)
string & GetComponentEnd()
static CSafeStatic< TMapStrEGap > gap_type_codes
string & GetComponentBeg()
string & GetLinkageEvidence()
vector< ELinkageEvidence > TLinkageEvidenceVec
Might have duplicates, and is empty on error or if there are no actual linkage evidences (e....
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
container_type::const_iterator const_iterator
const_iterator find(const key_type &key) const
std::ofstream out("events_result.xml")
main entry point for tests
static unsigned int line_num
static const char * str(char *buf, int n)
void reset(element_type *p=0, EOwnership ownership=eTakeOwnership)
Reset will delete the old pointer (if owned), set content to the new value, and assume the ownership ...
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eTakeOwnership
An object can take ownership of another.
#define NCBI_ASSERT(expr, mess)
uint8_t Uint1
1-byte (8-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
bool IsOssEmpty(CNcbiOstrstream &oss)
CNcbiIstream & NcbiGetline(CNcbiIstream &is, string &str, char delim, string::size_type *count=NULL)
Read from "is" to "str" up to the delimiter symbol "delim" (or EOF)
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
NCBI_NS_STD::string::size_type SIZE_TYPE
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string XmlEncode(const CTempString str, TXmlEncode flags=eXmlEnc_Contents)
Encode a string for XML.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
const char *const kEmptyCStr
Empty "C" string (points to a '\0').
@ fConvErr_NoThrow
Do not throw an exception on error.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
static void text(MDB_val *v)
const string version
version string
const struct ncbi::grid::netcache::search::fields::SIZE size
bool le(T x_, T y_, T round_)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
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