53 for (
auto& it : list) {
54 if (it->CanAutofix()) {
61 if (call(new_feat->
SetData().SetBiosrc())) {
88 const CSeqdesc* biosrc = context.GetBiosource();
92 bool has_chromosome =
false;
94 if (it->IsSetSubtype()) {
99 has_chromosome =
true;
104 if (has_map && !has_chromosome) {
105 m_Objs[
"[n] source[s] on eukaryotic sequence[s] [has] map but not chromosome"].Add(*context.SeqdescObjRef(*biosrc)).Fatal();
115 for (
const CBioSource* biosrc : context.GetBiosources()) {
116 if (biosrc->IsSetOrg() && biosrc->IsSetSubtype() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod() && biosrc->GetOrg().IsSetTaxname() &&
NStr::StartsWith(biosrc->GetOrg().GetTaxname(),
"Influenza ")) {
118 int collection_year = 0;
119 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
121 string s = it->GetSubname();
122 size_t pos = s.rfind(
'/');
123 if (pos == string::npos) {
127 while (
isspace(s.c_str()[pos])) {
141 for (
const auto& it : biosrc->GetSubtype()) {
155 if (strain_year != collection_year) {
156 m_Objs[
"[n] influenza strain[s] conflict with collection date"].Add(*context.BiosourceObjRef(*biosrc));
167 for (
const CBioSource* biosrc : context.GetBiosources()) {
168 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetTaxname() &&
NStr::StartsWith(biosrc->GetOrg().GetTaxname(),
"Influenza ")) {
169 bool found_strain =
false;
170 bool found_host =
false;
171 bool found_country =
false;
172 bool found_collection_date =
false;
173 if (biosrc->IsSetSubtype()) {
174 for (
const auto& it : biosrc->GetSubtype()) {
175 if (it->IsSetSubtype()) {
176 switch (it->GetSubtype()) {
178 found_country =
true;
181 found_collection_date =
true;
187 if (biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
188 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
189 if (it->IsSetSubtype()) {
190 switch (it->GetSubtype()) {
202 m_Objs[
"[n] Influenza biosource[s] [does] not have strain"].Add(*context.BiosourceObjRef(*biosrc));
205 m_Objs[
"[n] Influenza biosource[s] [does] not have host"].Add(*context.BiosourceObjRef(*biosrc));
207 if (!found_country) {
208 m_Objs[
"[n] Influenza biosource[s] [does] not have country"].Add(*context.BiosourceObjRef(*biosrc));
210 if (!found_collection_date) {
211 m_Objs[
"[n] Influenza biosource[s] [does] not have collection-date"].Add(*context.BiosourceObjRef(*biosrc));
222 for (
const CBioSource* biosrc : context.GetBiosources()) {
223 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetTaxname() &&
NStr::StartsWith(biosrc->GetOrg().GetTaxname(),
"Influenza A virus ") && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
225 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
232 m_Objs[
"[n] Influenza A virus biosource[s] [does] not have serotype"].Add(*context.BiosourceObjRef(*biosrc));
241 DISCREPANCY_CASE(INFLUENZA_SEROTYPE_FORMAT, BIOSRC,
eOncaller,
"Influenza A virus serotype must match /^H[1-9]\\d*$|^N[1-9]\\d*$|^H[1-9]\\d*N[1-9]\\d*$|^mixed$/")
243 for (
const CBioSource* biosrc : context.GetBiosources()) {
244 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetTaxname() &&
NStr::StartsWith(biosrc->GetOrg().GetTaxname(),
"Influenza A virus ")) {
245 static CRegexp rx(
"^H[1-9]\\d*$|^N[1-9]\\d*$|^H[1-9]\\d*N[1-9]\\d*$|^mixed$");
246 if (biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
247 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
249 m_Objs[
"[n] Influenza A virus serotype[s] [has] incorrect format"].Add(*context.BiosourceObjRef(*biosrc));
262 for (
const CBioSource* biosrc : context.GetBiosources()) {
263 if (biosrc->IsSetSubtype()) {
264 for (
const auto& it : biosrc->GetSubtype()) {
266 m_Objs[
"[n] bio-source[s] [has] uncultured note[s]"].Add(*context.BiosourceObjRef(*biosrc)).Fatal();
281 const CSeqdesc* src = context.GetBiosource();
282 if (context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Viruses")) {
283 for (
const CBioSource* biosrc : context.GetBiosources()) {
284 bool has_collection_date =
false;
285 bool has_country =
false;
286 bool has_specific_host =
false;
287 if (biosrc->IsSetSubtype()) {
288 for (
const auto& it : biosrc->GetSubtype()) {
289 if (it->IsSetSubtype()) {
291 has_collection_date =
true;
296 if (has_collection_date && has_country) {
302 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
303 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
305 has_specific_host =
true;
309 if (!has_collection_date || !has_country || !has_specific_host) {
310 if (!has_collection_date) {
311 m_Objs[
kMissingViralQualsTop][
"[n] virus organism[s] [is] missing suggested qualifier collection date"].Ext().Add(*context.BiosourceObjRef(*biosrc));
314 m_Objs[
kMissingViralQualsTop][
"[n] virus organism[s] [is] missing suggested qualifier country"].Ext().Add(*context.BiosourceObjRef(*biosrc));
316 if (!has_specific_host) {
317 m_Objs[
kMissingViralQualsTop][
"[n] virus organism[s] [is] missing suggested qualifier specific-host"].Ext().Add(*context.BiosourceObjRef(*biosrc));
333 for (
const auto& m : mods) {
335 string cmp = m->GetSubname().substr(5);
338 if (pos != string::npos) {
357 for (
const auto& m : mods) {
359 string cmp = m->GetSubname().substr(5);
362 if (pos != string::npos) {
377 for (
const CBioSource* biosrc : context.GetBiosources()) {
378 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
380 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
381 if (m->IsSetSubtype() && m->IsSetSubname()) {
393 m_Objs[
"[n] biosource[s] [has] conflicting ATCC strain and culture collection values"].Add(*context.BiosourceObjRef(*biosrc,
true));
407 if (m->IsSetSubtype() && m->IsSetSubname()) {
410 add.push_back(
"ATCC:" + m->GetSubname());
415 for (
const string& s : add) {
417 src.
SetOrg().SetOrgname().SetMod().push_back(m);
428 const CSeqdesc* desc =
dynamic_cast<const CSeqdesc*
>(context.FindObject(*obj));
451 const CSeqdesc* src = context.GetBiosource();
452 if (context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Bacteria") || context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Archaea")) {
453 for (
const CBioSource* biosrc : context.GetBiosources()) {
454 bool has_bad_isolate =
false;
455 bool is_metagenomic =
false;
456 bool is_env_sample =
false;
457 if (biosrc->IsSetSubtype()) {
458 for (
const auto& s : biosrc->GetSubtype()) {
459 if (s->IsSetSubtype()) {
461 is_env_sample =
true;
462 if (is_metagenomic && is_env_sample) {
467 is_metagenomic =
true;
468 if (is_metagenomic && is_env_sample) {
478 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
479 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
480 if (m->IsSetSubtype()) {
488 has_bad_isolate =
true;
493 if (has_bad_isolate) {
494 m_Objs[
"[n] bacterial biosource[s] [has] isolate"].Add(*context.BiosourceObjRef(*biosrc));
505 const CSeqdesc* src = context.GetBiosource();
506 if (context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Bacteria") || context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Archaea")) {
507 for (
const CBioSource* biosrc : context.GetBiosources()) {
508 bool is_metagenomic =
false;
509 bool is_env_sample =
false;
510 if (biosrc->IsSetSubtype()) {
511 for (
const auto& s : biosrc->GetSubtype()) {
512 if (s->IsSetSubtype()) {
514 is_env_sample =
true;
517 is_metagenomic =
true;
522 if (is_metagenomic && is_env_sample && biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
523 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
525 m_Objs[
"[n] organism[s] assembled from metagenome [has] strain"].Add(*context.BiosourceObjRef(*biosrc));
539 const CSeqdesc* src = context.GetBiosource();
540 if (context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Bacteria") || context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Archaea")) {
541 for (
const CBioSource* biosrc : context.GetBiosources()) {
542 bool is_metagenomic =
false;
543 bool is_env_sample =
false;
544 bool has_isolate =
false;
545 if (biosrc->IsSetSubtype()) {
546 for (
const auto& s : biosrc->GetSubtype()) {
547 if (s->IsSetSubtype()) {
549 is_env_sample =
true;
552 is_metagenomic =
true;
557 if (!is_metagenomic || !is_env_sample) {
560 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
561 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
569 m_Objs[
"[n] organism[s] assembled from metagenome [is] missing isolate"].Add(*context.BiosourceObjRef(*biosrc));
580 for (
const CBioSource* biosrc : context.GetBiosources()) {
581 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
583 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
590 m_Objs[
"[n] organism[s] [has] comma or semicolon in strain or isolate"].Add(*context.BiosourceObjRef(*biosrc));
601 for (
const CBioSource* biosrc : context.GetBiosources()) {
602 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
604 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
607 m_Objs[
"[n] organism[s] [has] multiple culture-collection qualifiers"].Add(*context.BiosourceObjRef(*biosrc));
622 const CSeqdesc* src = context.GetBiosource();
623 if (context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Bacteria") || context.HasLineage(src ? &src->
GetSource() :
nullptr,
"Archaea")) {
624 for (
const CBioSource* biosrc : context.GetBiosources()) {
625 if (biosrc->IsSetSubtype()) {
626 bool is_metagenomic =
false;
627 bool is_env_sample =
false;
628 for (
const auto& s : biosrc->GetSubtype()) {
629 if (s->IsSetSubtype()) {
631 is_env_sample =
true;
632 if (is_metagenomic) {
637 is_metagenomic =
true;
644 if (is_metagenomic && is_env_sample) {
648 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
650 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
660 m_Objs[
"[n] biosource[s] [is] missing required strain value"].Add(*context.BiosourceObjRef(*biosrc));
672 while (
i <
a.length() && j <
b.length()) {
673 while (
i <
a.length() && (
a[
i] ==
':' ||
a[
i] ==
' '))
i++;
674 while (j <
b.length() && (
b[j] ==
':' ||
b[j] ==
' ')) j++;
675 if (
i ==
a.length()) {
676 return j ==
b.length();
678 if (j ==
b.length() ||
a[
i] !=
b[j]) {
690 for (
const CBioSource* biosrc : context.GetBiosources()) {
691 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
692 vector<const COrgMod*> OrgMods;
693 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
694 OrgMods.push_back(&*m);
697 bool conflict =
false;
698 for (
size_t i = 0;
i < OrgMods.size();
i++) {
700 for (
size_t j =
i + 1; j < OrgMods.size(); j++) {
716 if (conflict && !
match) {
717 m_Objs[
"[n] organism[s] [has] conflicting strain and culture-collection values"].Add(*context.BiosourceObjRef(*biosrc));
728 for (
const CBioSource* biosrc : context.GetBiosources()) {
729 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetTaxname()) {
730 const string& s = biosrc->GetOrg().GetTaxname();
731 if (s.length() > 4 && s.substr(s.length() - 4) ==
" sp." && s.substr(0, 11) !=
"uncultured ") {
732 m_Objs[
"[n] biosource[s] [has] taxname[s] that end[S] with \' sp.\' but [does] not start with \'uncultured\'"].Add(*context.BiosourceObjRef(*biosrc));
743 const CSeqdesc* biosrc = context.GetBiosource();
745 bool strand_plus =
false;
746 bool strand_minus =
false;
747 for (
const auto& feat : context.FeatTRNAs()) {
754 if (strand_plus && strand_minus) {
758 for (
const auto& feat : context.FeatTRNAs()) {
759 m_Objs[strand_plus ?
"[n] tRNA[s] on plus strand" :
"[n] tRNA[s] on minus strand"].Add(*context.SeqFeatObjRef(*feat));
794 bool has_clone =
false;
796 for (
const auto& subtype_it : biosource.
GetSubtype()) {
797 if (subtype_it->IsSetSubtype()) {
808 if (needs_clone && !has_clone) {
810 bool has_gel_band_isolate =
false;
815 has_gel_band_isolate =
true;
821 if (has_gel_band_isolate) {
825 return (needs_clone && !has_clone);
831 for (
const CBioSource* biosrc : context.GetBiosources()) {
833 m_Objs[
"[n] biosource[s] [is] missing required clone value"].Add(*context.BiosourceObjRef(*biosrc));
843 for (
const CBioSource* biosrc : context.GetBiosources()) {
844 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
845 for (
const auto&
om : biosrc->GetOrg().GetOrgname().GetMod()) {
847 const string strain =
om->GetSubname();
848 if (!strain.empty()) {
849 m_Objs[strain][biosrc->GetOrg().IsSetTaxname() ? biosrc->GetOrg().GetTaxname() :
""].Add(*context.BiosourceObjRef(*biosrc));
861 static const string root =
"[n] biosources have strain/taxname conflicts";
862 for (
auto& it: m_Objs.GetMap()) {
863 if (it.second->GetMap().size() > 1) {
864 for (
auto& mm: it.second->GetMap()) {
865 for (
auto& obj : mm.second->GetObjects()) {
866 string label =
"[n] biosources have strain [(]" + it.first +
"[)] but do not have the same taxnames";
867 rep[
"[n] biosources have strain/taxname conflicts"][
label].
Ext().
Add(*obj);
881 for (
const CBioSource* biosrc : context.GetBiosources()) {
882 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
883 for (
const auto&
om : biosrc->GetOrg().GetOrgname().GetMod()) {
885 const string strain =
om->GetSubname();
886 if (!strain.empty()) {
887 m_Objs[strain][biosrc->GetOrg().IsSetTaxname() ? biosrc->GetOrg().GetTaxname() :
""].Add(*context.BiosourceObjRef(*biosrc));
899 for (
auto& it: m_Objs.GetMap()) {
900 if (it.second->GetMap().size() > 1) {
901 for (
auto& mm: it.second->GetMap()) {
902 for (
auto& obj: mm.second->GetObjects()) {
903 string label =
"[n] biosources have specimen voucher [(]" + it.first +
"[)] but do not have the same taxnames";
904 rep[
"[n] biosources have specimen voucher/taxname conflicts"][
label].
Ext().
Add(*obj);
918 for (
const CBioSource* biosrc : context.GetBiosources()) {
919 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
920 for (
const auto&
om : biosrc->GetOrg().GetOrgname().GetMod()) {
922 const string strain =
om->GetSubname();
923 if (!strain.empty()) {
924 m_Objs[strain][biosrc->GetOrg().IsSetTaxname() ? biosrc->GetOrg().GetTaxname() :
""].Add(*context.BiosourceObjRef(*biosrc));
936 for (
auto& it : m_Objs.GetMap()) {
937 if (it.second->GetMap().size() > 1) {
938 for (
auto& mm : it.second->GetMap()) {
939 for (
auto& obj : mm.second->GetObjects()) {
940 string label =
"[n] biosources have culture collection " + it.first +
" but do not have the same taxnames";
941 rep[
"[n] biosources have culture collection/taxname conflicts"][
label].
Ext().
Add(*obj);
955 for (
const CBioSource* biosrc : context.GetBiosources()) {
956 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
957 for (
const auto&
om : biosrc->GetOrg().GetOrgname().GetMod()) {
959 const string strain =
om->GetSubname();
960 if (!strain.empty()) {
961 m_Objs[strain][biosrc->GetOrg().IsSetTaxname() ? biosrc->GetOrg().GetTaxname() :
""].Add(*context.BiosourceObjRef(*biosrc));
974 for (
auto& it : m_Objs.GetMap()) {
975 if (it.second->GetMap().size() > 1) {
976 for (
auto& mm : it.second->GetMap()) {
977 for (
auto& obj : mm.second->GetObjects()) {
978 string label =
"[n] biosources have biomaterial " + it.first +
" but do not have the same taxnames";
979 rep[
"[n] biosources have biomaterial/taxname conflicts"][
label].
Ext().
Add(*obj);
994 static const vector<string> suspectable_products = {
996 "5.8S ribosomal RNA",
999 "internal transcribed spacer 1",
1000 "internal transcribed spacer 2"
1002 static const string msg =
"[n] Bioseq[s] [has] suspect rRNA / ITS on organelle";
1003 const CSeqdesc* src = context.GetBiosource();
1010 for (
const CSeq_feat& feat : context.GetFeat()) {
1011 if (feat.IsSetData() && feat.GetData().IsRna()) {
1014 const string& product =
rna.GetRnaProductName();
1017 if (!product.empty()) {
1018 for (
const string& pattern : suspectable_products) {
1020 m_Objs[msg].Add(*context.BioseqObjRef());
1025 if (feat.IsSetComment()) {
1026 const string& comment = feat.GetComment();
1029 if (!comment.empty()) {
1030 for (
const string& pattern : suspectable_products) {
1032 m_Objs[msg].Add(*context.BioseqObjRef());
1059 int first_val = (
first.*is_set_fn)() ? (
first.*get_fn)() : not_set,
1060 second_val = (second.*is_set_fn)() ? (second.*get_fn)() : not_set;
1062 return first_val == second_val;
1067 const R& first_val = (
first.*is_set_fn)() ? (
first.*get_fn)() : empty_val,
1068 & second_val = (second.*is_set_fn)() ? (second.*get_fn)() : empty_val;
1070 return first_val == second_val;
1076 if (
first.size() != second.size()) {
1080 for (CBioSource::TSubtype::const_iterator it_first =
first.cbegin(), it_second = second.cbegin();
1081 it_first !=
first.cend();
1082 ++it_first, ++it_second) {
1102 if (
first.size() != second.size()) {
1106 for (COrg_ref::TDb::const_iterator it_first =
first.cbegin(), it_second = second.cbegin();
1107 it_first !=
first.cend();
1108 ++it_first, ++it_second) {
1110 if (!(*it_first)->Equals(**it_second)) {
1120 bool first_name_set =
first.IsSetName(),
1123 if (first_name_set != second_name_set || (first_name_set &&
first.GetName().Which() != second.
GetName().
Which())) {
1124 diffs.push_back(
"orgname choices differ");
1128 diffs.push_back(
"genetic codes differ");
1133 diffs.push_back(
"mitochondrial genetic codes differ");
1138 diffs.push_back(
"attributes differ");
1142 diffs.push_back(
"lineages differ");
1146 diffs.push_back(
"divisions differ");
1149 bool first_mod_set =
first.IsSetMod(),
1150 second_mod_set = second.
IsSetMod();
1152 COrgName::TMod::const_iterator it_first, it_second;
1153 if (first_mod_set) {
1154 it_first =
first.GetMod().cbegin();
1156 if (second_mod_set) {
1157 it_second = second.
GetMod().cbegin();
1159 if (first_mod_set && second_mod_set) {
1160 COrgName::TMod::const_iterator end_first =
first.GetMod().cend(),
1161 end_second = second.
GetMod().cend();
1163 for (; it_first != end_first && it_second != end_second; ++it_first, ++it_second) {
1165 const string& qual = (*it_first)->IsSetSubtype() ?
COrgMod::ENUM_METHOD_NAME(ESubtype)()->FindName((*it_first)->GetSubtype(),
true) :
"Unknown source qualifier";
1168 diffs.push_back(
"missing " + qual +
" modifier");
1172 diffs.push_back(qual +
" modifier attrib values differ");
1176 diffs.push_back(
"different " + qual +
" values");
1180 if (it_first == end_first) {
1181 first_mod_set =
false;
1183 if (it_second == end_second) {
1184 second_mod_set =
false;
1188 if (first_mod_set && !second_mod_set) {
1189 const string& qual = (*it_first)->IsSetSubtype() ?
ENUM_METHOD_NAME(
ESource_qual)()->FindName((*it_first)->GetSubtype(),
true) :
"Unknown source qualifier";
1190 diffs.push_back(
"missing " + qual +
" modifier");
1192 else if (!first_mod_set && second_mod_set) {
1193 const string& qual = (*it_second)->IsSetSubtype() ?
ENUM_METHOD_NAME(
ESource_qual)()->FindName((*it_second)->GetSubtype(),
true) :
"Unknown source qualifier";
1194 diffs.push_back(
"missing " + qual +
" modifier");
1201 diffs.push_back(
"taxnames differ");
1205 diffs.push_back(
"common names differ");
1209 diffs.push_back(
"synonyms differ");
1212 bool first_db_set = first_org.
IsSetDb(),
1213 second_db_set = second_org.
IsSetDb();
1215 if (first_db_set != second_db_set || (first_db_set && !
IsSameDb(first_org.
GetDb(), second_org.
GetDb()))) {
1216 diffs.push_back(
"dbxrefs differ");
1222 if (first_orgname_set != second_orgname_set) {
1223 diffs.push_back(
"one Orgname is missing");
1225 else if (first_orgname_set && second_orgname_set) {
1234 diffs.push_back(
"origins differ");
1238 diffs.push_back(
"focus differs");
1242 diffs.push_back(
"locations differ");
1250 diffs.push_back(
"subsource qualifiers differ");
1253 bool first_org_set = first_biosrc.
IsSetOrg(),
1254 second_org_set = second_biosrc.
IsSetOrg();
1256 if (first_org_set != second_org_set) {
1257 diffs.push_back(
"one OrgRef is missing");
1259 else if (first_org_set && second_org_set) {
1267 const CBioseq& bioseq = context.CurrentBioseq();
1268 if (bioseq.
IsNa()) {
1269 const CSeqdesc* biosrc = context.GetBiosource();
1273 auto& node = m_Objs[ss.str()];
1274 node.Add(*context.SeqdescObjRef(*biosrc));
1275 node.Add(*context.BioseqObjRef());
1283 auto& M = m_Objs.GetMap();
1285 for (
auto a = M.cbegin();
a != M.cend(); ++
a) {
1286 stringstream ss_a(
a->first);
1290 for (++
b;
b != M.cend(); ++
b) {
1291 stringstream ss_b(
b->first);
1296 if (!diffs.empty()) {
1297 subtype =
"[n/2] inconsistent contig source[s][(] (" +
NStr::Join(diffs,
", ") +
")";
1301 if (!subtype.empty()) {
1305 if (!subtype.empty()) {
1307 size_t subcat_index = 0;
1308 static size_t MAX_NUM_LEN = 10;
1309 for (
auto& it : M) {
1311 subcat_num =
string(MAX_NUM_LEN - subcat_num.size(),
'0') + subcat_num;
1312 string subcat =
"[*" + subcat_num +
"*][n/2] contig[s] [has] identical sources that do not match another contig source";
1314 rep[subtype][subcat].
Ext().
Add(it.second->GetObjects());
1325 for (
const CBioSource* biosrc : context.GetBiosources()) {
1326 if (biosrc->IsSetOrg()) {
1329 m_Objs[ss.str()].Add(*context.BiosourceObjRef(*biosrc));
1338 for (
const auto& db : org.
GetDb()) {
1351 if (first_set != second_set || (first_set &&
first.GetTaxname() != second.
GetTaxname())) {
1356 if (first_db_tag ==
nullptr || second_db_tag ==
nullptr) {
1359 return !first_db_tag->
Equals(*second_db_tag);
1373 if (!m_Objs.empty()) {
1375 vector<CRef<COrg_ref>> org_refs;
1376 for (
auto& it : m_Objs.GetMap()) {
1378 stringstream ss(it.first);
1380 org_refs.push_back(oref);
1384 const auto& replies = reply->GetReply();
1385 auto rit = replies.cbegin();
1386 for (
auto& it : m_Objs.GetMap()) {
1388 stringstream ss(it.first);
1390 if ((*rit)->IsData() &&
OrgDiffers(*oref, (*rit)->GetData().GetOrg())) {
1391 rep[
"[n] tax name[s] [does] not match taxonomy lookup"].
Add(it.second->GetObjects());
1405 for (
const CBioSource* biosrc : context.GetBiosources()) {
1406 if (biosrc->IsSetOrg()) {
1409 m_Objs[ss.str()].Add(*context.BiosourceObjRef(*biosrc));
1417 if (!m_Objs.empty()) {
1419 vector<CRef<COrg_ref>> org_refs;
1420 for (
auto& it : m_Objs.GetMap()) {
1422 stringstream ss(it.first);
1424 org_refs.push_back(oref);
1428 const auto& replies = reply->GetReply();
1429 auto rit = replies.cbegin();
1430 for (
auto& it : m_Objs.GetMap()) {
1431 if (!(*rit)->IsData() || (*rit)->IsError()) {
1432 rep[
"[n] tax name[s] [is] missing in taxonomy lookup"].
Add(it.second->GetObjects());
1446 for (
const CBioSource* biosrc : context.GetBiosources()) {
1447 if (biosrc->IsSetSubtype()) {
1450 for (
const auto& subtype : biosrc->GetSubtype()) {
1451 if (subtype->IsSetSubtype()) {
1466 if (found && !skip) {
1467 if (biosrc->IsSetOrg()) {
1468 if (biosrc->GetOrg().IsSetTaxname()) {
1469 const string& s = biosrc->GetOrg().GetTaxname();
1475 if (biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
1476 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
1485 m_Objs[
"[n] biosource[s] [has] unnecessary environmental qualifier"].Add(*context.BiosourceObjRef(*biosrc));
1497 for (
const CBioSource* biosrc : context.GetBiosources()) {
1498 if (biosrc->IsSetSubtype()) {
1499 for (
const auto& subtype : biosrc->GetSubtype()) {
1501 const string& s = subtype->GetName();
1502 if (s.length() && s[s.length() - 1] ==
':') {
1503 m_Objs[
"[n] country source[s] end[S] with a colon."].Add(*context.BiosourceObjRef(*biosrc,
true));
1518 for (
const auto& subtype : src.
GetSubtype()) {
1522 while (s.length() && s[s.length()-1] ==
':') {
1523 s.resize(s.length()-1);
1535 const CSeqdesc* desc =
dynamic_cast<const CSeqdesc*
>(context.FindObject(*obj));
1556 for (
const CBioSource* biosrc : context.GetBiosources()) {
1557 if (biosrc->IsSetSubtype()) {
1558 for (
const auto& subtype : biosrc->GetSubtype()) {
1560 const string& s = subtype->GetName();
1562 for (
size_t i = 0;
i < s.length();
i++) {
1566 m_Objs[
"[n] country source[s] [has] more than 1 colon."].Add(*context.BiosourceObjRef(*biosrc,
true));
1584 for (
const auto& subtype : src.
GetSubtype()) {
1589 for (
size_t i = 0;
i < s.length();
i++) {
1607 const CSeqdesc* desc =
dynamic_cast<const CSeqdesc*
>(context.FindObject(*obj));
1628 for (
const CBioSource* biosrc : context.GetBiosources()) {
1629 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetOrgname() && biosrc->GetOrg().GetOrgname().CanGetMod()) {
1630 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
1632 m_Objs[
"[n] organism[s] [has] \'human\' host qualifiers"].Add(*context.BiosourceObjRef(*biosrc,
true));
1660 const CSeqdesc* desc =
dynamic_cast<const CSeqdesc*
>(context.FindObject(*obj));
1681 for (
const CBioSource* biosrc : context.GetBiosources()) {
1682 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetOrgname() && biosrc->GetOrg().GetOrgname().CanGetMod() && biosrc->GetOrg().CanGetTaxname() && biosrc->GetOrg().GetTaxname().length()) {
1684 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
1687 list<CTempString>
tmp;
1689 list<CTempString>::const_iterator p =
tmp.cbegin();
1690 if (p !=
tmp.cend()) {
1693 if (p !=
tmp.cend()) {
1699 list<CTempString>
tmp;
1701 list<CTempString>::const_iterator p =
tmp.cbegin();
1702 if (p !=
tmp.cend()) {
1705 if (p !=
tmp.cend()) {
1709 if (aut1 !=
tax1 || aut2 != tax2) {
1710 m_Objs[
"[n] biosource[s] [has] taxname/authority conflict"].Add(*context.BiosourceObjRef(*biosrc));
1736 if (it->CanGetSubtype() && it->GetSubtype() == qual) {
1737 return it->GetSubname();
1747 for (
const CBioSource* biosrc : context.GetBiosources()) {
1749 const string& taxname = biosrc->GetOrg().GetTaxname();
1754 if (taxname[
n] !=
' ') {
1758 if (
n < taxname.length()) {
1760 string s = taxname.substr(
n, q.length());
1762 m_Objs[
"[n] trinomial source[s] lack[S] corresponding qualifier"].Add(*context.BiosourceObjRef(*biosrc));
1777 for (
const CBioSource* biosrc : context.GetBiosources()) {
1779 bool has_primer_note =
false;
1780 if (biosrc->CanGetSubtype()) {
1781 for (
const auto& it : biosrc->GetSubtype()) {
1783 has_primer_note =
true;
1788 if (!has_primer_note && biosrc->IsSetOrg() && biosrc->GetOrg().CanGetOrgname() && biosrc->GetOrg().GetOrgname().CanGetMod()) {
1789 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
1791 has_primer_note =
true;
1796 if (has_primer_note) {
1797 m_Objs[
"[n] biosource[s] [has] \'amplified with species-specific primers\' note but no environmental-sample qualifier."].Add(*context.BiosourceObjRef(*biosrc,
true));
1806 bool change =
false;
1813 const string orig = s->GetName();
1814 NStr::ReplaceInPlace(s->SetName(),
"[amplified with species-specific primers",
"amplified with species-specific primers");
1815 NStr::ReplaceInPlace(s->SetName(),
"amplified with species-specific primers]",
"amplified with species-specific primers");
1830 const CSeqdesc* desc =
dynamic_cast<const CSeqdesc*
>(context.FindObject(*obj));
1834 return CRef<CAutofixReport>(
new CAutofixReport(
"AMPLIFIED_PRIMERS_NO_ENVIRONMENTAL_SAMPLE: Set environmental_sample, fixed amplified primers note for [n] source[s]", 1));
1840 return CRef<CAutofixReport>(
new CAutofixReport(
"AMPLIFIED_PRIMERS_NO_ENVIRONMENTAL_SAMPLE: Set environmental_sample, fixed amplified primers note for [n] source[s]", 1));
1851 for (
const CBioSource* biosrc : context.GetBiosources()) {
1852 if (biosrc->CanGetPcr_primers() && biosrc->GetPcr_primers().CanGet()) {
1853 bool report =
false;
1854 for (
const auto& pr : biosrc->GetPcr_primers().Get()) {
1855 if (pr->CanGetForward() != pr->CanGetReverse()) {
1859 if (pr->CanGetForward()) {
1862 CPCRPrimerSet::Tdata::const_iterator fwd = fwdset.
Get().cbegin();
1863 CPCRPrimerSet::Tdata::const_iterator rev = revset.
Get().cbegin();
1864 while (fwd != fwdset.
Get().cend() && rev != revset.
Get().cend()) {
1865 if (((*fwd)->CanGetName() && !(*fwd)->GetName().Get().empty()) != ((*rev)->CanGetName() && !(*rev)->GetName().Get().empty()) || ((*fwd)->CanGetSeq() && !(*fwd)->GetSeq().Get().empty()) != ((*rev)->CanGetSeq() && !(*rev)->GetSeq().Get().empty())) {
1878 m_Objs[
"[n] biosource[s] [has] primer set[s] with missing values"].Add(*context.BiosourceObjRef(*biosrc));
1889 size_t count_a =
a.size();
1890 size_t count_b =
b.size();
1891 if (count_a != count_b) {
1894 for (CPCRPrimerSet::Tdata::const_iterator it =
a.cbegin(); it !=
a.cend(); it++) {
1895 CPCRPrimerSet::Tdata::const_iterator jt =
b.cbegin();
1896 for (; jt !=
b.cend(); jt++) {
1897 if ((*it)->CanGetName() == (*jt)->CanGetName() && (*it)->CanGetSeq() == (*jt)->CanGetSeq()
1898 && (!(*it)->CanGetName() || (*it)->GetName().Get() == (*jt)->GetName().Get())
1899 && (!(*it)->CanGetSeq() || (*it)->GetSeq().Get() == (*jt)->GetSeq().Get())) {
1903 if (jt ==
b.cend()) {
1913 return a.CanGetForward() ==
b.CanGetForward() &&
a.CanGetReverse() ==
b.CanGetReverse()
1914 && (!
a.CanGetForward() ||
EqualPrimerSets(
a.GetForward().Get(),
b.GetForward().Get()))
1915 && (!
a.CanGetReverse() ||
EqualPrimerSets(
a.GetReverse().Get(),
b.GetReverse().Get()));
1921 for (
const CBioSource* biosrc : context.GetBiosources()) {
1922 if (biosrc->CanGetPcr_primers() && biosrc->GetPcr_primers().CanGet()) {
1925 for (CPCRReactionSet::Tdata::const_iterator it = data.cbegin(); !
done && it != data.cend(); it++) {
1926 CPCRReactionSet::Tdata::const_iterator jt = it;
1927 for (jt++; !
done && jt != data.cend(); jt++) {
1929 m_Objs[
"[n] BioSource[s] [has] duplicate primer pairs."].Add(*context.BiosourceObjRef(*biosrc));
1944 for (
const CBioSource* biosrc : context.GetBiosources()) {
1945 if (biosrc->CanGetSubtype()) {
1946 for (
const auto& it : biosrc->GetSubtype()) {
1948 m_Objs[
"[n] biosource[s] [has] metagenomic qualifier"].Add(*context.BiosourceObjRef(*biosrc));
1961 for (
const CBioSource* biosrc : context.GetBiosources()) {
1962 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetOrgname() && biosrc->GetOrg().GetOrgname().CanGetMod() && biosrc->GetOrg().IsSetTaxname() && !biosrc->GetOrg().GetTaxname().empty()) {
1963 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
1965 m_Objs[
"[n] biosource[s] [has] metagenome_source qualifier"].Add(*context.BiosourceObjRef(*biosrc));
1990 static const char*
kDupSrc =
"[n] source[s] [has] two or more qualifiers with the same value";
1994 "DUP_SRC_QUAL_DATA")
1996 for (
const CBioSource* biosrc : context.GetBiosources()) {
1998 string collected_by;
1999 string identified_by;
2000 if (biosrc->CanGetSubtype()) {
2001 for (
const auto& it : biosrc->GetSubtype()) {
2002 if (it->CanGetName()) {
2003 const string& s = it->GetName();
2004 if (it->CanGetSubtype()) {
2018 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetOrgname() && biosrc->GetOrg().GetOrgname().CanGetMod()) {
2019 for (
const auto& it : biosrc->GetOrg().GetOrgname().GetMod()) {
2020 if (it->IsSetSubname()) {
2021 const string& s = it->GetSubname();
2022 if (it->CanGetSubtype()) {
2036 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetTaxname()) {
2037 const string& s = biosrc->GetOrg().GetTaxname();
2039 Map[s].push_back(
"organism");
2042 if (biosrc->CanGetPcr_primers()) {
2043 for (
const auto& it : biosrc->GetPcr_primers().Get()) {
2044 if (it->CanGetForward()) {
2045 for (
const auto& pr : it->GetForward().Get()) {
2046 if (pr->CanGetName()) {
2047 Map[pr->GetName()].push_back(
"fwd-primer-name");
2049 if (pr->CanGetSeq()) {
2050 Map[pr->GetSeq()].push_back(
"fwd-primer-seq");
2054 if (it->CanGetReverse()) {
2055 for (
const auto& pr : it->GetReverse().Get()) {
2056 if (pr->CanGetName()) {
2057 Map[pr->GetName()].push_back(
"rev-primer-name");
2059 if (pr->CanGetSeq()) {
2060 Map[pr->GetSeq()].push_back(
"rev-primer-seq");
2067 for (
const auto& it :
Map) {
2068 if (it.second.size() > 1) {
2069 if (it.second.size() == 2 && it.first == collected_by && collected_by == identified_by) {
2072 string s =
"[n] biosource[s] [has] value\'";
2074 s +=
"\' for these qualifiers: ";
2075 for (
size_t i = 0;
i < it.second.size();
i++) {
2081 m_Objs[
kDupSrc][s].Add(*context.BiosourceObjRef(*biosrc));
2096 const CSeqdesc* biosrc = context.GetBiosource();
2097 if (context.HasLineage(biosrc ? &biosrc->
GetSource() :
nullptr,
"Microsporidia")) {
2098 bool has_unusual =
false;
2099 for (
const CSeq_feat& feat : context.GetFeat()) {
2100 if (feat.IsSetComment() && feat.IsSetData() && feat.GetData().IsRna()) {
2111 m_Objs[
"[n] Bioseq[s] [has] unusual rRNA / ITS"].Add(*context.BioseqObjRef());
2119 #define SARS_TAX_ID 2697049
2123 for (
const CBioSource* biosrc : context.GetBiosources()) {
2124 if (biosrc->IsSetOrg() && biosrc->GetOrg().CanGetDb()) {
2126 for (
const auto& db : biosrc->GetOrg().GetDb()) {
2127 if (db->CanGetTag() && db->GetTag().IsId() && db->GetTag().GetId() ==
SARS_TAX_ID && db->CanGetDb() && db->GetDb() ==
"taxon") {
2135 if (biosrc->IsSetOrg() && biosrc->GetOrg().IsSetOrgname() && biosrc->GetOrg().GetOrgname().IsSetMod()) {
2136 for (
const auto& m : biosrc->GetOrg().GetOrgname().GetMod()) {
2138 isolate = m->GetSubname();
2143 if (!isolate.length()) {
2144 isolate =
"no isolate";
2147 if (good && isolate.find(
"SARS-CoV-2") != 0) {
2154 if (
arr.size() == 5) {
2162 string date, date0, date1;
2163 if (biosrc->IsSetSubtype()) {
2164 for (
const auto& it : biosrc->GetSubtype()) {
2166 date = it->GetName();
2171 if (date.length() >= 4) {
2172 date0 = date.substr(0, 4);
2173 date1 = date.substr(date.length() - 4);
2175 good = year == date0 || year == date1;
2178 m_Objs[
"[n] SARS-CoV-2 biosource[s] [has] wrong isolate format"][isolate].Add(*context.BiosourceObjRef(*biosrc));
User-defined methods of the data storage class.
static const CDbtag * GetTaxonTag(const COrg_ref &org)
list< string > TInconsistecyDescriptionList
static bool IsSameDb(const COrg_ref::TDb &first, const COrg_ref::TDb &second)
static bool IsMissingRequiredClone(const CBioSource &biosource)
static bool SetCultureCollectionFromStrain(CBioSource &src)
static bool IsSameSubtype(const CBioSource::TSubtype &first, const CBioSource::TSubtype &second)
static void GetOrgrefDifferences(const COrg_ref &first_org, const COrg_ref &second_org, TInconsistecyDescriptionList &diffs)
static bool MatchExceptSpaceColon(const string &a, const string &b)
const string kAmplifiedWithSpeciesSpecificPrimers
const string kMissingViralQualsTop
static bool SetEnvSampleFixAmplifiedPrimers(CBioSource &src)
static bool FindDuplicatePrimers(const CPCRReaction &a, const CPCRReaction &b)
static void GetBiosourceDifferences(const CBioSource &first_biosrc, const CBioSource &second_biosrc, TInconsistecyDescriptionList &diffs)
static bool ChangeCountryColonToComma(CBioSource &src)
bool HasStrainForATCCCultureCollection(const COrgName::TMod &mods, const string &culture_collection)
static bool EqualPrimerSets(const CPCRPrimerSet::Tdata &a, const CPCRPrimerSet::Tdata &b)
bool HasCultureCollectionForATCCStrain(const COrgName::TMod &mods, const string &strain)
static bool FixHumanHost(CBioSource &src)
static bool OrgDiffers(const COrg_ref &first, const COrg_ref &second)
static CRef< CTaxon3_reply > GetOrgRefs(vector< CRef< COrg_ref >> &orgs)
static const size_t srcqual_keywords_sz
static const char * kDupSrc
static string GetOrgModName(const COrgMod &qual)
static void GetOrgnameDifferences(const COrgName &first, const COrgName &second, TInconsistecyDescriptionList &diffs)
static string GetSubtypeName(const CSubSource &qual)
static string GetSrcQual(const CBioSource &bs, int qual)
bool HasAmplifiedWithSpeciesSpecificPrimerNote(const CBioSource &src)
static const pair< int, string > srcqual_keywords[]
static bool RemoveCountryColon(CBioSource &src)
bool HasSubtype(CSubSource::TSubtype subtype) const
bool(T::* TIsSetFn)() const
int(T::* TGetIntFn)() const
static bool IsEqualVal(const T &first, const T &second, TIsSetFn is_set_fn, TGetRFn get_fn, const R &empty_val)
const R &(T::* TGetRFn)() const
static bool IsEqualInt(const T &first, const T &second, TIsSetFn is_set_fn, TGetIntFn get_fn, int not_set)
static bool HasLineage(const CBioSource &biosrc, const string &def_lineage, const string &type)
@OrgMod.hpp User-defined methods of the data storage class.
static string GetSubtypeName(TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
bool IsSetOrgMod(void) const
@RNA_ref.hpp User-defined methods of the data storage class.
virtual vector< CRef< CReportItem > > GetSubitems() const =0
static void Add(TReportObjectList &list, TReportObjectSet &hash, CReportObj &obj, bool unique=true)
CReportNode & Ext(bool b=true)
CRef< CReportItem > Export(CDiscrepancyCore &test, bool unique=true) const
CSeq_feat_EditHandle –.
namespace ncbi::objects::
static bool HasCultureNotes(const string &value)
static string GetSubtypeName(CSubSource::TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
static CRef< CDate > DateFromCollectionDate(const string &str) THROWS((CException))
virtual CRef< CTaxon3_reply > SendOrgRefList(const vector< CRef< COrg_ref > > &list, COrg_ref::fOrgref_parts result_parts=COrg_ref::eOrgref_default, fT3reply_parts t3result_parts=eT3reply_default)
static vector< string > arr
vector< CRef< CReportObj > > TReportObjectList
#define DISCREPANCY_AUTOFIX(name)
#define DISCREPANCY_CASE1(name, type, group, descr,...)
#define DISCREPANCY_CASE(name, type, group, descr)
#define DISCREPANCY_SUMMARIZE(name)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
CRange< Position > Map(const CRange< Position > &target, const CRange< Position > &range)
constexpr size_t ArraySize(const Element(&)[Size])
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnBinary
#define ENUM_METHOD_NAME(EnumName)
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
bool IsMatch(CTempString str, TMatch flags=fMatch_default)
Check existence substring which match a specified pattern.
#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 > & SplitByPattern(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Variation of Split() with fSplit_ByPattern flag applied by default.
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
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 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 spaces 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 string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
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.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a 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.
TGenome GetGenome(void) const
Get the Genome member data.
TOrigin GetOrigin(void) const
Get the Origin member data.
const Tdata & Get(void) const
Get the 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.
const TOrg & GetOrg(void) const
Get the Org member data.
bool IsSetOrigin(void) const
Check if a value has been assigned to Origin data member.
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
TSubtype GetSubtype(void) const
Get the Subtype member data.
bool IsSetGenome(void) const
Check if a value has been assigned to Genome data member.
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
void SetOrg(TOrg &value)
Assign a value to Org data member.
void SetName(const TName &value)
Assign a value to Name data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetAttrib(void) const
attribution/source of this name Check if a value has been assigned to Attrib data member.
bool IsSetIs_focus(void) const
to distinguish biological focus Check if a value has been assigned to Is_focus data member.
list< CRef< CPCRReaction > > Tdata
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
list< CRef< CPCRPrimer > > Tdata
@ eSubtype_collection_date
DD-MMM-YYYY format.
@ eSubtype_collected_by
name of person who collected the sample
@ eSubtype_environmental_sample
@ eSubtype_identified_by
name of person who identified the sample
bool IsSetYear(void) const
full year (including 1900) Check if a value has been assigned to Year data member.
bool IsStd(void) const
Check if variant Std is selected.
TYear GetYear(void) const
Get the Year member data.
const TStd & GetStd(void) const
Get the variant data.
ESource_qual
Access to ESource_qual's attributes (values, names) as defined in spec.
const TMod & GetMod(void) const
Get the Mod member data.
bool CanGetMod(void) const
Check if it is safe to call GetMod method.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
const TLineage & GetLineage(void) const
Get the Lineage member data.
TSubtype GetSubtype(void) const
Get the Subtype member data.
const TDiv & GetDiv(void) const
Get the Div member data.
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
TMgcode GetMgcode(void) const
Get the Mgcode member data.
E_Choice Which(void) const
Which variant is currently selected.
TGcode GetGcode(void) const
Get the Gcode member data.
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
const TSubname & GetSubname(void) const
Get the Subname member data.
bool IsSetCommon(void) const
common name Check if a value has been assigned to Common data member.
bool IsSetLineage(void) const
lineage with semicolon separators Check if a value has been assigned to Lineage data member.
vector< CRef< CDbtag > > TDb
const TName & GetName(void) const
Get the Name member data.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
bool IsSetMgcode(void) const
mitochondrial genetic code Check if a value has been assigned to Mgcode data member.
const TCommon & GetCommon(void) const
Get the Common member data.
const TDb & GetDb(void) const
Get the Db member data.
const TSyn & GetSyn(void) const
Get the Syn member data.
bool IsSetDiv(void) const
GenBank division code Check if a value has been assigned to Div data member.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
list< CRef< COrgMod > > TMod
bool IsSetAttrib(void) const
attribution of name Check if a value has been assigned to Attrib data member.
bool CanGetOrgname(void) const
Check if it is safe to call GetOrgname method.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
bool IsSetSubname(void) const
Check if a value has been assigned to Subname data member.
bool IsSetTaxname(void) const
preferred formal name Check if a value has been assigned to Taxname data member.
bool IsSetAttrib(void) const
attribution/source of name Check if a value has been assigned to Attrib data member.
bool IsSetGcode(void) const
genetic code (see CdRegion) Check if a value has been assigned to Gcode data member.
bool IsSetSyn(void) const
synonyms for taxname or common Check if a value has been assigned to Syn data member.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
@ eSubtype_gb_acronym
used by taxonomy database
@ eSubtype_gb_synonym
used by taxonomy database
@ eSubtype_other
ASN5: old-name (254) will be added to next spec.
@ eSubtype_nat_host
natural host of this specimen
@ eSubtype_metagenome_source
@ eSubtype_specimen_voucher
@ eSubtype_gb_anamorph
used by taxonomy database
@ eSubtype_culture_collection
@ eSubtype_forma_specialis
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
bool IsBiosrc(void) const
Check if variant Biosrc is selected.
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
TSource & SetSource(void)
Select the variant.
unsigned int
A callback function used to compare two keys in a database.
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
unique_ptr< CLocalTaxon > tax1
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
CRef< objects::CObjectManager > om
C++ wrappers for the Perl-compatible regular expression (PCRE) library.