m_uFeatureCount( 0 ), m_bHavePrintedSourceFeatureJavascript(
false),
86m_bSourceDescriptorDone(
false)
88SetIndent(
string(12,
' '));
89SetFeatIndent(
string(21,
' '));
90SetBarcodeIndent(
string(35,
' '));
102 template<
classTFlatItemClass>
105CWrapperForFlatTextOStream(
109 constTFlatItemClass& item ) :
110m_block_callback(block_callback),
111m_orig_text_os(orig_text_os),
118~CWrapperForFlatTextOStream()
126 ERR_POST_X(2,
"Missed flatfile output halt request in " 136m_block_callback->notify(m_block_text_str, *m_ctx, m_item);
140 "A CGenbankBlockCallback has requested that flatfile generation halt");
147m_orig_text_os.AddLine(m_block_text_str,
nullptr, eAddNewline_No);
154 size_tadd_size = m_block_text_str.size();
156add_size += (line->
size() + 1);
158m_block_text_str.reserve(
max(m_block_text_str.capacity(), add_size));
160 AddLine(*line, obj, eAddNewline_Yes);
165EAddNewline add_newline )
167m_block_text_str.reserve(
max(m_block_text_str.capacity(),
168m_block_text_str.length() +
170(add_newline == eAddNewline_Yes?1:0) ) );
171m_block_text_str.append(line.
data(), line.
size());
172 if( add_newline == eAddNewline_Yes ) {
173m_block_text_str +=
'\n';
182 constTFlatItemClass& m_item;
185 stringm_block_text_str;
190 template<
classTFlatItemClass>
193 constTFlatItemClass& item,
198item.GetContext()->Config().GetGenbankBlockCallback();
199 if( block_callback ) {
201p_text_os.
Reset(
newCWrapperForFlatTextOStream<TFlatItemClass>(
202block_callback, orig_text_os,
ctx, item) );
223 if( loc.
IsPnt() &&
230 result<<
"["<< (point+1) <<
", "<< (point+2) <<
"]]";
235 boolis_first =
true;
237 for( ; loc_piece_iter ; ++loc_piece_iter ) {
243 if( seq_id_handle && bioseq_handle && ! bioseq_handle.
IsSynonym(seq_id_handle) ) {
265 result<<
"["<< (from + 1) <<
", "<< (to + 1) <<
"]";
277 stringaccn =
ctx.GetAccession();
278 SIZE_TYPEperiod_pos = accn.find_first_of(
".");
279 if( period_pos !=
NPOS) {
280accn.resize(period_pos);
290 result<<
"<a name=\""<< sAnchorName <<
"_" 291<<
ctx->GetAccession() <<
"\"></a>";
301 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, end_item, orig_text_os);
305 const boolbHtml = cfg.
DoHTML();
309 l.push_back(
"//</pre>");
312 l.push_back(
"//");
366 static const char* strands[] = {
" ",
"ss-",
"ds-",
"ms-"};
369 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, locus, orig_text_os);
374ostringstream locus_line;
376 const char* units =
"bp";
377 if( !
ctx.IsProt() ) {
378 if( (
ctx.IsWGSMaster() && !
ctx.IsRSWGSNuc() ) ||
379 ctx.IsTSAMaster() ||
ctx.IsTLSMaster() )
392locus_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
395 size_tlocuslength = locusname.length();
397locus_line << setw(16) << locusname;
403 intspaceForLength =
min( 12, (
int)(12 - (locuslength - 16)) );
404locus_line.setf(IOS_BASE::right, IOS_BASE::adjustfield);
407<< setw(spaceForLength-1) << locus.
GetLength()
412locus_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
424 stringlocus_line_str = locus_line.str();
448 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, defline, orig_text_os);
455 Wrap(
l,
"DEFINITION", defline_text);
472 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, acc, orig_text_os);
478acc_line =
"<a href=\"";
479acc_line += link_base + acc_str +
"\">"+ acc_str +
"</a>";
484acc_line +=
" REGION: ";
489 l.push_back(
"ACCESSION ");
494 Wrap(
l,
"ACCESSION", acc_line);
514ostringstream version_line;
516 if(
version.GetAccession().empty() ) {
517 l.push_back(
"VERSION");
519version_line <<
version.GetAccession();
523version_line <<
" GI:"<<
version.GetGi();
526 stringversion_line_str = version_line.str();
527 if(
version.GetContext()->Config().DoHTML() ) {
548 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, gp, orig_text_os);
551 const char*prefix =
"DBLINK";
555ostringstream project_line;
556project_line <<
"Project: ";
562project_line <<
", ";
565 const intproj_num = *proj_num_iter;
570project_line << proj_num;
574 stringproject_line_str = project_line.str();
591 if( !
l.empty() ) {
607 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, html_anchor, orig_text_os);
621 if( csh.
Skip() ) {
625vector<string>* rcx = csh.
GetCache();
629 stringprefix = (csh.
IsProt() ?
"residues":
"bases");
630 for(
auto&
str: *rcx) {
634text_os.
AddLine(
str.substr(0, pos + 2) + prefix +
" 1 to "+ suffix);
653 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, keys, orig_text_os);
675 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, seg, orig_text_os);
678ostringstream segment_line;
682 Wrap(
l,
"SEGMENT", segment_line.str());
715ostringstream source_line;
717 stringprefix =
source.IsUsingAnamorph() ?
" (anamorph: ":
" (";
719source_line <<
source.GetOrganelle() <<
source.GetTaxname();
720 if( !
source.GetCommon().empty() ) {
721source_line << prefix <<
source.GetCommon() <<
")";
723 stringline = source_line.str();
725 if(
source.GetContext()->Config().DoHTML() ) {
740 if(
source.GetContext()->Config().DoHTML()) {
741 stringlineage =
source.GetLineage();
760 const stringstrBaseUrlCambiaPatentLensHead(
761 "https://www.lens.org/lens/search/patent/list?q=");
776strPatString =
"CAMBIA Patent Lens: US ";
777strPatString +=
"<a href=\"";
778strPatString += strBaseUrlCambiaPatentLensHead;
780strPatString +=
"%20";
782strPatString +=
"\">";
784strPatString +=
"</a>";
787strPatString =
string(
"CAMBIA Patent Lens: US ");
799 stringstrFeatureLink;
800 returnstrFeatureLink;
808 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, ref, orig_text_os);
825 if(
ctx.Config().DoHTML() ) {
831vector<string>* rc =
ctx.GetRefCache();
833 for(
auto str:
l) {
834rc->push_back(
str);
849 const stringstrDummyProt(
"<!PROT!>");
852 while( uLinkStart !=
NPOS) {
853 size_tuLinkStop = strText.find_first_of(
" \t\n", uLinkStart );
854 if( uLinkStop ==
NPOS) {
855uLinkStop = strText.length();
860 if( uLinkStart > 0 && ( strText[uLinkStart-1] ==
'"'|| strText[uLinkStart-1] ==
'>') ) {
865 stringstrLink = strText.substr( uLinkStart, uLinkStop - uLinkStart );
867string::size_type last_good_char = strLink.find_last_not_of(
"\".),<>'");
868 if( last_good_char !=
NPOS) {
869strLink.resize( last_good_char + 1 );
872 stringstrDummyLink =
NStr::Replace( strLink, strProtocol, strDummyProt );
873 stringstrReplace(
"<a href=\"");
874strReplace += strDummyLink;
875strReplace +=
"\">";
876strReplace += strDummyLink;
877strReplace +=
"</a>";
880uLinkStart =
NStr::FindNoCase( strText, strProtocol +
"://", uLinkStart + strReplace.length() );
893ostringstream ref_line;
900ref_line << serial <<
' ';
904ref_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
905ref_line << setw(3) << serial;
911ref_line <<
"(sites)";
917 stringref_line_str = ref_line.str();
937 if( authors.empty() ) {
939 if(
ctx.Config().IsFormatGenbank() ) {
941}
else if(
ctx.Config().IsFormatEMBL() ) {
948string::size_type last_periods = authors.find_last_not_of(
'.');
949 if( last_periods != string::npos ) {
951 if( last_periods < authors.length() ) {
952authors.resize( last_periods );
1018 boolbHtml =
ctx.Config().DoHTML();
1020 stringstrDummy(
"[PUBMED-ID]");
1026 stringstrLink =
"<a href=\"";
1028strLink += strPubmed;
1030strLink += strPubmed;
1032strPubmed = strLink;
1049 if(
ctx.Config().DoHTML() ) {
1050 stringstrRaw = strPubmed;
1051strPubmed =
"<a href=\"https://www.ncbi.nlm.nih.gov/pubmed/";
1052strPubmed += strRaw;
1053strPubmed +=
"\">";
1054strPubmed += strRaw;
1055strPubmed +=
"</a>";
1067 const boolis_html =
ctx.Config().DoHTML();
1083 ctx.Config().DoHTML() );
1084 if( ! strCambiaPatentLens.empty() ) {
1089 Wrap(
l,
"REMARK", strCambiaPatentLens,
eSubp);
1100 if( !
ctx.Config().IsModeEntrez() ) {
1101first_line =
"<pre>"+ first_line;
1110 boolhas_comment =
false;
1115 if( desc_ci1 || desc_ci2 || desc_ci3 ) {
1116has_comment =
true;
1120 for( ; user_iter; ++user_iter ) {
1121 const CSeqdesc& desc = *user_iter;
1124 if( type_str ==
"RefGeneTracking"||
1125type_str ==
"GenomeBuild"||
1126type_str ==
"ENCODE")
1128has_comment =
true;
1135 if( ! has_comment ) {
1142 if(
r.CanGetDate() && !
r.GetIds().empty() )
1144has_comment =
true;
1150 if(
r.CanGetDate() && !
r.GetIds().empty() )
1152has_comment =
true;
1162 boolhas_contig =
false;
1168 const booldo_contig_style =
ctx.DoContigStyle();
1169 const boolshow_contig = ( (
ctx.IsSegmented() &&
ctx.HasParts()) ||
1170(
ctx.IsDelta() && !
ctx.IsDeltaLitOnly()) );
1177 boolhas_sequence =
false;
1180has_sequence =
true;
1185 const string& accn =
ctx.GetAccession();
1186 result<<
"<div class=\"localnav\"><ul class=\"locals\">";
1187 if( has_comment ) {
1188 result<<
"<li><a href=\"#comment_"<< accn <<
"\" title=\"Jump to the comment section of this record\">Comment</a></li>";
1190 result<<
"<li><a href=\"#feature_"<< accn <<
"\" title=\"Jump to the feature table of this record\">Features</a></li>";
1192 result<<
"<li><a href=\"#contig_"<< accn <<
"\" title=\"Jump to the contig section of this record\">Contig</a></li>";
1194 if( has_sequence ) {
1195 result<<
"<li><a href=\"#sequence_"<< accn <<
"\" title=\"Jump to the sequence of this record\">Sequence</a></li>";
1200 if(
ctx.GetPrevHandle() ||
ctx.GetNextHandle() ) {
1201 result<<
"<ul class=\"nextprevlinks\">";
1202 if(
ctx.GetNextHandle() ) {
1204 const TGigi =
ctx.GetNextHandle().GetAccessSeq_id_Handle().GetGi();
1206 result<<
"<li class=\"next\"><a href=\"#locus_"<< gi <<
"\" title=\"Jump to "<< accn <<
"\">Next</a></li>";
1208 if(
ctx.GetPrevHandle() ) {
1210 const TGigi =
ctx.GetPrevHandle().GetAccessSeq_id_Handle().GetGi();
1212 result<<
"<li class=\"prev\"><a href=\"#locus_"<< gi <<
"\" title=\"Jump to "<< accn <<
"\">Previous</a></li>";
1218 result<<
"</div>"<<
'\n';
1219 result<<
"<pre class=\"genbank\">";
1222first_line =
result.str();
1238ostringstream pre_feature_html;
1239pre_feature_html <<
"<span id=\"feature_"<<
ctx.GetAccession()
1240<<
"_"<< strKey <<
"_"<< feat_type_count <<
"\" class=\"feature\">";
1243pre_feature_html <<
"<script type=\"text/javascript\">";
1247pre_feature_html <<
"if " 1248 "(typeof(oData) == \"undefined\") oData = []; oData.push " 1249 "({gi:"<<
ctx.GetGI() <<
",acc:\"" 1251<<
"\",features: {}});";
1256<<
"if (!oData[oData.length - 1].features[\""<< strKey
1257<<
"\"]) oData[oData.length - 1].features[\""<< strKey
1259<<
"oData[oData.length - 1].features[\""<< strKey <<
"\"].push(";
1261pre_feature_html <<
");</script>";
1263 stringtemp = pre_feature_html.str();
1278 while( it != wrapped.end() ) {
1280 if( strContent.size() && strContent.size() <= uMaxSize ) {
1285wrapped.erase( delete_me );
1302list<string>::iterator l_first_new_line;
1303 if( l_old_last !=
l.end() ) {
1304l_first_new_line = l_old_last;
1307l_first_new_line =
l.begin();
1311 if( l_first_new_line ==
l.end() ) {
1316list<string>::iterator l_second_new_line = l_first_new_line;
1317++l_second_new_line;
1320 if( l_second_new_line ==
l.end() ) {
1326 if( (
int)l_first_new_line->length() <=
indent) {
1329 l.erase( l_second_new_line );
1338 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, comment, orig_text_os);
1343 boolis_first = comment.
IsFirst();
1353list<string>::iterator l_old_last =
l.end();
1354 if( !
l.empty() ) {
1362 string& comm = *comment_it;
1364 Wrap(
l,
"COMMENT", comm,
ePara, bHtml, internalIndent);
1371 if( internalIndent > 0 ) {
1384 const string& txt = *line;
1388x.push_back(
" \n"+ txt);
1389}
else if(
NStr::Find(txt,
"this sequence version replaced") !=
NPOS||
1392x.push_back(
" \n"+ txt);
1415 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, fh, orig_text_os);
1430 unsigned int& iFrom,
1431 unsigned int& iTo )
1442 if( idh && idh.
IsGi() ) {
1445iGi = idh.
GetGi();
1460 const string& strRawKey,
1462 unsigned intuItemNumber = 0 )
1465 if( strRawKey ==
"gap"|| strRawKey ==
"assembly_gap")
1472 if( strRawKey ==
"source"&& uItemNumber == 0) {
1477 unsigned intiFrom = 0, iTo = 0;
1482 if( iFrom == 0 && iFrom == iTo ) {
1487strLink.reserve(100);
1504 if(
t.find_first_not_of(
" ") ==
NPOS&& s.
size() == 22) {
1519 constvector<CRef<CFormatQual> > & quals = ff.
GetQuals();
1523 const string& qual = (*it)->GetName();
1528 switch((*it)->GetTrim()) {
1536 value= (*it)->GetValue();
1543 switch((*it)->GetStyle()) {
1553 if(bHtml) sanitized +=
'"';
else value+=
'"';
1572 if(l_new.size() > 1) {
1573 const string&last_line = l_new.back();
1575list<string>::const_iterator end_iter = l_new.end();
1578 const string&second_to_last_line = *end_iter;
1582l_new.back() +=
"\"";
1614 if(p_source_feature_item) {
1615text_os = &s_WrapOstreamIfCallbackExists(p_text_os, *p_source_feature_item, orig_text_os);
1621 if(! text_os && p_feature_item) {
1622text_os = &s_WrapOstreamIfCallbackExists(p_text_os, *p_feature_item, orig_text_os);
1628 boolbHtml =
f.GetContext()->Config().DoHTML();
1639 const string& strKey = feat->GetKey();
1640 stringfkey = strKey;
1642 if(
f.GetContext()->IsProt()) {
1644 else if(
f.GetContext()->IsRefSeq()) {
1646 else if(
f.GetContext()->Config().IsModeEntrez() ||
f.GetContext()->Config().IsModeRelease()) {
1651 if(bHtml &&
f.GetContext()->Config().IsModeEntrez() &&
f.GetContext()->Config().ShowSeqSpans()) {
1656 Wrap(
l, fkey, feat->GetLoc().GetString(),
eFeat);
1682 if(bHtml &&
f.GetContext()->Config().IsModeEntrez() &&
f.GetContext()->Config().ShowSeqSpans()) {
1700 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, bc, orig_text_os);
1704ostringstream bc_line;
1706bc_line.setf(IOS_BASE::right, IOS_BASE::adjustfield);
1708<< setw(7) << bc.
GetA() <<
" a" 1709<< setw(7) << bc.
GetC() <<
" c" 1710<< setw(7) << bc.
GetG() <<
" g" 1711<< setw(7) << bc.
GetT() <<
" t";
1713bc_line << setw(7) << bc.
GetOther() <<
" others";
1715 Wrap(
l,
"BASE COUNT", bc_line.str());
1736}
while( (v /= 10) && --
l);
1748 char*
constinitial_p = p;
1753*p =
'0'+base_count%10;
1755}
while( (base_count /= 10) > 0 );
1756reverse( initial_p, p );
1777 TSeqPosdist_to_gap_or_end = 0;
1781dist_to_gap_or_end += seg_len;
1789 if( 0 == space_left_on_line ) {
1794 while( iter && iter.
IsInGap() && gap_size < space_left_on_line ) {
1797 if( gap_size >= space_left_on_line ) {
1802dist_to_gap_or_end += gap_size;
1807 returndist_to_gap_or_end;
1822 size_tkSeqPosWidth = 9;
1824 const size_tkLineBufferSize = 170;
1825 charline[kLineBufferSize];
1827fill(line, line+kLineBufferSize,
' ');
1830 const static stringkCloseSpan =
"</span>";
1831 TSeqPoslength_of_span_before_base_count = 0;
1833 stringkSpan =
" <span class=\"ff_line\" id=\"";
1836 copy( kSpan.begin(), kSpan.end(), line + kSeqPosWidth );
1837length_of_span_before_base_count = kSpan.length();
1844 if( 0 == initial_indent ) {
1851 while( total > 0 ) {
1852 if(base_count >= 1000000000) {
1853 if(kSeqPosWidth == 9) {
1857fill(line, line+kLineBufferSize,
' ');
1860length_of_span_before_base_count = 0;
1862 stringkSpan =
" <span class=\"ff_line\" id=\"";
1865 copy( kSpan.begin(), kSpan.end(), line + kSeqPosWidth );
1866length_of_span_before_base_count = (
int) kSpan.length();
1873 if( 0 == initial_indent ) {
1881 char* linep = line + kSeqPosWidth;
1887linep += length_of_span_before_base_count;
1892 char*
constlinep_right_after_span_tag = (linep + 1);
1899 intbases_to_skip = 0;
1900 if( initial_indent != 0 ) {
1901bases_to_skip = initial_indent;
1904linep += (bases_to_skip + chunks_to_skip);
1915 unsigned charch = *iter;
1928base_count += total;
1931 for( ; total > 0 && j <
s_kChunkSize; ++j, ++iter, --total, ++linep) {
1932 unsigned charch = *iter;
1946 const booldoneWithEntireSequence = ( ! iter );
1947 if( ! doneWithEntireSequence ) {
1948 char*
constlinep_at_close_span =
1950fill( linep, linep_at_close_span,
' ');
1951linep = linep_at_close_span;
1955 copy( kCloseSpan.begin(), kCloseSpan.end(), linep );
1956linep += kCloseSpan.length();
1971 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, seq, orig_text_os);
1973 const boolbGapsHiddenUntilClicked = (
1984 TSeqPostotal = from <= to? to - from + 1 : 0;
1987 if( ! bGapsHiddenUntilClicked ) {
1996 while( iter && total > 0 ) {
1997 const TSeqPosdistance_until_next_significant_gap =
2000 if( 0 == distance_until_next_significant_gap ) {
2006 while( iter && iter.
IsInGap() ) {
2010 if( total >= gap_size ) {
2015base_count += gap_size;
2017 if( gap_started_before_this_point && ! seq.
IsFirst() ) {
2022ostringstream gap_link;
2026text_os.
AddLine(gap_link.str());
2029 TSeqPosfake_total = distance_until_next_significant_gap;
2034 const TSeqPosamount_to_subtract_from_total =
2035( distance_until_next_significant_gap - fake_total );
2036 if( total >= amount_to_subtract_from_total ) {
2037total -= amount_to_subtract_from_total;
2058 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, dbs, orig_text_os);
2065 string tag=
"DBSOURCE";
2067 stringdb_src = *it;
2074 if( !
l.empty() ) {
2097 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, wgs, orig_text_os);
2107 tag=
"WGS_SCAFLD";
2111 tag=
"WGS_CONTIG";
2125 boolfirst_id_equals_second_id =
false;
2128first_id_equals_second_id =
true;
2136 stringwgs_line = ( first_id_equals_second_id ? first_id : first_id +
"-"+ last_id );
2141 if( first_id_equals_second_id ) {
2142link =
"https://www.ncbi.nlm.nih.gov/nuccore/"+ first_id;
2150 SIZE_TYPEprefix_len = first_id.find_first_of(
"0123456789");
2151 const boolbIsWGSScafldWithS =
2153first_id.length() > 7 && first_id[prefix_len+2] ==
'S');
2155 if(bIsWGSProject || bIsWGSScafldWithS) {
2156url_arg = first_id.substr(0,prefix_len+2);
2157link =
"https://www.ncbi.nlm.nih.gov/Traces/wgs/"+
2158url_arg +
"?display="+ ( bIsWGSScafldWithS ?
"scaffolds":
"contigs");
2160link =
"https://www.ncbi.nlm.nih.gov/nuccore?term="+ first_id +
":"+ last_id +
"[PACC]";
2163wgs_line =
"<a href=\""+ link +
"\">"+ wgs_line +
"</a>";
2182 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, tsa, orig_text_os);
2197id_range = first_id;
2200id_range = first_id +
"-"+ last_id;
2209 SIZE_TYPEprefix_len = tls_master.find_first_of(
"0123456789");
2210tls_master = tls_master.substr(0, prefix_len+2);
2212 if( ! tls_master.empty() ) {
2213id_range =
"<a href=\"https://www.ncbi.nlm.nih.gov/Traces/wgs?val="+ tls_master +
"#contigs\">"+ id_range +
"</a>";
2233id_range = first_id;
2236id_range = first_id +
"-"+ last_id;
2245 SIZE_TYPEprefix_len = tsa_master.find_first_of(
"0123456789");
2246tsa_master = tsa_master.substr(0, prefix_len+2);
2248 if( ! tsa_master.empty() ) {
2249id_range =
"<a href=\"https://www.ncbi.nlm.nih.gov/Traces/wgs?val="+ tsa_master +
"\">"+ id_range +
"</a>";
2271 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, primary, orig_text_os);
2275 stringprimary_str = primary.
GetString();
2279 Wrap(
l,
"PRIMARY", primary_str);
2308 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, contig, orig_text_os);
2315 if(assembly.empty()) {
2316assembly =
"join()";
2319assembly =
"join("+ assembly +
")";
2322 Wrap(
l,
"CONTIG", assembly);
2344 stringstrOrigin =
origin.GetOrigin();
2345 if( strOrigin ==
".") {
2349 if( strOrigin.empty() ) {
2350 l.push_back(
"ORIGIN ");
2358 Wrap(
l,
"ORIGIN", strOrigin );
2373 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, gap, orig_text_os);
2382 const boolisGapOfLengthZero = ( gapStart > gapEnd );
2385 if( isGapOfLengthZero ) {
2408 if( isGapOfLengthZero ) {
2414 stringestimated_length;
2418estimated_length =
"unknown";
@ eExtreme_Positional
numerical value
User-defined methods of the data storage class.
const CSeq_loc & GetRegion(void) const
bool IsSetRegion(void) const
SIZE_TYPE GetOther(void) const
SIZE_TYPE GetT(void) const
SIZE_TYPE GetA(void) const
SIZE_TYPE GetG(void) const
SIZE_TYPE GetC(void) const
const string & GetTSAMasterName(void) const
const CFlatFileConfig & Config(void) const
const CSeq_loc & GetLocation(void) const
const string & GetTLSMasterName(void) const
const string & GetAccession(void) const
const TCache & GetCache(void) const
int GetLength(void) const
const CSeq_loc & GetLoc(void) const
const TDBSource & GetDBSource(void) const
const string & GetDefline(void) const
const CMappedFeat & GetFeat(void) const
const TQuals & GetQuals(void) const
@ eAction_Skip
skip this block (i.e. don't print it)
@ eAction_HaltFlatfileGeneration
If for some reason you don't want the rest of the flatfile generated, this will trigger a CFlatExcept...
const IHTMLFormatter & GetHTMLFormatter() const
bool IsPolicyFtp(void) const
bool ShowSeqSpans(void) const
bool IsPolicyGenomes(void) const
bool LongLocusNames(void) const
bool ExpandGaps(void) const
bool ShowContigAndSeq(void) const
bool IsModeEntrez(void) const
const CFlatFileConfig & GetConfig(void) const
static const string s_GenbankMol[]
const CFlatFileContext & GetContext(void) const
string x_FormatAccession(const CAccessionItem &acc, char separator) const
const string & GetIndent(void) const
void x_FormatRefJournal(const CReferenceItem &ref, string &journal, CBioseqContext &ctx) const
void x_GetKeywords(const CKeywordsItem &kws, const string &prefix, list< string > &l) const
const string & GetFeatIndent(void) const
void x_FormatRefLocation(ostream &os, const CSeq_loc &loc, const string &to, const string &delim, CBioseqContext &ctx) const
virtual list< string > & Wrap(list< string > &l, SIZE_TYPE width, const string &tag, const string &body, EPadContext where=ePara, bool htmlaware=false) const
TWrapFlags & SetWrapFlags(void)
CBioseqContext * GetContext(void)
const CSerialObject * GetObject(void) const
const string & GetString(void) const
TSeqPos GetTo(void) const
TSeqPos GetEstimatedLength(void) const
TSeqPos GetFrom(void) const
std::vector< std::string > TEvidence
const std::string & GetType(void) const
bool HasEstimatedLength(void) const
const TEvidence & GetEvidence(void) const
const std::string & GetFeatureName(void) const
CGenbankFormatterWrapDest(IFlatTextOStream &s)
virtual void Append(const string &s)
virtual void Append(const CTempString &s)
IFlatTextOStream & m_text_os
void FormatBasecount(const CBaseCountItem &bc, IFlatTextOStream &text_os) override
void x_SmartWrapQuals(const class CFeatureItemBase &f, const class CFlatFeature &feat, IFlatTextOStream &text_os)
void FormatWGS(const CWGSItem &wgs, IFlatTextOStream &text_os) override
void FormatSource(const CSourceItem &source, IFlatTextOStream &text_os) override
void FormatTSA(const CTSAItem &tsa, IFlatTextOStream &text_os) override
void FormatContig(const CContigItem &contig, IFlatTextOStream &text_os) override
void EndSection(const CEndSectionItem &, IFlatTextOStream &text_os) override
void x_LocusHtmlPrefix(std::string &first_line, CBioseqContext &ctx)
bool m_bSourceDescriptorDone
bool m_bHavePrintedSourceFeatureJavascript
void x_Title(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void FormatGap(const CGapItem &gap, IFlatTextOStream &text_os) override
void FormatOrigin(const COriginItem &origin, IFlatTextOStream &text_os) override
void x_FormatSourceLine(list< string > &l, const CSourceItem &source) const
void x_Pubmed(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void x_GetFeatureSpanAndScriptStart(IFlatTextOStream &os, const CTempString &strKey, const CSeq_loc &feat_loc, CBioseqContext &ctx)
void FormatCache(const CCacheItem &csh, IFlatTextOStream &text_os) override
void x_Journal(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void x_Remark(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void x_Reference(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
SIZE_TYPE GetWidth() const override
void FormatVersion(const CVersionItem &version, IFlatTextOStream &text_os) override
void FormatReference(const CReferenceItem &keys, IFlatTextOStream &text_os) override
void FormatPrimary(const CPrimaryItem &prim, IFlatTextOStream &text_os) override
void x_FormatOrganismLine(list< string > &l, const CSourceItem &source) const
unsigned int m_uFeatureCount
void x_Medline(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void FormatDefline(const CDeflineItem &defline, IFlatTextOStream &text_os) override
void FormatGenomeProject(const CGenomeProjectItem &, IFlatTextOStream &) override
void FormatHtmlAnchor(const CHtmlAnchorItem &, IFlatTextOStream &) override
void FormatFeatHeader(const CFeatHeaderItem &fh, IFlatTextOStream &text_os) override
void FormatSequence(const CSequenceItem &seq, IFlatTextOStream &text_os) override
void FormatLocus(const CLocusItem &locus, IFlatTextOStream &text_os) override
void x_Authors(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void FormatFeature(const CFeatureItemBase &feat, IFlatTextOStream &text_os) override
TFeatureKeyCountMap m_FeatureKeyToLocMap
void FormatSegment(const CSegmentItem &seg, IFlatTextOStream &text_os) override
void x_Consortium(list< string > &l, const CReferenceItem &ref, CBioseqContext &ctx) const
void FormatGenome(const CGenomeItem &genome, IFlatTextOStream &text_os) override
void FormatKeywords(const CKeywordsItem &keys, IFlatTextOStream &text_os) override
void FormatComment(const CCommentItem &keys, IFlatTextOStream &text_os) override
void FormatAccession(const CAccessionItem &acc, IFlatTextOStream &text_os) override
void FormatDBSource(const CDBSourceItem &dbs, IFlatTextOStream &text_os) override
const TDBLinkLineVec & GetDBLinkLines(void) const
vector< TDBLinkLine > TDBLinkLineVec
const vector< int > & GetProjectNumbers(void) const
const string & GetLabelCore(void) const
const string & GetName(void) const
size_t GetLength(void) const
TBiomol GetBiomol(void) const
const string & GetDate(void) const
TTopology GetTopology(void) const
const string & GetDivision(void) const
TStrand GetStrand(void) const
const string & GetFullName(void) const
const string & GetString(void) const
TEntrezId GetMUID(void) const
const string & GetTitle(void) const
const CCit_pat & GetPatent(void) const
const string & GetRemark(void) const
int GetSerial(void) const
TEntrezId GetPMID(void) const
TReftype GetReftype(void) const
const CAuth_list & GetAuthors(void) const
static void FormatAuthors(const CAuth_list &alp, string &auth)
bool IsSetPatent(void) const
const CSeq_loc & GetLoc(void) const
const string & GetConsortium(void) const
bool IsSetAuthors(void) const
size_t GetNum(void) const
size_t GetCount(void) const
SeqVector related exceptions.
Seq-loc iterator class â iterates all intervals from a seq-loc in the correct order.
const CSeqVector & GetSequence(void) const
TSeqPos GetTo(void) const
TSeqPos GetFrom(void) const
Base class for all serializable objects.
const string & GetLastID(void) const
const string & GetFirstID(void) const
TTSAType GetType(void) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const string & GetLastID(void) const
TWGSType GetType(void) const
const string & GetFirstID(void) const
virtual void AddLine(const CTempString &, const CSerialObject *=nullptr, EAddNewline=eAddNewline_Yes)
This adds its given argument, appending a newline only if the add_newline argument is eAddNewline_Yes...
virtual void AddParagraph(const list< string > &, const CSerialObject *=nullptr)
This adds a list of strings to the stream one at a time, unconditionally adding a newline to each one...
virtual void FormatLocation(string &str, const CSeq_loc &loc, TIntId gi, const string &visible_text) const =0
virtual void FormatGapLink(ostream &os, TSeqPos gap_size, const string &id, bool is_prot) const =0
virtual void FormatTaxid(string &str, const TTaxId taxid, const string &taxname) const =0
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
static void s_FixListIfBadWrap(list< string > &l, list< string >::iterator l_old_last, int indent)
static const TSeqPos s_kFullLineSize
bool s_GetFeatureKeyLinkLocation(const CMappedFeat &feat, TGi &iGi, unsigned int &iFrom, unsigned int &iTo)
static string s_get_anchor_html(const string &sAnchorName, CBioseqContext *ctx)
static char * s_FormatSeqSpanTag(char *p, int base_count)
static const TSeqPos s_kChunkCount
static TSeqPos s_CalcDistanceUntilNextSignificantGapOrEnd(const CSequenceItem &seq, CSeqVector_CI iter)
static const TSeqPos s_kChunkSize
string s_GetLinkCambiaPatentLens(const CReferenceItem &ref, bool bHtml)
bool s_GetLinkFeatureKey(const CFeatureItemBase &item, const CFlatFeature &feat, const string &strRawKey, string &strLink, unsigned int uItemNumber=0)
static string s_GetAccessionWithoutPeriod(const CBioseqContext &ctx)
static char * s_FormatSeqPosBack(char *p, TSeqPos v, size_t l)
static void s_FormatRegularSequencePiece(const CSequenceItem &seq, IFlatTextOStream &text_os, CSeqVector_CI &iter, TSeqPos &total, TSeqPos &base_count)
void s_OrphanFixup(list< string > &wrapped, size_t uMaxSize=0)
static void s_PrintLocAsJavascriptArray(CBioseqContext &ctx, CNcbiOstream &text_os, const CSeq_loc &loc)
string s_GetLinkFeature(const CReferenceItem &ref, bool bHtml)
void s_GenerateWeblinks(const string &strProtocol, string &strText)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsSetStrand(void) const
Get strand.
CSeq_id_Handle GetSeq_id_Handle(void) const
TRange GetRange(void) const
Get the range.
ENa_strand GetStrand(void) const
TSeqPos GetStop(ESeqLocExtremes ext) const
@ eOrder_Biological
Iterate sub-locations in positional order.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
const TInst_Hist & GetInst_Hist(void) const
bool IsSetInst_Hist(void) const
bool CanGetInst_Length(void) const
TInst_Length GetInst_Length(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
bool IsSynonym(const CSeq_id &id) const
Check if this id can be used to obtain this bioseq handle.
TSeqPos SkipGap(void)
skip current gap forward returns number of skipped gap symbols does nothing and returns 0 if current ...
TSeqPos GetPos(void) const
const CSeq_loc & GetLocation(void) const
TSeqPos GetBufferSize(void) const
Get number of chars from current position to the current buffer end.
TSeqPos GetGapSizeBackward(void) const
returns number of gap symbols before current symbol returns 0 if current position is not in gap
bool IsInGap(void) const
true if current position of CSeqVector_CI is inside of sequence gap
void Reset(void)
Reset reference object.
#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.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
NCBI_NS_STD::string::size_type SIZE_TYPE
static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string (in-place)
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
const char * data(void) const
Return a pointer to the array represented.
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 UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
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 EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static void Wrap(const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, 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 TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
const char *const kEmptyCStr
Empty "C" string (points to a '\0').
size_type size(void) const
Return the length of the represented array.
@ eTrunc_End
Truncate trailing whitespace only.
bool CanGetCountry(void) const
Check if it is safe to call GetCountry method.
bool CanGetNumber(void) const
Check if it is safe to call GetNumber method.
const TNumber & GetNumber(void) const
Get the Number member data.
const TCountry & GetCountry(void) const
Get the Country member data.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsLim(void) const
Check if variant Lim is selected.
TLim GetLim(void) const
Get the variant data.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
@ eLim_tr
space to right of position
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
bool IsWhole(void) const
Check if variant Whole is selected.
bool IsPnt(void) const
Check if variant Pnt is selected.
const TUser & GetUser(void) const
Get the variant data.
bool CanGetReplaced_by(void) const
Check if it is safe to call GetReplaced_by method.
bool IsSetReplaces(void) const
seq makes these seqs obsolete Check if a value has been assigned to Replaces data member.
const TReplaces & GetReplaces(void) const
Get the Replaces member data.
const TReplaced_by & GetReplaced_by(void) const
Get the Replaced_by member data.
@ eReftype_sites
refers to unspecified features
@ eReftype_no_target
nothing specified (EMBL)
@ eReftype_feats
refers to specified features
@ eTech_tsa
transcriptome shotgun assembly
@ eTech_wgs
whole genome shotgun sequencing
@ eBiomol_transcribed_RNA
transcribed RNA other than existing classes
@ e_User
user defined object
@ e_Comment
a more extensive comment
@ e_Region
overall region (globin locus)
@ e_Maploc
map location of this sequence
unsigned int
A callback function used to compare two keys in a database.
static void text(MDB_val *v)
const string version
version string
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
bool TrimSpacesAndJunkFromEnds(string &str, bool allow_ellipsis=false)
const char * strLinkBaseGenomePrj
const char * strLinkBaseProt
const char * strLinkBaseNuc
void TryToSanitizeHtmlList(std::list< std::string > &strs)
const char * strLinkBasePubmed
void CleanAndCompress(string &dest, const CTempString &instr)
void TryToSanitizeHtml(std::string &str)
static const GLdouble origin[]
CRef< CPub > journal(ParserPtr pp, char *bptr, char *eptr, CRef< CAuth_list > &auth_list, CRef< CTitle::C_E > &title, bool has_muid, CRef< CCit_art > &cit_art, Int4 er)
static SLJIT_INLINE sljit_ins l(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