m_AllowModAtEndOfTaxname(
false),
54m_KeepCountryText(
false),
55m_ExcludeSpOrgs(
true),
56m_ExcludeCfOrgs(
false),
57m_ExcludeNrOrgs(
false),
58m_ExcludeAffOrgs(
false),
60m_KeepAfterSemicolon(
false),
81 for(
autoit :
orig->GetGroupList()) {
89 for(k = 0; k <
orig->GetNumSubSources(); k++) {
93 for(k = 0; k <
orig->GetNumOrgMods(); k++) {
157 if(it->IsOrgMod()) {
202 for(
unsigned intk = 0; k <
m_SubSources.size(); k++) {
213 for(
unsigned intk = 0; k <
m_OrgMods.size(); k++) {
228 if(it->GetSrcList().size() > 0
229&& src->Compare (**(it->GetSrcList().begin())) == 0) {
244 AddQual(
false,
st, even_if_not_uniquifying);
250 AddQual(
true,
st, even_if_not_uniquifying);
258 label=
"endogenous virus";
260 label=
"transgenic";
304string::size_type pos =
NStr::Find(tax_name,
"(");
305 if(pos != NCBI_NS_STD::string::npos) {
306tax_name = tax_name.substr(0, pos);
318 if((*it)->IsSetSubtype() && (*it)->GetSubtype() == subtype) {
332 if((*it)->IsSetSubtype() && (*it)->GetSubtype() == subtype) {
349 if((*subSrcI)->IsSetSubtype() && (*subSrcI)->GetSubtype() ==
st) {
352 string val= (*subSrcI)->GetName();
356 if(pos != NCBI_NS_STD::string::npos) {
357 val=
val.substr(0, pos);
365 if(pos != NCBI_NS_STD::string::npos) {
366 val=
val.substr(0, pos);
372source_description +=
" "+
val;
383 if(pos == string::npos) {
387 boolkeep_looking =
false;
389 if(pos != 0 && find_in.c_str()[pos - 1] !=
'('&& find_in.c_str()[pos - 1] !=
' ') {
391keep_looking =
true;
392}
else if(find_in.c_str()[pos + find_this.length()] !=
')'&&
393find_in.c_str()[pos + find_this.length()] !=
' '&&
394find_in.c_str()[pos + find_this.length()] != 0) {
396keep_looking =
true;
399 boolat_end = (pos == find_in.length() - find_this.length());
407}
else if(at_end && ignore_at_end) {
424 if((*modI)->IsSetSubtype() && (*modI)->GetSubtype() ==
st) {
426 string val= (*modI)->GetSubname();
430 if(pos != NCBI_NS_STD::string::npos) {
431 val=
val.substr(0, pos);
453source_description +=
" ";
454source_description +=
val;
466 boolhas_tricky =
false;
468 for(
unsigned intk = 0; k <
m_GroupList.size() && !has_tricky; k++) {
477 boolsrc_has_clone =
false;
478 boolsrc_has_isolate =
false;
479 boolsrc_has_strain =
false;
486 if(!
NStr::Equal(source_description,
"HIV-1") &&
504 booluse_isolate =
false;
508|| !src_has_clone)) {
523|| (!src_has_isolate && !src_has_strain))) {
577 switch(influenza_type) {
614 booldefault_exclude =
true;
616 for(
unsigned intk = 0; k <
m_GroupList.size() && default_exclude; k++) {
617default_exclude =
m_GroupList[k]->GetDefaultExcludeSp ();
619 returndefault_exclude;
652(*it)->IsSetSubname() &&
NStr::FindNoCase((*it)->GetSubname(),
"type strain of") != string::npos) {
724modifier_list.clear();
735 m_GroupList[k]->GetAvailableModifiers(modifier_list);
785 stringsource_description;
788 boolno_extras =
false;
804string::size_type pos =
NStr::Find(source_description,
" sp. ");
805 if(pos != NCBI_NS_STD::string::npos
806&& (pos < 2 || !
NStr::StartsWith(source_description.substr(pos - 2),
"f."))) {
815string::size_type pos =
NStr::Find(source_description,
" cf. ");
816 if(pos != NCBI_NS_STD::string::npos) {
821string::size_type pos =
NStr::Find(source_description,
" nr. ");
822 if(pos != NCBI_NS_STD::string::npos) {
827string::size_type pos =
NStr::Find(source_description,
" aff. ");
828 if(pos != NCBI_NS_STD::string::npos) {
835source_description =
"Mutant "+ source_description;
839 for(
unsigned intk = 0; k <
m_OrgMods.size(); k++) {
846 for(
unsigned intk = 0; k <
m_SubSources.size(); k++) {
857 stringparen =
" (";
861paren += it->GetSubname();
870serotype = it->GetSubname();
875paren +=
"("+ serotype +
")";
880source_description += paren;
884source_description +=
" clone";
893 if(orgmods.
find(
st) != orgmods.
end() &&
899 if(subsrcs.
find(
st) != subsrcs.
end() &&
909 returnsource_description;
915 boolany_change =
false;
916vector<CTempString> tokens;
918 ITERATE(vector<CTempString>,
t, tokens) {
919 if(
NStr::Find(*
t,
"maxicircle") != string::npos ||
920 NStr::Find(*
t,
"minicircle") != string::npos) {
923source_description +=
" "+ add;
933 boolany_change =
false;
936 if((*it)->IsSetSubtype() && (*it)->IsSetName() &&
944 if((*it)->IsSetSubtype() && (*it)->IsSetSubname() &&
946any_change |=
x_AddMinicircle(source_description, (*it)->GetSubname());
956 unsigned intnum = 0;
959 if((*it)->GetSrcList().size() == 1) {
969 unsigned intnum = 0;
972 if((*it)->GetSrcList().size() > num) {
973num = (*it)->GetSrcList().size();
987 unsigned intnum_this, num_other;
991 if(num_this > num_other) {
993}
else if(num_this < num_other) {
998 if(num_this > num_other) {
1000}
else if(num_this < num_other) {
1005 if(num_this < num_other) {
1007}
else if(num_this > num_other) {
1012 if(num_this < num_other) {
1014}
else if(num_this > num_other) {
1033 booladded =
false, rval =
false;
1034vector <CRef<CAutoDefSourceGroup> > new_groups;
1039(*it)->SortDescriptions();
1040 auto split= (*it)->SplitGroup();
1043new_groups.emplace_back(
split);
1052 if(!new_groups.empty()) {
1058 if(rval || even_if_not_uniquifying) {
1077rval |= (*it)->RemoveQual (IsOrgMod, subtype);
1086vector<CRef<CAutoDefModifierCombo>> expanded;
1090 if(it->GetSrcList().size() == 1) {
1093mods = it->GetModifiersPresentForAny();
1094 for(
automod_it : mods) {
1096 if(cpy->AddQual(mod_it.IsOrgMod(), mod_it.GetSubtype())) {
1097expanded.emplace_back(cpy);
1100 if(!expanded.empty()) {
1110vector<string> clauses;
1114CAutoDefSourceGroup::TSourceDescriptionVector::iterator s = src_list.begin();
1115 while(s != src_list.end()) {
1116clauses.push_back((*s)->GetFeatureClauses());
1120 if(clauses.size() < 2) {
1123 sort(clauses.begin(), clauses.end());
1124 boolunique =
true;
1125vector<string>::iterator sit = clauses.begin();
1128 while(sit != clauses.end() && unique) {
static const size_t kNumPreferred
static const SPreferredQual s_PreferredList[]
bool CompareAutoDefSourceGroupByStrings(CRef< CAutoDefSourceGroup > s1, CRef< CAutoDefSourceGroup > s2)
static string GetOrgModLabel(COrgMod::ESubtype st)
static string GetSubSourceLabel(CSubSource::ESubtype st)
unsigned int GetNumGroups()
static bool IsModifierRequiredByDefault(bool is_orgmod, int subtype)
static bool x_BioSourceHasOrgMod(const CBioSource &src, COrgMod::ESubtype subtype)
void x_AddTypeStrainModifiers(TExtraOrgMods &extra_orgmods, TExtraSubSrcs &extra_subsrcs, const CBioSource &bsrc)
bool HasSubSource(CSubSource::ESubtype st)
TGroupListVector m_GroupList
void AddSource(const CBioSource &bs, const string &feature_clauses="")
bool AreFeatureClausesUnique()
static bool x_HasTypeStrainComment(const CBioSource &bsrc)
void GetAvailableModifiers(CAutoDefSourceDescription::TAvailableModifierVector &modifier_list)
static bool IsUsableInDefline(CSubSource::ESubtype subtype)
void x_AddHIVModifiers(TExtraOrgMods &extra_orgmods, TExtraSubSrcs &extra_subsrcs, const CBioSource &bsrc)
vector< CRef< CAutoDefSourceGroup > > TGroupListVector
unsigned int GetNumUnique() const
static bool x_AddMinicircle(string &source_description, const CBioSource &bsrc)
CSubSource::ESubtype GetSubSource(unsigned int index)
static bool x_SpecialHandlingForInfluenza(EInfluenzaType influenza_type, CSubSource::ESubtype subtype)
void x_AddRequiredSubSourceModifiers(TExtraOrgMods &extra_orgmods, TExtraSubSrcs &extra_subsrcs, const CBioSource &bsrc)
string x_GetOrgModLabel(COrgMod::ESubtype st)
unsigned int GetMaxInGroup() const
bool HasOrgMod(COrgMod::ESubtype st)
bool m_KeepAfterSemicolon
void x_CleanUpTaxName(string &tax_name)
void AddOrgMod(COrgMod::ESubtype st, bool even_if_not_uniquifying=false)
string GetSourceDescriptionString(const CBioSource &bsrc)
bool AddQual(bool IsOrgMod, int subtype, bool even_if_not_uniquifying=false)
void AddSubsource(CSubSource::ESubtype st, bool even_if_not_uniquifying=false)
bool GetDefaultExcludeSp()
TOrgModTypeVector m_OrgMods
int Compare(const CAutoDefModifierCombo &other) const
string x_GetSubSourceLabel(CSubSource::ESubtype st)
unsigned int GetNumSubSources()
TSubSourceTypeVector m_SubSources
void InitFromOptions(const CAutoDefOptions &options)
void x_AddInfluenzaModifiers(TExtraOrgMods &extra_orgmods, TExtraSubSrcs &extra_subsrcs, EInfluenzaType influenza_type)
const TGroupListVector & GetGroupList() const
CAutoDefSourceDescription::TModifierVector m_Modifiers
static bool x_BioSourceHasSubSrc(const CBioSource &src, CSubSource::ESubtype subtype)
bool m_AllowModAtEndOfTaxname
static EInfluenzaType GetInfluenzaType(const string &taxname)
bool x_AddOrgModString(string &source_description, const CBioSource &bsrc, COrgMod::ESubtype st)
static bool IsModifierInString(const string &find_this, const string &find_in, bool ignore_at_end)
pair< CSubSource::ESubtype, bool > TExtraSubSrc
unsigned int GetNumOrgMods()
bool x_AddSubsourceString(string &source_description, const CBioSource &bsrc, CSubSource::ESubtype st)
CAutoDefOptions::EHIVCloneIsolateRule m_HIVCloneIsolateRule
vector< CRef< CAutoDefModifierCombo > > ExpandByAnyPresent()
void InitOptions(CAutoDefOptions &options) const
const CAutoDefSourceDescription::TModifierVector & GetModifiers() const
bool RemoveQual(bool IsOrgMod, int subtype)
pair< COrgMod::ESubtype, bool > TExtraOrgMod
COrgMod::ESubtype GetOrgMod(unsigned int index)
bool GetKeepAfterSemicolon() const
THIVRule GetHIVRule() const
void AddOrgMod(COrgMod::TSubtype subtype)
void SetHIVRule(EHIVCloneIsolateRule rule)
void SetLeaveParenthetical(bool val=true)
bool GetDoNotApplyToSp() const
const TOrgMods & GetOrgMods() const
void SetDoNotApplyToAff(bool val=true)
bool GetDoNotApplyToNr() const
bool GetLeaveParenthetical() const
bool GetAllowModAtEndOfTaxname() const
void SetDoNotApplyToNr(bool val=true)
bool GetDoNotApplyToAff() const
void SetUseLabels(bool val=true)
void SetKeepAfterSemicolon(bool val=true)
vector< COrgMod::TSubtype > TOrgMods
bool GetIncludeCountryText() const
void SetDoNotApplyToCf(bool val=true)
bool GetDoNotApplyToCf() const
void SetAllowModAtEndOfTaxname(bool val=true)
void AddSubSource(CSubSource::TSubtype subtype)
void SetDoNotApplyToSp(bool val=true)
void SetIncludeCountryText(bool val=true)
const TSubSources & GetSubSources() const
bool GetUseLabels() const
vector< CSubSource::TSubtype > TSubSources
vector< CAutoDefSourceModifierInfo > TModifierVector
vector< CAutoDefAvailableModifier > TAvailableModifierVector
vector< CRef< CAutoDefSourceDescription > > TSourceDescriptionVector
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
#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.
#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.
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 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.
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 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.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ eNocase
Case insensitive compare.
static const char label[]
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
TOrigin GetOrigin(void) const
Get the Origin member data.
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
list< CRef< CSubSource > > TSubtype
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
bool CanGetOrigin(void) const
Check if it is safe to call GetOrigin method.
const TOrg & GetOrg(void) const
Get the Org member data.
@ eSubtype_endogenous_virus_name
@ eOrigin_mut
artificially mutagenized
const TMod & GetMod(void) const
Get the Mod member data.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
list< CRef< COrgMod > > TMod
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_other
ASN5: old-name (254) will be added to next spec.
@ eSubtype_nat_host
natural host of this specimen
@ eSubtype_specimen_voucher
@ eSubtype_culture_collection
@ eSubtype_forma_specialis
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
constexpr auto sort(_Init &&init)
Miscellaneous common-use basic types and functionality.
void split(std::vector< std::string > *strVec, const std::string &str_, const std::string &split_)
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
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