79 #define NCBI_USE_ERRCODE_X Objtools_Fmt_Genbank
85 m_uFeatureCount( 0 ), m_bHavePrintedSourceFeatureJavascript(
false),
86 m_bSourceDescriptorDone(
false)
88 SetIndent(
string(12,
' '));
89 SetFeatIndent(
string(21,
' '));
90 SetBarcodeIndent(
string(35,
' '));
102 template<
class TFlatItemClass>
105 CWrapperForFlatTextOStream(
109 const TFlatItemClass& item ) :
110 m_block_callback(block_callback),
111 m_orig_text_os(orig_text_os),
118 ~CWrapperForFlatTextOStream()
126 ERR_POST_X(2,
"Missed flatfile output halt request in "
136 m_block_callback->notify(m_block_text_str, *m_ctx, m_item);
140 "A CGenbankBlockCallback has requested that flatfile generation halt");
147 m_orig_text_os.AddLine(m_block_text_str,
nullptr, eAddNewline_No);
154 size_t add_size = m_block_text_str.size();
156 add_size += (line->
size() + 1);
158 m_block_text_str.reserve(
max(m_block_text_str.capacity(), add_size));
160 AddLine(*line, obj, eAddNewline_Yes);
165 EAddNewline add_newline )
167 m_block_text_str.reserve(
max(m_block_text_str.capacity(),
168 m_block_text_str.length() +
170 (add_newline == eAddNewline_Yes?1:0) ) );
171 m_block_text_str.append(line.
data(), line.
size());
172 if( add_newline == eAddNewline_Yes ) {
173 m_block_text_str +=
'\n';
182 const TFlatItemClass& m_item;
185 string m_block_text_str;
190 template<
class TFlatItemClass>
193 const TFlatItemClass& item,
198 item.GetContext()->Config().GetGenbankBlockCallback();
199 if( block_callback ) {
201 p_text_os.
Reset(
new CWrapperForFlatTextOStream<TFlatItemClass>(
202 block_callback, orig_text_os,
ctx, item) );
230 result <<
"[" << (point+1) <<
", " << (point+2) <<
"]]";
235 bool is_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 string accn =
ctx.GetAccession();
278 SIZE_TYPE period_pos = accn.find_first_of(
".");
279 if( period_pos !=
NPOS ) {
280 accn.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 bool bHtml = cfg.
DoHTML();
309 l.push_back(
"//</pre>" );
366 static const char* strands[] = {
" ",
"ss-",
"ds-",
"ms-" };
369 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, locus, orig_text_os);
376 const char* units =
"bp";
377 if ( !
ctx.IsProt() ) {
378 if ( (
ctx.IsWGSMaster() && !
ctx.IsRSWGSNuc() ) ||
379 ctx.IsTSAMaster() ||
ctx.IsTLSMaster() )
392 locus_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
395 size_t locuslength = locusname.length();
397 locus_line << setw(16) << locusname;
403 int spaceForLength =
min( 12, (
int)(12 - (locuslength - 16)) );
404 locus_line.setf(IOS_BASE::right, IOS_BASE::adjustfield);
407 << setw(spaceForLength-1) << locus.
GetLength()
412 locus_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
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);
478 acc_line =
"<a href=\"";
479 acc_line += link_base + acc_str +
"\">" + acc_str +
"</a>";
484 acc_line +=
" REGION: ";
489 l.push_back(
"ACCESSION ");
494 Wrap(
l,
"ACCESSION", acc_line);
516 if (
version.GetAccession().empty() ) {
517 l.push_back(
"VERSION");
519 version_line <<
version.GetAccession();
523 version_line <<
" GI:" <<
version.GetGi();
527 if(
version.GetContext()->Config().DoHTML() ) {
548 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, gp, orig_text_os);
551 const char *prefix =
"DBLINK";
556 project_line <<
"Project: ";
562 project_line <<
", ";
565 const int proj_num = *proj_num_iter;
570 project_line << proj_num;
607 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, html_anchor, orig_text_os);
625 vector<string>* rcx = csh.
GetCache();
629 string prefix = (csh.
IsProt() ?
"residues" :
"bases");
630 for (
auto&
str : *rcx) {
634 text_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);
717 string prefix =
source.IsUsingAnamorph() ?
" (anamorph: " :
" (";
719 source_line <<
source.GetOrganelle() <<
source.GetTaxname();
720 if ( !
source.GetCommon().empty() ) {
721 source_line << prefix <<
source.GetCommon() <<
")";
725 if(
source.GetContext()->Config().DoHTML() ) {
740 if (
source.GetContext()->Config().DoHTML()) {
741 string lineage =
source.GetLineage();
760 const string strBaseUrlCambiaPatentLensHead(
761 "https://www.lens.org/lens/search/patent/list?q=" );
776 strPatString =
"CAMBIA Patent Lens: US ";
777 strPatString +=
"<a href=\"";
778 strPatString += strBaseUrlCambiaPatentLensHead;
780 strPatString +=
"%20";
782 strPatString +=
"\">";
784 strPatString +=
"</a>";
787 strPatString =
string(
"CAMBIA Patent Lens: US " );
799 string strFeatureLink;
800 return strFeatureLink;
808 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, ref, orig_text_os);
825 if(
ctx.Config().DoHTML() ) {
831 vector<string>* rc =
ctx.GetRefCache();
849 const string strDummyProt(
"<!PROT!>" );
852 while ( uLinkStart !=
NPOS ) {
853 size_t uLinkStop = strText.find_first_of(
" \t\n", uLinkStart );
854 if( uLinkStop ==
NPOS ) {
855 uLinkStop = strText.length();
860 if( uLinkStart > 0 && ( strText[uLinkStart-1] ==
'"' || strText[uLinkStart-1] ==
'>' ) ) {
865 string strLink = strText.substr( uLinkStart, uLinkStop - uLinkStart );
867 string::size_type last_good_char = strLink.find_last_not_of(
"\".),<>'");
868 if( last_good_char !=
NPOS ) {
869 strLink.resize( last_good_char + 1 );
872 string strDummyLink =
NStr::Replace( strLink, strProtocol, strDummyProt );
873 string strReplace(
"<a href=\"" );
874 strReplace += strDummyLink;
876 strReplace += strDummyLink;
877 strReplace +=
"</a>";
880 uLinkStart =
NStr::FindNoCase( strText, strProtocol +
"://", uLinkStart + strReplace.length() );
900 ref_line << serial <<
' ';
904 ref_line.setf(IOS_BASE::left, IOS_BASE::adjustfield);
905 ref_line << setw(3) << serial;
911 ref_line <<
"(sites)";
937 if( authors.empty() ) {
939 if(
ctx.Config().IsFormatGenbank() ) {
941 }
else if(
ctx.Config().IsFormatEMBL() ) {
948 string::size_type last_periods = authors.find_last_not_of(
'.');
949 if( last_periods != string::npos ) {
951 if( last_periods < authors.length() ) {
952 authors.resize( last_periods );
1018 bool bHtml =
ctx.Config().DoHTML();
1020 string strDummy(
"[PUBMED-ID]" );
1026 string strLink =
"<a href=\"";
1028 strLink += strPubmed;
1030 strLink += strPubmed;
1032 strPubmed = strLink;
1049 if (
ctx.Config().DoHTML() ) {
1050 string strRaw = strPubmed;
1051 strPubmed =
"<a href=\"https://www.ncbi.nlm.nih.gov/pubmed/";
1052 strPubmed += strRaw;
1054 strPubmed += strRaw;
1055 strPubmed +=
"</a>";
1067 const bool is_html =
ctx.Config().DoHTML();
1083 ctx.Config().DoHTML() );
1084 if ( ! strCambiaPatentLens.empty() ) {
1089 Wrap(
l,
"REMARK", strCambiaPatentLens,
eSubp);
1100 if( !
ctx.Config().IsModeEntrez() ) {
1101 first_line =
"<pre>" + first_line;
1110 bool has_comment =
false;
1115 if( desc_ci1 || desc_ci2 || desc_ci3 ) {
1120 for( ; user_iter; ++user_iter ) {
1121 const CSeqdesc & desc = *user_iter;
1124 if( type_str ==
"RefGeneTracking" ||
1125 type_str ==
"GenomeBuild" ||
1126 type_str ==
"ENCODE" )
1135 if( ! has_comment ) {
1142 if (
r.CanGetDate() && !
r.GetIds().empty() )
1150 if (
r.CanGetDate() && !
r.GetIds().empty() )
1162 bool has_contig =
false;
1168 const bool do_contig_style =
ctx.DoContigStyle();
1169 const bool show_contig = ( (
ctx.IsSegmented() &&
ctx.HasParts()) ||
1170 (
ctx.IsDelta() && !
ctx.IsDeltaLitOnly()) );
1177 bool has_sequence =
false;
1180 has_sequence =
true;
1185 const string& accn =
ctx.GetAccession();
1186 result <<
"<div class=\"localnav\"><ul class=\"locals\">";
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 TGi gi =
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 TGi gi =
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\">";
1239 pre_feature_html <<
"<span id=\"feature_" <<
ctx.GetAccession()
1240 <<
"_" << strKey <<
"_" << feat_type_count <<
"\" class=\"feature\">";
1243 pre_feature_html <<
"<script type=\"text/javascript\">";
1247 pre_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(";
1261 pre_feature_html <<
");</script>";
1278 while ( it != wrapped.end() ) {
1280 if ( strContent.size() && strContent.size() <= uMaxSize ) {
1285 wrapped.erase( delete_me );
1302 list<string>::iterator l_first_new_line;
1303 if( l_old_last !=
l.end() ) {
1304 l_first_new_line = l_old_last;
1307 l_first_new_line =
l.begin();
1311 if( l_first_new_line ==
l.end() ) {
1316 list<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 bool is_first = comment.
IsFirst();
1353 list<string>::iterator l_old_last =
l.end();
1362 string& comm = *comment_it;
1364 Wrap(
l,
"COMMENT", comm,
ePara, bHtml, internalIndent);
1371 if( internalIndent > 0 ) {
1384 const string& txt = *line;
1388 x.push_back(
" \n" + txt);
1389 }
else if (
NStr::Find(txt,
"this sequence version replaced") !=
NPOS ||
1392 x.push_back(
" \n" + txt);
1415 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, fh, orig_text_os);
1430 unsigned int& iFrom,
1442 if ( idh && idh.
IsGi() ) {
1460 const string& strRawKey,
1462 unsigned int uItemNumber = 0 )
1465 if ( strRawKey ==
"gap" || strRawKey ==
"assembly_gap" )
1472 if ( strRawKey ==
"source" && uItemNumber == 0) {
1477 unsigned int iFrom = 0, iTo = 0;
1482 if ( iFrom == 0 && iFrom == iTo ) {
1487 strLink.reserve(100);
1504 if (
t.find_first_not_of(
" ") ==
NPOS && s.
size() == 22) {
1519 const vector<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();
1575 list<string>::const_iterator end_iter = l_new.end();
1578 const string &second_to_last_line = *end_iter;
1582 l_new.back() +=
"\"";
1614 if (p_source_feature_item) {
1615 text_os = &s_WrapOstreamIfCallbackExists(p_text_os, *p_source_feature_item, orig_text_os);
1621 if (! text_os && p_feature_item) {
1622 text_os = &s_WrapOstreamIfCallbackExists(p_text_os, *p_feature_item, orig_text_os);
1628 bool bHtml =
f.GetContext()->Config().DoHTML();
1639 const string& strKey = feat->GetKey();
1640 string fkey = 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);
1706 bc_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";
1713 bc_line << setw(7) << bc.
GetOther() <<
" others";
1736 }
while ( (v /= 10) && --
l );
1748 char *
const initial_p = p;
1753 *p =
'0'+base_count%10;
1755 }
while ( (base_count /= 10) > 0 );
1756 reverse( initial_p, p );
1777 TSeqPos dist_to_gap_or_end = 0;
1781 dist_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 ) {
1802 dist_to_gap_or_end += gap_size;
1807 return dist_to_gap_or_end;
1822 size_t kSeqPosWidth = 9;
1824 const size_t kLineBufferSize = 170;
1825 char line[kLineBufferSize];
1827 fill(line, line+kLineBufferSize,
' ');
1830 const static string kCloseSpan =
"</span>";
1831 TSeqPos length_of_span_before_base_count = 0;
1833 string kSpan =
" <span class=\"ff_line\" id=\"";
1836 copy( kSpan.begin(), kSpan.end(), line + kSeqPosWidth );
1837 length_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) {
1857 fill(line, line+kLineBufferSize,
' ');
1860 length_of_span_before_base_count = 0;
1862 string kSpan =
" <span class=\"ff_line\" id=\"";
1865 copy( kSpan.begin(), kSpan.end(), line + kSeqPosWidth );
1866 length_of_span_before_base_count = (
int) kSpan.length();
1873 if( 0 == initial_indent ) {
1881 char* linep = line + kSeqPosWidth;
1887 linep += length_of_span_before_base_count;
1892 char *
const linep_right_after_span_tag = (linep + 1);
1899 int bases_to_skip = 0;
1900 if( initial_indent != 0 ) {
1901 bases_to_skip = initial_indent;
1904 linep += (bases_to_skip + chunks_to_skip);
1915 unsigned char ch = *iter;
1928 base_count += total;
1931 for ( ; total > 0 && j <
s_kChunkSize; ++j, ++iter, --total, ++linep) {
1932 unsigned char ch = *iter;
1946 const bool doneWithEntireSequence = ( ! iter );
1947 if( ! doneWithEntireSequence ) {
1948 char *
const linep_at_close_span =
1950 fill( linep, linep_at_close_span,
' ' );
1951 linep = linep_at_close_span;
1955 copy( kCloseSpan.begin(), kCloseSpan.end(), linep );
1956 linep += kCloseSpan.length();
1971 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, seq, orig_text_os);
1973 const bool bGapsHiddenUntilClicked = (
1984 TSeqPos total = from <= to? to - from + 1 : 0;
1987 if( ! bGapsHiddenUntilClicked ) {
1996 while( iter && total > 0 ) {
1997 const TSeqPos distance_until_next_significant_gap =
2000 if( 0 == distance_until_next_significant_gap ) {
2006 while( iter && iter.
IsInGap() ) {
2010 if( total >= gap_size ) {
2015 base_count += gap_size;
2017 if( gap_started_before_this_point && ! seq.
IsFirst() ) {
2029 TSeqPos fake_total = distance_until_next_significant_gap;
2034 const TSeqPos amount_to_subtract_from_total =
2035 ( distance_until_next_significant_gap - fake_total );
2036 if( total >= amount_to_subtract_from_total ) {
2037 total -= amount_to_subtract_from_total;
2058 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, dbs, orig_text_os);
2065 string tag =
"DBSOURCE";
2067 string db_src = *it;
2097 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, wgs, orig_text_os);
2125 bool first_id_equals_second_id =
false;
2128 first_id_equals_second_id =
true;
2136 string wgs_line = ( first_id_equals_second_id ? first_id : first_id +
"-" + last_id );
2141 if( first_id_equals_second_id ) {
2142 link =
"https://www.ncbi.nlm.nih.gov/nuccore/" + first_id;
2150 SIZE_TYPE prefix_len = first_id.find_first_of(
"0123456789");
2151 const bool bIsWGSScafldWithS =
2153 first_id.length() > 7 && first_id[prefix_len+2] ==
'S' );
2155 if (bIsWGSProject || bIsWGSScafldWithS) {
2156 url_arg = first_id.substr(0,prefix_len+2);
2157 link =
"https://www.ncbi.nlm.nih.gov/Traces/wgs/" +
2158 url_arg +
"?display=" + ( bIsWGSScafldWithS ?
"scaffolds" :
"contigs" );
2160 link =
"https://www.ncbi.nlm.nih.gov/nuccore?term=" + first_id +
":" + last_id +
"[PACC]";
2163 wgs_line =
"<a href=\"" + link +
"\">" + wgs_line +
"</a>";
2182 IFlatTextOStream& text_os = s_WrapOstreamIfCallbackExists(p_text_os, tsa, orig_text_os);
2197 id_range = first_id;
2200 id_range = first_id +
"-" + last_id;
2209 SIZE_TYPE prefix_len = tls_master.find_first_of(
"0123456789");
2210 tls_master = tls_master.substr(0, prefix_len+2);
2212 if( ! tls_master.empty() ) {
2213 id_range =
"<a href=\"https://www.ncbi.nlm.nih.gov/Traces/wgs?val=" + tls_master +
"#contigs\">" + id_range +
"</a>";
2233 id_range = first_id;
2236 id_range = first_id +
"-" + last_id;
2245 SIZE_TYPE prefix_len = tsa_master.find_first_of(
"0123456789");
2246 tsa_master = tsa_master.substr(0, prefix_len+2);
2248 if( ! tsa_master.empty() ) {
2249 id_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 string primary_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()) {
2316 assembly =
"join()";
2319 assembly =
"join(" + assembly +
")";
2322 Wrap(
l,
"CONTIG", assembly);
2344 string strOrigin =
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 bool isGapOfLengthZero = ( gapStart > gapEnd );
2385 if( isGapOfLengthZero ) {
2408 if( isGapOfLengthZero ) {
2414 string estimated_length;
2418 estimated_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
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
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
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
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...
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
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)