本文整理汇总了C++中CConstRef::GetTextseq_Id方法的典型用法代码示例。如果您正苦于以下问题:C++ CConstRef::GetTextseq_Id方法的具体用法?C++ CConstRef::GetTextseq_Id怎么用?C++ CConstRef::GetTextseq_Id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConstRef
的用法示例。
在下文中一共展示了CConstRef::GetTextseq_Id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: x_DoSingleSection
void CGenbankGatherer::x_DoSingleSection(CBioseqContext& ctx) const
{
CConstRef<IFlatItem> item;
const CFlatFileConfig& cfg = ctx.Config();
// these macros make the code easier to read and less repetitive
#define GATHER_BLOCK(BlockType, ItemClassName) \
if( cfg.IsShownGenbankBlock(CFlatFileConfig::fGenbankBlocks_##BlockType) ) { \
item.Reset( new ItemClassName(ctx) ); \
ItemOS() << item; \
}
#define GATHER_ANCHOR(BlockType, block_str) \
if( cfg.IsShownGenbankBlock(CFlatFileConfig::fGenbankBlocks_##BlockType) ) { \
item.Reset( new CHtmlAnchorItem(ctx, (block_str) ) ); \
ItemOS() << item; \
}
#define GATHER_VIA_FUNC(BlockType, FuncName) \
if( cfg.IsShownGenbankBlock(CFlatFileConfig::fGenbankBlocks_##BlockType) ) { \
FuncName(); \
}
// if there's a callback, let it know we've entered another bioseq
if( cfg.GetGenbankBlockCallback() ) {
CFlatFileConfig::CGenbankBlockCallback::EBioseqSkip eBioseqSkip =
cfg.GetGenbankBlockCallback()->notify_bioseq( ctx );
if( eBioseqSkip == CFlatFileConfig::CGenbankBlockCallback::eBioseqSkip_Yes ) {
return;
}
}
// gather needed blocks
GATHER_BLOCK(Head, CStartSectionItem);
GATHER_ANCHOR(Locus, "locus");
GATHER_BLOCK(Locus, CLocusItem);
GATHER_BLOCK(Defline, CDeflineItem);
GATHER_BLOCK(Accession, CAccessionItem);
GATHER_BLOCK(Version, CVersionItem);
GATHER_BLOCK(Project, CGenomeProjectItem);
if ( ctx.IsProt() ) {
bool show_dbsource = true;
CBioseq_Handle& bsh = ctx.GetHandle();
FOR_EACH_SEQID_ON_BIOSEQ_HANDLE (sid_itr, bsh) {
CSeq_id_Handle sid = *sid_itr;
switch (sid.Which()) {
case NCBI_SEQID(Other):
{
CConstRef<CSeq_id> id = sid.GetSeqId();
const CTextseq_id& tsid = *id->GetTextseq_Id ();
if (tsid.IsSetAccession()) {
const string& acc = tsid.GetAccession ();
if (NStr::StartsWith (acc, "WP_")) {
show_dbsource = false;
}
}
break;
}
default:
break;
}
}