NCBI C++ ToolKit
Classes | Macros | Functions | Variables
genbank_formatter.cpp File Reference
#include <ncbi_pch.hpp>
#include <sstream>
#include <corelib/ncbistd.hpp>
#include <objects/seqloc/Seq_loc.hpp>
#include <objects/biblio/Author.hpp>
#include <objects/biblio/Cit_pat.hpp>
#include <objects/general/Person_id.hpp>
#include <objects/seq/Seq_hist_rec.hpp>
#include <objmgr/seqdesc_ci.hpp>
#include <objmgr/util/sequence.hpp>
#include <objtools/error_codes.hpp>
#include <objtools/format/flat_expt.hpp>
#include <objtools/format/genbank_formatter.hpp>
#include <objtools/format/items/locus_item.hpp>
#include <objtools/format/items/defline_item.hpp>
#include <objtools/format/items/accession_item.hpp>
#include <objtools/format/items/ctrl_items.hpp>
#include <objtools/format/items/version_item.hpp>
#include <objtools/format/items/dbsource_item.hpp>
#include <objtools/format/items/segment_item.hpp>
#include <objtools/format/items/keywords_item.hpp>
#include <objtools/format/items/source_item.hpp>
#include <objtools/format/items/reference_item.hpp>
#include <objtools/format/items/comment_item.hpp>
#include <objtools/format/items/feature_item.hpp>
#include <objtools/format/items/basecount_item.hpp>
#include <objtools/format/items/sequence_item.hpp>
#include <objtools/format/items/wgs_item.hpp>
#include <objtools/format/items/tsa_item.hpp>
#include <objtools/format/items/primary_item.hpp>
#include <objtools/format/items/contig_item.hpp>
#include <objtools/format/items/genome_item.hpp>
#include <objtools/format/items/origin_item.hpp>
#include <objtools/format/items/gap_item.hpp>
#include <objtools/format/items/genome_project_item.hpp>
#include <objtools/format/items/html_anchor_item.hpp>
#include <objtools/format/context.hpp>
#include <objtools/format/ostream_text_ostream.hpp>
#include <objmgr/util/objutil.hpp>
#include <algorithm>
#include <stdio.h>
+ Include dependency graph for genbank_formatter.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.


class  CGenbankFormatterWrapDest


#define NCBI_USE_ERRCODE_X   Objtools_Fmt_Genbank


static void s_PrintLocAsJavascriptArray (CBioseqContext &ctx, CNcbiOstream &text_os, const CSeq_loc &loc)
static string s_GetAccessionWithoutPeriod (const CBioseqContext &ctx)
static string s_get_anchor_html (const string &sAnchorName, CBioseqContext *ctx)
string s_GetLinkCambiaPatentLens (const CReferenceItem &ref, bool bHtml)
string s_GetLinkFeature (const CReferenceItem &ref, bool bHtml)
void s_GenerateWeblinks (const string &strProtocol, string &strText)
void s_OrphanFixup (list< string > &wrapped, size_t uMaxSize=0)
static void s_FixListIfBadWrap (list< string > &l, list< string >::iterator l_old_last, int indent)
bool s_GetFeatureKeyLinkLocation (const CMappedFeat &feat, TGi &iGi, unsigned int &iFrom, unsigned int &iTo)
bool s_GetLinkFeatureKey (const CFeatureItemBase &item, const CFlatFeature &feat, const string &strRawKey, string &strLink, unsigned int uItemNumber=0)
static char * s_FormatSeqPosBack (char *p, TSeqPos v, size_t l)
static char * s_FormatSeqSpanTag (char *p, int base_count)
static TSeqPos s_CalcDistanceUntilNextSignificantGapOrEnd (const CSequenceItem &seq, CSeqVector_CI iter)
static void s_FormatRegularSequencePiece (const CSequenceItem &seq, IFlatTextOStream &text_os, CSeqVector_CI &iter, TSeqPos &total, TSeqPos &base_count)


static const TSeqPos s_kChunkSize = 10
static const TSeqPos s_kChunkCount = 6
static const TSeqPos s_kFullLineSize = s_kChunkSize*s_kChunkCount

Macro Definition Documentation


#define NCBI_USE_ERRCODE_X   Objtools_Fmt_Genbank

Definition at line 79 of file genbank_formatter.cpp.

Function Documentation

◆ s_CalcDistanceUntilNextSignificantGapOrEnd()

static TSeqPos s_CalcDistanceUntilNextSignificantGapOrEnd ( const CSequenceItem seq,
CSeqVector_CI  iter 

◆ s_FixListIfBadWrap()

static void s_FixListIfBadWrap ( list< string > &  l,
list< string >::iterator  l_old_last,
int  indent 

◆ s_FormatRegularSequencePiece()

static void s_FormatRegularSequencePiece ( const CSequenceItem seq,
IFlatTextOStream text_os,
CSeqVector_CI iter,
TSeqPos total,
TSeqPos base_count 

◆ s_FormatSeqPosBack()

static char* s_FormatSeqPosBack ( char *  p,
TSeqPos  v,
size_t  l 

Definition at line 1732 of file genbank_formatter.cpp.

Referenced by s_FormatRegularSequencePiece().

◆ s_FormatSeqSpanTag()

static char* s_FormatSeqSpanTag ( char *  p,
int  base_count 

Definition at line 1746 of file genbank_formatter.cpp.

Referenced by s_FormatRegularSequencePiece().

◆ s_GenerateWeblinks()

void s_GenerateWeblinks ( const string strProtocol,
string strText 

◆ s_get_anchor_html()

static string s_get_anchor_html ( const string sAnchorName,
CBioseqContext ctx 

Definition at line 286 of file genbank_formatter.cpp.

References ctx, and result.

Referenced by CGenbankFormatter::EndSection(), and CGenbankFormatter::FormatHtmlAnchor().

◆ s_GetAccessionWithoutPeriod()

static string s_GetAccessionWithoutPeriod ( const CBioseqContext ctx)

Definition at line 274 of file genbank_formatter.cpp.

References ctx, and NPOS.

Referenced by CGenbankFormatter::x_GetFeatureSpanAndScriptStart().

◆ s_GetFeatureKeyLinkLocation()

bool s_GetFeatureKeyLinkLocation ( const CMappedFeat feat,
TGi iGi,
unsigned int iFrom,
unsigned int iTo 

◆ s_GetLinkCambiaPatentLens()

string s_GetLinkCambiaPatentLens ( const CReferenceItem ref,
bool  bHtml 

◆ s_GetLinkFeature()

string s_GetLinkFeature ( const CReferenceItem ref,
bool  bHtml 

Definition at line 794 of file genbank_formatter.cpp.

◆ s_GetLinkFeatureKey()

bool s_GetLinkFeatureKey ( const CFeatureItemBase item,
const CFlatFeature feat,
const string strRawKey,
string strLink,
unsigned int  uItemNumber = 0 

◆ s_OrphanFixup()

void s_OrphanFixup ( list< string > &  wrapped,
size_t  uMaxSize = 0 

Definition at line 1271 of file genbank_formatter.cpp.

References NStr::TruncateSpaces().

◆ s_PrintLocAsJavascriptArray()

static void s_PrintLocAsJavascriptArray ( CBioseqContext ctx,
CNcbiOstream text_os,
const CSeq_loc loc 

Variable Documentation

◆ s_kChunkCount

const TSeqPos s_kChunkCount = 6

Definition at line 1728 of file genbank_formatter.cpp.

Referenced by s_FormatRegularSequencePiece().

◆ s_kChunkSize

const TSeqPos s_kChunkSize = 10

Definition at line 1727 of file genbank_formatter.cpp.

Referenced by s_FormatRegularSequencePiece().

◆ s_kFullLineSize

const TSeqPos s_kFullLineSize = s_kChunkSize*s_kChunkCount
Modified on Sat Mar 02 10:57:49 2024 by rev. 669887