,
true,
true,
true,
true,
true,
true,
true,
true,
true,
350 true,
true,
true,
true,
true,
true,
true,
true,
true,
true,
351 true,
true,
true,
true,
true,
true,
true,
false,
false,
true,
357 false,
true,
true,
true,
true,
false,
true,
true,
false,
true,
358 true,
true,
true,
true,
true,
true,
true,
false,
true,
true,
359 true,
true,
true,
true,
false,
true,
true,
true,
false,
true,
364 false,
false,
false,
false,
false,
false,
false,
true,
false,
false,
365 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
366 false,
false,
false,
false,
false,
false,
false,
false,
true,
false,
371 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
372 false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
373 false,
false,
false,
false,
false,
false,
true,
false,
true,
false,
379 #define MODE_FLAG_GET(x, y) \ 380 bool CFlatFileConfig::x(void) const \ 382 return sm_ModeFlags[static_cast<size_t>(m_Mode)][y]; \ 471 if( find_iter == sc_BlockMap.end() ) {
472 throwruntime_error(
"Could not translate this string to a Genbank block type: "+
str);
474 returnfind_iter->second;
478 constvector<string>&
481 staticvector<string> s_vecOfGenbankStrings;
485 if( s_vecOfGenbankStrings.empty() ) {
489setOfGenbankStrings.
insert(map_iter->first);
492setOfGenbankStrings.
end(),
493back_inserter(s_vecOfGenbankStrings) );
496 returns_vecOfGenbankStrings;
503 "FlatFile Generation canceled");
519 "genbank",
"embl",
"ddbj",
"gbseq",
"insdseq",
"ftable",
"gff",
"gff3",
"lite"));
523 "Restriction level",
533&(*
new CArgAllow_Strings,
"normal",
"segment",
"master",
"contig",
"conwithfeat"));
540&(*
new CArgAllow_Strings,
"adaptive",
"internal",
"external",
"exhaustive",
"ftp",
"web",
"genomes"));
544arg_desc->
AddDefaultKey(
"flags",
"COMMA_SEPARATED_FLAGS_LIST",
545 "Flags controlling flat file output.\n" 546 "The value is the bitwise OR (logical addition) of:\n" 547 DENT "DoHTML (1) - show HTML report\n" 548 DENT "ShowContigFeatures (2) - show contig features\n" 549 DENT "ShowContigSources (4) - show contig sources\n" 550 DENT "ShowFarTranslations (8) - show far translations\n" 551 DENT "TranslateIfNoProduct (16) - show translations if no products\n" 552 DENT "AlwaysTranslateCDS (32) - always translate CDS\n" 553 DENT "OnlyNearFeatures (64) - show only near features\n" 554 DENT "FavorFarFeatures (128) - show far features on segs\n" 555 DENT "CopyCDSFromCDNA (256) - copy CDS feature from cDNA\n" 556 DENT "CopyGeneToCDNA (512) - copy gene to cDNA\n" 557 DENT "ShowContigInMaster (1024) - show contig in master\n" 558 DENT "HideImpFeatures (2048) - hide imported features\n" 559 DENT "HideRemoteImpFeatures (4096) - hide remote imported features\n" 560 DENT "HideSNPFeatures (8192) - hide SNP features\n" 561 DENT "HideExonFeatures (16384) - hide exon features\n" 562 DENT "HideIntronFeatures (32768) - hide intron features\n" 563 DENT "HideMiscFeatures (65536) - hide misc features\n" 564 DENT "HideCDSProdFeatures (131072) - hide CDS product features\n" 565 DENT "HideCDDFeatures (262144) - hide CDD features\n" 566 DENT "ShowTranscript (542288) - show transcript sequence\n" 567 DENT "ShowPeptides (1048576) - show peptides\n" 568 DENT "HideGeneRIFs (2097152) - hide GeneRIFs\n" 569 DENT "OnlyGeneRIFs (4194304) - show only GeneRIFs\n" 570 DENT "LatestGeneRIFs (8388608) - show only the latest GeneRIFs\n" 571 DENT "ShowContigAndSeq (16777216) - show contig and sequence\n" 572 DENT "HideSourceFeatures (33554432) - hide source features\n" 573 DENT "ShowFtableRefs (67108864) - show feature table references\n" 574 DENT "OldFeaturesOrder (134217728) - use the old feature sort order\n" 575 DENT "HideGapFeatures (268435456) - hide gap features\n" 576 DENT "NeverTranslateCDS (536870912) - do not translate the CDS\n" 577 DENT "ShowSeqSpans (1073741824) - show javascript sequence spans",
582arg_desc->
AddDefaultKey(
"custom",
"COMMA_SEPARATED_FLAGS_LIST",
583 "Custom flat file output bits.\n" 584 "The value is the bitwise OR (logical addition) of:\n" 585 DENT "HideProteinID (1) - hide protein_id and transcript_id\n" 586 DENT "HideGI (2) - hide GI number\n" 587 DENT "LongLocusNames (4) - allow long locus lines\n" 588 DENT "ExpandGaps (8) - show Expand Ns link\n" 589 DENT "ShowSNPFeatures (64) - show SNP features\n" 590 DENT "ShowCDDFeatures (128) - show CDD features\n" 591 DENT "ShowDebugTiming (256) - show debug timing\n" 592 DENT "FasterReleaseSets (512) - faster release sets\n" 593 DENT "DisableAnnotRefs (1024) - disable annot references\n" 594 DENT "UseSeqEntryIndexer (2048) - use SeqEntry indexer\n" 595 DENT "UseAutoDef (4096) - use automatic defline generator\n" 596 DENT "IgnoreExistingTitle (8192) - ignore existing title\n" 597 DENT "GeneRNACDSFeatures (16384) - only Gene, RNA, and CDS features\n" 598 DENT "ShowFtablePeptides (32768) - show peptide qualifierss in feature table\n" 599 DENT "DisableReferenceCache (65536) - disable reference cache\n" 600 DENT "ShowDeflineModifiers (131072) - show definition line modifiers\n" 601 DENT "DoNotUseAutoDef (262144) - suppress automatic defline generator\n" 602 DENT "OldTpaDisplay (542288) - old TPA display with PRIMARY block\n" 603 DENT "DisableDefaultIndex (1048576) - disable SeqEntry indexer\n" 604 DENT "GeoLocNameCountry (2097152) - use geo_loc_name instead of country\n" 605 DENT "LeavePrefixSuffix (4194304) - keep existing prefix and suffix",
610arg_desc->
AddOptionalKey(
"showblocks",
"COMMA_SEPARATED_BLOCK_LIST",
611 "Use this to only show certain parts of the flatfile (e.g. '-showblocks locus,defline'). " 614arg_desc->
AddOptionalKey(
"skipblocks",
"COMMA_SEPARATED_BLOCK_LIST",
615 "Use this to skip certain parts of the flatfile (e.g. '-skipblocks sequence,origin'). " 621arg_desc->
AddFlag(
"demo-genbank-callback",
622 "When set (and genbank mode is used), this program will demonstrate the use of " 623 "genbank callbacks via a very simple callback that just prints its output to stderr, then " 624 "prints some statistics. To demonstrate halting of flatfile generation, the genbank callback " 625 "will halt flatfile generation if it encounters an item with the words 'HALT TEST'. To demonstrate skipping a block, it will skip blocks with the words 'SKIP TEST' in them. Also, blocks with the words 'MODIFY TEST' in them will have the text 'MODIFY TEST' turned into 'WAS MODIFIED TEST'.");
627arg_desc->
AddFlag(
"no-external",
628 "Disable all external annotation sources");
630arg_desc->
AddFlag(
"enable-external",
631 "Enable loading of external annotation sources for local file");
633arg_desc->
AddFlag(
"resolve-all",
634 "Resolves all, e.g. for contigs.");
642arg_desc->
AddOptionalKey(
"max_search_segments",
"MaxSearchSegments",
648arg_desc->
AddFlag(
"show-flags",
649 "Describe the current flag set in ENUM terms");
676arg_desc->
AddFlag(
"html",
"Produce HTML output");
682arg_desc->
AddFlag(
"cleanup",
683 "Do internal data cleanup prior to formatting");
685arg_desc->
AddFlag(
"nocleanup",
686 "Do not perform data cleanup prior to formatting");
688arg_desc->
AddFlag(
"gbload",
"Use GenBank data loader");
691arg_desc->
AddDefaultKey(
"count",
"Count",
"Number of runs",
700 const string&
format= args[
"format"].AsString();
701 if(
format==
"genbank") {
703}
else if(
format==
"embl") {
705}
else if(
format==
"ddbj") {
707}
else if(
format==
"gbseq") {
709}
else if(
format==
"insdseq") {
711}
else if(
format==
"ftable") {
713}
else if(
format==
"lite") {
718 "Asn2flat no longer supports GFF and GFF3 generation. " 719 "For state-of-the-art GFF output, use annotwriter.";
729 const string&
mode= args[
"mode"].AsString();
730 if(
mode==
"release") {
732}
else if(
mode==
"entrez") {
734}
else if(
mode==
"gbench") {
736}
else if(
mode==
"dump") {
747 const string& style = args[
"style"].AsString();
748 if( style ==
"normal") {
750}
else if( style ==
"segment") {
752}
else if( style ==
"master") {
754}
else if( style ==
"contig") {
756}
else if( style ==
"conwithfeat") {
767 const string& Policy = args[
"policy"].AsString();
768 if( Policy ==
"adaptive") {
770}
else if( Policy ==
"internal") {
772}
else if( Policy ==
"external") {
774}
else if( Policy ==
"exhaustive") {
776}
else if( Policy ==
"ftp") {
778}
else if( Policy ==
"web") {
780}
else if( Policy ==
"genomes") {
793 stringsFlags = args[
"flags"].AsString();
794 if(!sFlags.empty()) {
795vector<string> vFlags;
797 for(
const string& sFlag : vFlags) {
807 #define DOFLG(mnem) { #mnem, CFlatFileConfig::f##mnem } 809 DOFLG(ShowContigFeatures),
810 DOFLG(ShowContigSources),
811 DOFLG(ShowFarTranslations),
812 DOFLG(TranslateIfNoProduct),
813 DOFLG(AlwaysTranslateCDS),
814 DOFLG(OnlyNearFeatures),
815 DOFLG(FavorFarFeatures),
816 DOFLG(CopyCDSFromCDNA),
817 DOFLG(CopyGeneToCDNA),
818 DOFLG(ShowContigInMaster),
819 DOFLG(HideImpFeatures),
820 DOFLG(HideRemoteImpFeatures),
821 DOFLG(HideSNPFeatures),
822 DOFLG(HideExonFeatures),
823 DOFLG(HideIntronFeatures),
824 DOFLG(HideMiscFeatures),
825 DOFLG(HideCDSProdFeatures),
826 DOFLG(HideCDDFeatures),
827 DOFLG(ShowTranscript),
828 DOFLG(ShowPeptides),
829 DOFLG(HideGeneRIFs),
830 DOFLG(OnlyGeneRIFs),
831 DOFLG(LatestGeneRIFs),
832 DOFLG(ShowContigAndSeq),
833 DOFLG(HideSourceFeatures),
834 DOFLG(ShowFtableRefs),
835 DOFLG(OldFeaturesOrder),
836 DOFLG(HideGapFeatures),
837 DOFLG(NeverTranslateCDS),
838 DOFLG(ShowSeqSpans),
842 autoit = mnemonics.find(sFlag);
843 if(it != mnemonics.cend()) {
846cerr <<
"Error: Unrecognized flag: "<< sFlag << endl;
852 if(args[
"html"]) {
856 if(args[
"show-flags"]) {
858 typedefpair<CFlatFileConfig::EFlags, const char*> TFlagDescr;
859 static constTFlagDescr kDescrTable[] = {
860 #define DOFLG(mnem) TFlagDescr(CFlatFileConfig::f##mnem, "CFlatFileConfig::f"#mnem)
862 DOFLG(ShowContigFeatures),
863 DOFLG(ShowContigSources),
864 DOFLG(ShowFarTranslations),
865 DOFLG(TranslateIfNoProduct),
866 DOFLG(AlwaysTranslateCDS),
867 DOFLG(OnlyNearFeatures),
868 DOFLG(FavorFarFeatures),
869 DOFLG(CopyCDSFromCDNA),
870 DOFLG(CopyGeneToCDNA),
871 DOFLG(ShowContigInMaster),
872 DOFLG(HideImpFeatures),
873 DOFLG(HideRemoteImpFeatures),
874 DOFLG(HideSNPFeatures),
875 DOFLG(HideExonFeatures),
876 DOFLG(HideIntronFeatures),
877 DOFLG(HideMiscFeatures),
878 DOFLG(HideCDSProdFeatures),
879 DOFLG(HideCDDFeatures),
880 DOFLG(ShowTranscript),
881 DOFLG(ShowPeptides),
882 DOFLG(HideGeneRIFs),
883 DOFLG(OnlyGeneRIFs),
884 DOFLG(LatestGeneRIFs),
885 DOFLG(ShowContigAndSeq),
886 DOFLG(HideSourceFeatures),
887 DOFLG(ShowFtableRefs),
888 DOFLG(OldFeaturesOrder),
889 DOFLG(HideGapFeatures),
890 DOFLG(NeverTranslateCDS),
891 DOFLG(ShowSeqSpans),
894 static const size_tkArraySize =
ArraySize(kDescrTable);
895 for(
size_t i= 0;
i< kArraySize; ++
i) {
898<< std::left << setw(40) << kDescrTable[
i].second
900<< std::right << setw(10) << kDescrTable[
i].
first 906 const string& style = args[
"style"].AsString();
907 if( style ==
"conwithfeat") {
919 stringsCustom = args[
"custom"].AsString();
920 if(!sCustom.empty()) {
921vector<string> vFlags;
923 for(
const string& sFlag : vFlags) {
933 #define DOFLG(mnem) { #mnem, CFlatFileConfig::f##mnem } 934 DOFLG(HideProteinID),
936 DOFLG(LongLocusNames),
938 DOFLG(ShowSNPFeatures),
939 DOFLG(ShowCDDFeatures),
940 DOFLG(ShowDebugTiming),
941 DOFLG(FasterReleaseSets),
942 DOFLG(DisableAnnotRefs),
943 DOFLG(UseSeqEntryIndexer),
945 DOFLG(IgnoreExistingTitle),
946 DOFLG(GeneRNACDSFeatures),
947 DOFLG(ShowFtablePeptides),
948 DOFLG(DisableReferenceCache),
949 DOFLG(ShowDeflineModifiers),
950 DOFLG(DoNotUseAutoDef),
951 DOFLG(DisableDefaultIndex),
952 DOFLG(GeoLocNameCountry),
956 autoit = mnemonics.find(sFlag);
957 if(it != mnemonics.cend()) {
958custom |= it->second;
960cerr <<
"Error: Unrecognized flag: "<< sFlag << endl;
966 if(args[
"show-flags"]) {
968 typedefpair<CFlatFileConfig::ECustom, const char*> TFlagDescr;
969 static constTFlagDescr kDescrTable[] = {
970 #define DOFLG(mnem) TFlagDescr(CFlatFileConfig::f##mnem, "CFlatFileConfig::f"#mnem)
971 DOFLG(HideProteinID),
973 DOFLG(LongLocusNames),
975 DOFLG(ShowSNPFeatures),
976 DOFLG(ShowCDDFeatures),
977 DOFLG(ShowDebugTiming),
978 DOFLG(FasterReleaseSets),
979 DOFLG(DisableAnnotRefs),
980 DOFLG(UseSeqEntryIndexer),
982 DOFLG(IgnoreExistingTitle),
983 DOFLG(GeneRNACDSFeatures),
984 DOFLG(ShowFtablePeptides),
985 DOFLG(DisableReferenceCache),
986 DOFLG(ShowDeflineModifiers),
987 DOFLG(DoNotUseAutoDef),
988 DOFLG(DisableDefaultIndex),
989 DOFLG(GeoLocNameCountry),
992 static const size_tkArraySize =
ArraySize(kDescrTable);
993 for(
size_t i= 0;
i< kArraySize; ++
i) {
994 if(custom & kDescrTable[
i].
first) {
996<< std::left << setw(38) << kDescrTable[
i].second
998<< std::right << setw(10) << kDescrTable[
i].
first 1010 const string& view = args[
"view"].AsString();
1011 if( view ==
"all") {
1013}
else if( view ==
"prot") {
1015}
else if( view ==
"nuc") {
1030 boolbInvertFlags =
false;
1031 if( args[
"showblocks"] ) {
1032blocks_arg = args[
"showblocks"].AsString();
1033}
else if( args[
"skipblocks"] ) {
1034blocks_arg = args[
"skipblocks"].AsString();
1035bInvertFlags =
true;
1042vector<string> vecOfBlockNames;
1044 ITERATE(vector<string>, name_iter, vecOfBlockNames) {
1050fBlocksGiven |= fThisBlock;
1053 return( bInvertFlags ? ~fBlocksGiven : fBlocksGiven );
1070 if(args[
"no-external"]) {
1073}
else if(args[
"enable-external"] || args[
"policy"].AsString() ==
"external") {
1092 if( args[
"depth"] ) {
1093 intfeatDepth = args[
"depth"].AsInteger();
1096 if( args[
"gap-depth"] ) {
1097 intgapDepth = args[
"gap-depth"].AsInteger();
1100 if(args[
"accn"]) {
1101 stringsingleAccn = args[
"accn"].AsString();
1153os <<
" [gap "<< gap_size <<
" "<< (is_prot ?
"aa":
"bp") <<
"]";
virtual EAction notify(string &block_text, const CBioseqContext &ctx, const CStartSectionItem &head_item)
virtual EBioseqSkip notify_bioseq(CBioseqContext &ctx)
void SetFlags(const TFlags &flags)
void SetSingleAccession(const string &accn)
void SetFeatDepth(const int featDepth)
void SetFormat(const TFormat &format)
static void AddArgumentDescriptions(CArgDescriptions &args)
bool SrcQualsToNote(void) const
void SetCustom(const TCustom &custom)
void SetGapDepth(const int gapDepth)
void SetGenbankBlocks(const TGenbankBlocks &genbank_blocks)
static FGenbankBlocks StringToGenbankBlock(const string &str)
void FromArguments(const CArgs &args)
void SetPolicy(const TPolicy &Policy)
void SetMode(const TMode &mode)
void SetStyle(const TStyle &style)
bool SelenocysteineToNote(void) const
CFlatFileConfig(TFormat format=eFormat_GenBank, TMode mode=eMode_GBench, TStyle style=eStyle_Normal, TFlags flags=0, TView view=fViewNucleotides, TPolicy policy=ePolicy_Adaptive, TCustom custom=0)
void SetCanceledCallback(ICanceled *pCallback)
void SetGenbankBlockCallback(CGenbankBlockCallback *pGenbankBlockCallback)
TGenbankBlocks m_fGenbankBlocks
void SetView(const TView &view)
bool CodonRecognizedToNote(void) const
@ fGenbankBlocks_FeatAndGap
@ fGenbankBlocks_Sourcefeat
@ fGenbankBlocks_Keywords
@ fGenbankBlocks_Reference
@ fGenbankBlocks_Dbsource
@ fGenbankBlocks_Sequence
@ fGenbankBlocks_Featheader
@ fGenbankBlocks_Accession
@ fGenbankBlocks_Basecount
CRef< IHTMLFormatter > m_html_formatter
unsigned int TGenbankBlocks
bool BasicCleanup(void) const
bool GoQualsToNote(void) const
static const vector< string > & GetAllGenbankStrings(void)
static const bool sm_ModeFlags[4][32]
void x_ThrowHaltNow(void) const
void FormatProteinId(string &str, const CSeq_id &seq_id, const string &prot_id) const override
void FormatTranscriptId(string &str, const CSeq_id &seq_id, const string &nuc_id) const override
void FormatUniProtId(string &str, const string &prot_id) const override
void FormatTaxid(string &str, const TTaxId taxid, const string &taxname) const override
void FormatModelEvidence(string &str, const SModelEvidance &me) const override
void FormatGeneralId(ostream &os, const string &id) const override
void FormatNucSearch(ostream &os, const string &id) const override
void FormatNucId(string &str, const CSeq_id &seq_id, TIntId gi, const string &acc_id) const override
void FormatGapLink(ostream &os, TSeqPos gap_size, const string &id, bool is_prot) const override
void FormatTranscript(string &str, const string &name) const override
void FormatLocation(string &str, const CSeq_loc &loc, TIntId gi, const string &visible_text) const override
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
TBase::const_iterator const_iterator
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
Include a standard set of the NCBI C++ Toolkit most basic headers.
CStaticArrayMap< const char *, CFlatFileConfig::FGenbankBlocks, PNocase_CStr > TBlockMap
static const TBlockElem sc_block_map[]
DEFINE_STATIC_ARRAY_MAP(TBlockMap, sc_BlockMap, sc_block_map)
#define MODE_FLAG_GET(x, y)
SStaticPair< const char *, CFlatFileConfig::FGenbankBlocks > TBlockElem
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
constexpr size_t ArraySize(const Element(&)[Size])
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
void AddFlag(const string &name, const string &comment, CBoolEnum< EFlagValue > set_value=eFlagHasValueIfSet, TFlags flags=0)
Add description for flag argument.
void SetConstraint(const string &name, const CArgAllow *constraint, EConstraintNegate negate=eConstraint)
Set additional user defined constraint on argument value.
void SetDependency(const string &arg1, EDependency dep, const string &arg2)
Define a dependency.
void AddOptionalKey(const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
Add description for optional key without default value.
void SetCurrentGroup(const string &group)
Set current arguments group name.
void AddDefaultKey(const string &name, const string &synopsis, const string &comment, EType type, const string &default_value, TFlags flags=0, const string &env_var=kEmptyStr, const char *display_value=nullptr)
Add description for optional key with default value.
@ eExcludes
One argument excludes another.
@ eDouble
Convertible into a floating point number (double)
@ eString
An arbitrary string.
@ eInteger
Convertible into an integer number (int or Int8)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
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.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
static const string kDefault
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
Defines command line argument related classes.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
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