1 #ifndef OBJTOOLS_FORMAT___FLAT_FILE_CONFIG__HPP
2 #define OBJTOOLS_FORMAT___FLAT_FILE_CONFIG__HPP
103 void FormatProteinId(
string&
str,
const CSeq_id& seq_id,
const string& prot_id)
const override;
104 void FormatTranscriptId(
string&
str,
const CSeq_id& seq_id,
const string& nuc_id)
const override;
105 void FormatNucSearch(
CNcbiOstream& os,
const string&
id)
const override;
106 void FormatNucId(
string&
str,
const CSeq_id& seq_id,
TIntId gi,
const string& acc_id)
const override;
107 void FormatTaxid(
string&
str,
const TTaxId taxid,
const string& taxname)
const override;
108 void FormatLocation(
string&
str,
const CSeq_loc& loc,
TIntId gi,
const string& visible_text)
const override;
110 void FormatTranscript(
string&
str,
const string& name)
const override;
111 void FormatGeneralId(
CNcbiOstream& os,
const string&
id)
const override;
112 void FormatGapLink(
CNcbiOstream& os,
TSeqPos gap_size,
const string&
id,
bool is_prot)
const override;
113 void FormatUniProtId(
string&
str,
const string& prot_id)
const override;
154 fShowContigFeatures = 1 << 1,
155 fShowContigSources = 1 << 2,
156 fShowFarTranslations = 1 << 3,
157 fTranslateIfNoProduct = 1 << 4,
158 fAlwaysTranslateCDS = 1 << 5,
159 fOnlyNearFeatures = 1 << 6,
160 fFavorFarFeatures = 1 << 7,
161 fCopyCDSFromCDNA = 1 << 8,
162 fCopyGeneToCDNA = 1 << 9,
163 fShowContigInMaster = 1 << 10,
164 fHideImpFeatures = 1 << 11,
165 fHideRemoteImpFeatures = 1 << 12,
166 fHideSNPFeatures = 1 << 13,
167 fHideExonFeatures = 1 << 14,
168 fHideIntronFeatures = 1 << 15,
169 fHideMiscFeatures = 1 << 16,
170 fHideCDSProdFeatures = 1 << 17,
171 fHideCDDFeatures = 1 << 18,
172 fShowTranscript = 1 << 19,
173 fShowPeptides = 1 << 20,
174 fHideGeneRIFs = 1 << 21,
175 fOnlyGeneRIFs = 1 << 22,
176 fLatestGeneRIFs = 1 << 23,
177 fShowContigAndSeq = 1 << 24,
178 fHideSourceFeatures = 1 << 25,
179 fShowFtableRefs = 1 << 26,
180 fOldFeaturesOrder = 1 << 27,
181 fHideGapFeatures = 1 << 28,
182 fNeverTranslateCDS = 1 << 29,
183 fShowSeqSpans = 1 << 30
190 fLongLocusNames = 1 << 2,
191 fExpandGaps = 1 << 3,
192 fShowSNPFeatures = 1 << 6,
193 fShowCDDFeatures = 1 << 7,
194 fShowDebugTiming = 1 << 8,
195 fFasterReleaseSets = 1 << 9,
196 fDisableAnnotRefs = 1 << 10,
197 fUseSeqEntryIndexer = 1 << 11,
198 fUseAutoDef = 1 << 12,
199 fIgnoreExistingTitle = 1 << 13,
200 fGeneRNACDSFeatures = 1 << 14,
201 fShowFtablePeptides = 1 << 15,
202 fDisableReferenceCache = 1 << 16,
203 fShowDeflineModifiers = 1 << 17,
204 fDoNotUseAutoDef = 1 << 18,
205 fOldTpaDisplay = 1 << 19,
206 fDisableDefaultIndex = 1 << 20,
207 fGeoLocNameCountry = 1 << 21
212 fViewNucleotides = 0x1,
214 fViewAll = (fViewNucleotides | fViewProteins),
220 ePolicy_Adaptive = 0,
221 ePolicy_Internal = 1,
222 ePolicy_External = 2,
223 ePolicy_Exhaustive = 3,
232 fGenbankBlocks_All = (~0u),
233 fGenbankBlocks_None = 0,
242 fGenbankBlocks_Head = (1u << 0),
243 fGenbankBlocks_Locus = (1u << 1),
244 fGenbankBlocks_Defline = (1u << 2),
245 fGenbankBlocks_Accession = (1u << 3),
246 fGenbankBlocks_Version = (1u << 4),
247 fGenbankBlocks_Project = (1u << 5),
248 fGenbankBlocks_Dbsource = (1u << 6),
249 fGenbankBlocks_Keywords = (1u << 7),
250 fGenbankBlocks_Segment = (1u << 8),
251 fGenbankBlocks_Source = (1u << 9),
252 fGenbankBlocks_Reference = (1u << 10),
253 fGenbankBlocks_Comment = (1u << 11),
254 fGenbankBlocks_Primary = (1u << 12),
255 fGenbankBlocks_Featheader = (1u << 13),
256 fGenbankBlocks_Sourcefeat = (1u << 14),
257 fGenbankBlocks_FeatAndGap = (1u << 15),
258 fGenbankBlocks_Basecount = (1u << 16),
259 fGenbankBlocks_Origin = (1u << 17),
260 fGenbankBlocks_Sequence = (1u << 18),
261 fGenbankBlocks_Contig = (1u << 19),
262 fGenbankBlocks_Wgs = (1u << 20),
263 fGenbankBlocks_Tsa = (1u << 21),
264 fGenbankBlocks_Slash = (1u << 22),
265 fGenbankBlocks_Cache = (1u << 23)
287 eAction_HaltFlatfileGeneration
302 virtual EAction notify(
string & block_text,
305 virtual EAction notify(
string & block_text,
308 virtual EAction notify(
string & block_text,
311 virtual EAction notify(
string & block_text,
314 virtual EAction notify(
string & block_text,
317 virtual EAction notify(
string & block_text,
320 virtual EAction notify(
string & block_text,
323 virtual EAction notify(
string & block_text,
326 virtual EAction notify(
string & block_text,
329 virtual EAction notify(
string & block_text,
332 virtual EAction notify(
string & block_text,
335 virtual EAction notify(
string & block_text,
338 virtual EAction notify(
string & block_text,
341 virtual EAction notify(
string & block_text,
344 virtual EAction notify(
string & block_text,
347 virtual EAction notify(
string & block_text,
350 virtual EAction notify(
string & block_text,
353 virtual EAction notify(
string & block_text,
356 virtual EAction notify(
string & block_text,
359 virtual EAction notify(
string & block_text,
362 virtual EAction notify(
string & block_text,
365 virtual EAction notify(
string & block_text,
368 virtual EAction notify(
string & block_text,
371 virtual EAction notify(
string & block_text,
374 virtual EAction notify(
string & block_text,
377 virtual EAction notify(
string & block_text,
396 TMode
mode = eMode_GBench,
397 TStyle style = eStyle_Normal,
399 TView view = fViewNucleotides,
400 TPolicy policy = ePolicy_Adaptive,
408 m_html_formatter = html_fmt;
412 return *m_html_formatter;
444 bool IsModeDump (
void)
const {
return m_Mode == eMode_Dump; }
469 bool IsViewNuc (
void)
const {
return (m_View & fViewNucleotides) != 0; }
470 bool IsViewProt(
void)
const {
return (m_View & fViewProteins) != 0; }
471 bool IsViewAll (
void)
const {
return IsViewNuc() && IsViewProt(); }
472 bool IsViewFirst (
void)
const {
return (m_View & fViewFirst) != 0; }
477 m_View = (m_View & ~fViewAll) | fViewNucleotides;
481 m_View = (m_View & ~fViewAll) | fViewProteins;
490 m_View |= fViewFirst;
492 m_View &= ~fViewFirst;
520 bool DoHTML (
void)
const;
521 bool HideImpFeatures (
void)
const;
522 bool HideSNPFeatures (
void)
const;
523 bool HideExonFeatures (
void)
const;
524 bool HideIntronFeatures (
void)
const;
525 bool HideMiscFeatures (
void)
const;
526 bool HideRemoteImpFeatures (
void)
const;
527 bool HideGeneRIFs (
void)
const;
528 bool OnlyGeneRIFs (
void)
const;
529 bool HideCDSProdFeatures (
void)
const;
530 bool HideCDDFeatures (
void)
const;
531 bool LatestGeneRIFs (
void)
const;
532 bool ShowContigFeatures (
void)
const;
533 bool ShowContigSources (
void)
const;
534 bool ShowContigAndSeq (
void)
const;
535 bool CopyGeneToCDNA (
void)
const;
536 bool ShowContigInMaster (
void)
const;
537 bool CopyCDSFromCDNA (
void)
const;
538 bool HideSourceFeatures (
void)
const;
539 bool AlwaysTranslateCDS (
void)
const;
540 bool OnlyNearFeatures (
void)
const;
541 bool FavorFarFeatures (
void)
const;
542 bool ShowFarTranslations (
void)
const;
543 bool TranslateIfNoProduct (
void)
const;
544 bool ShowTranscript (
void)
const;
545 bool ShowPeptides (
void)
const;
546 bool ShowFtableRefs (
void)
const;
547 bool OldFeaturesOrder (
void)
const;
548 bool HideGapFeatures (
void)
const;
549 bool NeverTranslateCDS (
void)
const;
550 bool ShowSeqSpans (
void)
const;
552 bool SuppressLocalId (
void)
const;
553 bool ValidateFeatures (
void)
const;
554 bool IgnorePatPubs (
void)
const;
555 bool DropShortAA (
void)
const;
556 bool AvoidLocusColl (
void)
const;
557 bool IupacaaOnly (
void)
const;
558 bool DropBadCitGens (
void)
const;
559 bool NoAffilOnUnpub (
void)
const;
560 bool DropIllegalQuals (
void)
const;
561 bool CheckQualSyntax (
void)
const;
562 bool NeedRequiredQuals (
void)
const;
563 bool NeedOrganismQual (
void)
const;
564 bool NeedAtLeastOneRef (
void)
const;
565 bool CitArtIsoJta (
void)
const;
566 bool DropBadDbxref (
void)
const;
567 bool UseEmblMolType (
void)
const;
568 bool HideBankItComment (
void)
const;
569 bool CheckCDSProductId (
void)
const;
570 bool FrequencyToNote (
void)
const;
571 bool SrcQualsToNote (
void)
const;
572 bool HideEmptySource (
void)
const;
573 bool GoQualsToNote (
void)
const;
574 bool SelenocysteineToNote(
void)
const;
575 bool ForGBRelease (
void)
const;
576 bool HideUnclassPartial (
void)
const;
577 bool CodonRecognizedToNote(
void)
const;
578 bool GoQualsEachMerge (
void)
const;
579 bool ShowOutOfBoundsFeats(
void)
const;
580 bool HideSpecificGeneMaps(
void)
const;
619 bool HideProteinID (
void)
const;
620 bool HideGI (
void)
const;
621 bool LongLocusNames (
void)
const;
622 bool ExpandGaps (
void)
const;
623 bool ShowSNPFeatures (
void)
const;
624 bool ShowCDDFeatures (
void)
const;
625 bool ShowDebugTiming (
void)
const;
626 bool FasterReleaseSets (
void)
const;
627 bool DisableAnnotRefs (
void)
const;
628 bool UseSeqEntryIndexer (
void)
const;
629 bool UseAutoDef (
void)
const;
630 bool IgnoreExistingTitle (
void)
const;
631 bool GeneRNACDSFeatures (
void)
const;
632 bool ShowFtablePeptides (
void)
const;
633 bool DisableReferenceCache (
void)
const;
634 bool ShowDeflineModifiers (
void)
const;
635 bool DoNotUseAutoDef (
void)
const;
636 bool OldTpaDisplay (
void)
const;
637 bool DisableDefaultIndex (
void)
const;
638 bool GeoLocNameCountry (
void)
const;
664 void SetRefSeqConventions(
void);
679 m_fGenbankBlocks = genbank_blocks;
685 return m_fGenbankBlocks & fTGenbankBlocksMask;
691 m_fGenbankBlocks |= (fTGenbankBlocksMask);
698 m_fGenbankBlocks &= (~fTGenbankBlocksMask);
702 static FGenbankBlocks StringToGenbankBlock(
const string &
str);
705 static const vector<string> & GetAllGenbankStrings(
void);
709 return m_GenbankBlockCallback; }
711 m_GenbankBlockCallback = pGenbankBlockCallback;
715 return m_pCanceledCallback;
718 m_pCanceledCallback = pCallback;
730 if( m_pCanceledCallback && m_pCanceledCallback->IsCanceled() ) {
738 void FromArguments(
const CArgs& args);
741 static const size_t SMARTFEATLIMIT = 1000000;
745 static const bool sm_ModeFlags[4][32];
747 void x_ThrowHaltNow(
void)
const;
773 #define FLAG_ARG_GET(x) \
775 bool CFlatFileConfig::x(void) const \
777 return (m_Flags & f##x) != 0; \
780 #define FLAG_ARG_SET(x) inline \
781 CFlatFileConfig& CFlatFileConfig::Set##x(bool val) \
791 #define FLAG_ARG_IMP(x) \
828 #define CUSTOM_ARG_GET(x) \
830 bool CFlatFileConfig::x(void) const \
832 return (m_Custom & f##x) != 0; \
835 #define CUSTOM_ARG_SET(x) inline \
836 CFlatFileConfig& CFlatFileConfig::Set##x(bool val) \
846 #define CUSTOM_ARG_IMP(x) \
875 #undef CUSTOM_ARG_IMP
876 #undef CUSTOM_ARG_GET
877 #undef CUSTOM_ARG_SET
@ eAction_Default
the normal case
@ eAction_Skip
skip this block (i.e. don't print it)
virtual EAction unified_notify(string &, const CBioseqContext &, const IFlatItem &, FGenbankBlocks)
virtual ~CGenbankBlockCallback(void)
bool IsFormatDDBJ(void) const
void SetFormatGenbank(void)
void SetFlags(const TFlags &flags)
const TCustom & GetCustom(void) const
void SetSingleAccession(const string &accn)
void SetStyleMaster(void)
void SkipGenbankBlock(FGenbankBlocks fTGenbankBlocksMask)
bool IsModeGBench(void) const
const TFormat & GetFormat(void) const
const TStyle & GetStyle(void) const
const IHTMLFormatter & GetHTMLFormatter() const
bool IsPolicyInternal(void) const
bool IsFormatGBSeq(void) const
const ICanceled * GetCanceledCallback(void) const
bool IsStyleSegment(void) const
bool IsPolicyExhaustive(void) const
bool IsPolicyExternal(void) const
void SetViewFirst(bool enabled)
void SetRefSeqConventions(void)
void SetPolicyGenomes(void)
void SetFeatDepth(const int featDepth)
const TMode & GetMode(void) const
void SetFormat(const TFormat &format)
void SetHTMLFormatter(CRef< IHTMLFormatter > html_fmt)
void BasicCleanup(bool clean)
bool IsPolicyAdaptive(void) const
void SetStyleNormal(void)
void SetCustom(const TCustom &custom)
void SetGapDepth(const int gapDepth)
void ShowGenbankBlock(FGenbankBlocks fTGenbankBlocksMask)
void SetGenbankBlocks(const TGenbankBlocks &genbank_blocks)
bool IsPolicyFtp(void) const
bool IsPolicyWeb(void) const
void SetPolicyInternal(void)
int GetGapDepth(void) const
void SetPolicyExternal(void)
bool IsViewNuc(void) const
bool IsViewFirst(void) const
bool IsStyleMaster(void) const
const ICanceled * m_pCanceledCallback
void SetPolicy(const TPolicy &Policy)
bool IsFormatINSDSeq(void) const
bool IsPolicyGenomes(void) const
bool IsFormatGenbank(void) const
void SetMode(const TMode &mode)
bool IsFormatFTable(void) const
const TPolicy & GetPolicy(void) const
void SetStyle(const TStyle &style)
int GetFeatDepth(void) const
void SetFormatINSDSeq(void)
void SetCanceledCallback(ICanceled *pCallback)
void SetGenbankBlockCallback(CGenbankBlockCallback *pGenbankBlockCallback)
TGenbankBlocks m_fGenbankBlocks
CRef< CGenbankBlockCallback > GetGenbankBlockCallback(void) const
void SetView(const TView &view)
bool IsViewAll(void) const
const string & GetSingleAccession(void) const
bool IsViewProt(void) const
void SetPolicyExhaustive(void)
CRef< CGenbankBlockCallback > m_GenbankBlockCallback
void SetStyleContig(void)
CRef< IHTMLFormatter > m_html_formatter
void ThrowIfCanceled(void) const
This throws a CFlatException if flatfile generation cancellation has been requested via ICanceled.
unsigned int TGenbankBlocks
const TFlags & GetFlags(void) const
bool IsModeRelease(void) const
bool BasicCleanup(void) const
bool IsFormatEMBL(void) const
bool IsModeDump(void) const
bool IsModeEntrez(void) const
bool IsFormatLite(void) const
bool IsShownGenbankBlock(FGenbankBlocks fTGenbankBlocksMask) const
void SetPolicyAdaptive(void)
const TView & GetView(void) const
bool IsStyleNormal(void) const
bool IsStyleContig(void) const
bool IsFormatAGP(void) const
void SetModeRelease(void)
void SetStyleSegment(void)
void SetFormatFTable(void)
void SetFormatGBSeq(void)
Interface for testing cancellation request in a long lasting operation.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define CUSTOM_ARG_IMP(x)
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
SStrictId_Tax::TId TTaxId
Taxon id type.
#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.
#define NCBI_FORMAT_EXPORT
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.