91 : m_Name (name), m_Required (required), m_ReportMissing (report_missing), m_Example (
example)
117 vector<string> unwise_names;
118 unwise_names.push_back(
"unknown");
119 unwise_names.push_back(
"uncultured organism");
120 unwise_names.push_back(
"uncultured sample");
121 unwise_names.push_back(
"uncultured");
122 unwise_names.push_back(
"unidentified");
124 vector<string>::iterator s = unwise_names.begin();
125 while (s != unwise_names.end()) {
127 return "Ambiguous organism name";
134 return "For uncultured samples, organism name should start with 'uncultured'";
163 if ((*mit)->GetSubtype() ==
m_Subtype && (*mit)->IsSetSubname()) {
164 return (*mit)->GetSubname();
174 bool all_numbers =
true;
178 string::iterator it =
val.begin();
179 while (it !=
val.end() && all_numbers) {
196 rval =
"Invalid host";
228 if ((*mit)->GetSubtype() ==
m_Subtype && (*mit)->IsSetName()) {
229 return (*mit)->GetName();
243 if (
value.length() < 3) {
244 rval =
"Suspiciously short isolation source";
248 rval =
"Invalid isolation source";
256 rval =
"Invalid country";
287 (*rit)->SetRequired(
true);
312 ITERATE(vector<string>, it, list) {
324 va_start ( arguments, num );
325 for (
int x = 0; x < num; x++ ) {
326 string item = va_arg ( arguments,
char * );
328 list.push_back(item );
330 va_end ( arguments );
338 ITERATE(vector<string>, it, list) {
350 va_start ( arguments, num );
351 for (
int x = 0; x < num; x++ ) {
352 string item = va_arg ( arguments,
char * );
354 list.push_back(item );
356 va_end ( arguments );
365 string this_val =
"";
367 for (
i = 0;
i < cols.size();
i++) {
369 if (row < cols[
i]->GetData().GetSize()) {
370 this_val += cols[
i]->GetData().GetString()[row] +
";";
380 int num_duplicates = 0;
382 if (values_table->
GetNum_rows() < 2 || uniqueness_list.size() < 1) {
387 string description = uniqueness_list[0];
388 for (j = 1; j < uniqueness_list.size(); j++) {
389 description +=
"/" + uniqueness_list[j];
392 vector<CRef<CSeqTable_column> > cols;
393 for (j = 0; j < uniqueness_list.size(); j++) {
402 vector<string> u_list;
404 for (row = 0; row < values_table->
GetNum_rows(); row++) {
407 sort(u_list.begin(), u_list.end());
408 vector<string>::iterator sit = u_list.begin();
409 vector<string>::iterator sit2 = sit;
412 while (sit2 != u_list.end()) {
415 sit2 = u_list.erase(sit2);
421 sit = u_list.erase(sit);
426 if (sit2 != u_list.end()) {
432 if (!is_dup && sit != u_list.end()) {
433 sit = u_list.erase(sit);
435 sit = u_list.begin();
436 while (sit != u_list.end()) {
437 bool is_first =
true;
439 for (row = 0; row < values_table->
GetNum_rows(); row++) {
443 row_problems[row] += description +
" is duplicated";
448 id_col->
GetData().
GetId()[first_row]->GetLabel(&id_label);
452 row_problems[row] += description +
" duplicates row " + id_label;
459 return num_duplicates;
465 if (one_of_list.size() < 1) {
469 string description =
"Missing " + one_of_list[0];
470 for (j = 1; j < one_of_list.size(); j++) {
471 description +=
" or " + one_of_list[j];
474 vector<CRef<CSeqTable_column> > cols;
475 for (j = 0; j < one_of_list.size(); j++) {
483 for (row = 0; row < values_table->
GetNum_rows(); row++) {
485 for (j = 0; j < cols.size() && !any; j++) {
492 problems->
SetData().SetString()[row] +=
", ";
494 problems->
SetData().SetString()[row] += description;
502 string qual_report =
"";
506 for (row = 0; row < values_table->
GetNum_rows(); row++) {
507 problems->
SetData().SetString().push_back(
"");
515 for (row = 0; row < values_table->
GetNum_rows(); row++) {
522 problems->
SetData().SetString()[row] +=
", ";
524 problems->
SetData().SetString()[row] += (*rit)->GetName() +
" is missing";
526 string tmp = (*rit)->GetFormatErrors(
val);
529 problems->
SetData().SetString()[row] +=
", ";
536 for (row = 0; row < values_table->
GetNum_rows(); row++) {
538 problems->
SetData().SetString()[row] +=
", ";
540 problems->
SetData().SetString()[row] += (*rit)->GetName() +
" is missing";
554 bool found_good_combo =
false;
556 vector<string > uniqueness_problems;
557 vector<vector<int> > num_problems;
559 vector<string> this_list;
560 for (row = 0; row < values_table->
GetNum_rows(); row++) {
561 this_list.push_back(
"");
564 if (num_problems > 0) {
565 if (best_num == 0 || best_num > num_problems) {
566 uniqueness_problems = this_list;
567 best_num = num_problems;
570 found_good_combo =
true;
573 if (!found_good_combo) {
574 for (
i = 0;
i < uniqueness_problems.size();
i++) {
577 problems->
SetData().SetString()[
i] +=
", ";
579 problems->
SetData().SetString()[
i] += uniqueness_problems[
i];
599 bool any1 =
false, any2 =
false;
600 for (
int row = 0; row < values_table->
GetNum_rows() && !any1; row++) {
623 string val_name = (*rit)->GetName();
624 string example = (*rit)->GetExample();
628 val_name +=
"\n[" +
example +
"]";
636 while (new_col->
SetData().SetString().size() < (
size_t) values_table->
GetNum_rows()) {
637 new_col->
SetData().SetString().push_back (
"");
639 values_table->
SetColumns().push_back(new_col);
667 {
"Collection-date", -1, -1,
"05-Feb-2005" } ,
713 {
kHost, -1, -1,
"Homo sapiens" } ,
714 {
"lat-lon", -1, -1,
"39.00 N 77.10 W" } ,
715 {
"strain", -1, -1,
"ABC123" } ,
716 {
"country", -1, -1,
"USA: Ann Arbor, MI" } ,
720 {
"Isolate", -1, -1,
"SDZ123" } ,
730 {
"Specimen-voucher", -1, -1,
"USNM:12345" } ,
731 {
"sex", -1, -1,
"female" } ,
732 {
"breed", -1, -1,
"Holstein" } ,
733 {
"cultivar", -1, -1,
"Granny Smith" } ,
745 {
"isolation-source", -1, -1,
"soil" } ,
814 requirements->
AddRequirement(
"uncultured taxname",
true,
"uncultured bacterium");
822 switch (wizard_type) {
825 bool has_gelband_isolate =
false;
828 for (
size_t row = 0; row < isolate_col->
GetData().GetSize() && !has_gelband_isolate; row++) {
831 has_gelband_isolate =
true;
835 if (has_gelband_isolate) {
849 switch (source_type) {
854 requirements->
AddOneOfList(2, host,
"isolation-source");
867 requirements->
AddOneOfList(2, host,
"isolation-source");
873 requirements->
AddOneOfList(2, host,
"isolation-source");
886 switch (source_type) {
905 switch (source_type) {
912 requirements->
AddUniquenessList(5,
"organism",
"specimen-voucher",
"isolate",
"bio-material",
"culture-collection");
942 requirements->
SetExamples(wizard_type, source_type);
949 vector<string>
names;
952 if ((*sit)->IsSetName())
954 string new_name = (*sit)->GetName();
955 if (!new_name.empty())
956 names.push_back(new_name);
965 string this_seq =
"";
969 if ((*sit)->IsSetSeq()) {
970 new_seq = (*sit)->GetSeq();
983 size_t len =
str.length();
989 string JoinValues(
const string &name,
const vector<string>& values)
991 if (name ==
"culture_collection" || name ==
"culture-collection" || name ==
"culture collection" ||
992 name ==
"bio_material" || name ==
"bio-material" || name ==
"biomaterial" ||
993 name ==
"specimen_voucher" || name ==
"specimen-voucher" || name ==
"specimen voucher")
998 void SplitValues(
const string& name,
const string& newValue, vector<string> &values)
1000 if (name ==
"culture_collection" || name ==
"culture-collection" || name ==
"culture collection" ||
1001 name ==
"bio_material" || name ==
"bio-material" || name ==
"biomaterial" ||
1002 name ==
"specimen_voucher" || name ==
"specimen-voucher" || name ==
"specimen voucher")
1005 values.push_back(newValue);
1014 table->SetColumns().push_back(id_col);
1018 expand_col->
SetHeader().SetField_name(
"expand");
1019 expand_col->
SetData().SetString();
1020 table->SetColumns().push_back(expand_col);
1023 taxname_col->
SetHeader().SetTitle(
"Organism Name");
1024 taxname_col->
SetHeader().SetField_name(
"org.taxname");
1025 taxname_col->
SetData().SetString();
1026 table->SetColumns().push_back(taxname_col);
1030 for ( ; b_iter ; ++b_iter ) {
1033 id->Assign (*(b_iter->
GetSeqId()));
1034 id_col->
SetData().SetId().push_back(
id);
1035 expand_col->
SetData().SetString().push_back(
"");
1040 taxname_col->
SetData().SetString().push_back(
"");
1059 if ((*sit)->IsSetName()) {
1060 val = (*sit)->GetName();
1066 name_to_values[subtype_name].push_back(
val);
1068 for (
const auto& name_val : name_to_values)
1081 subtype_name =
"host";
1083 string val = (*sit)->GetSubname();
1085 name_to_values[subtype_name].push_back(
val);
1087 for (
const auto& name_val : name_to_values)
1097 string db = (*sit)->GetDb();
1099 if ((*sit)->GetTag().IsStr())
1100 tag = (*sit)->GetTag().GetStr();
1101 if ((*sit)->GetTag().IsId())
1109 string fwd_name =
"";
1110 string rev_name =
"";
1111 string fwd_seq =
"";
1112 string rev_seq =
"";
1114 string this_fwd_name =
"";
1115 string this_fwd_seq =
"";
1116 string this_rev_name =
"";
1117 string this_rev_seq =
"";
1118 if ((*pit)->IsSetForward()) {
1122 if ((*pit)->IsSetReverse()) {
1126 fwd_name += this_fwd_name +
";";
1127 fwd_seq += this_fwd_seq +
";";
1128 rev_name += this_rev_name +
";";
1129 rev_seq += this_rev_seq +
";";
1159 table->SetColumns().push_back(id_col);
1161 vector< CRef<CSrcTableColumnBase> > handlers;
1163 ITERATE(vector<string>, q, qual_names) {
1167 table->SetColumns().push_back(col);
1172 for ( ; b_iter ; ++b_iter ) {
1175 id->Assign (*(b_iter->
GetSeqId()));
1176 id_col->
SetData().SetId().push_back(
id);
1177 for (
size_t i = 0;
i < handlers.size();
i++) {
1179 table->SetColumns()[
i + 1]->SetData().SetString().push_back(handlers[
i]->GetFromBioSource(it->
GetSource()));
1181 table->SetColumns()[
i + 1]->SetData().SetString().push_back(
"");
1195 vector<CConstRef<CObject> >
objects;
1200 object.
Reset(&(*desc_ci));
1220 vector<CRef<CApplyObject> >
objects;
1260 vector<string> vals;
1266 vals.insert(vals.begin(), add.begin(), add.end());
1269 vals.insert(vals.begin(), add.begin(), add.end());
1276 vector<string> vals;
1279 vals.push_back(
val);
1302 src.
SetOrg().SetTaxname(orig_val);
1310 in_out_bioSource.
SetOrg().ResetTaxname();
1335 string new_taxname = src.
GetTaxname().substr(0, pos) + orig_val;
1336 src.
SetOrg().SetTaxname(new_taxname);
1345 string taxname = in_out_bioSource.
GetTaxname();
1349 string new_taxname = taxname.substr(0, pos);
1351 in_out_bioSource.
SetOrg().SetTaxname(new_taxname);
1378 vector<string>
names;
1383 if (
names.empty()) {
1394 if (
names.size() <= pos + 1) {
1398 bool found_keyword =
true;
1399 while (pos <
names.size() && found_keyword) {
1401 found_keyword =
false;
1404 found_keyword =
true;
1406 for (
size_t n = 1;
n <
sizeof(
nomial_keywords)/
sizeof(
string) && !found_keyword; ++
n) {
1409 found_keyword =
true;
1414 string taxname_after_binomial =
kEmptyStr;
1415 while (pos <
names.size()) {
1416 taxname_after_binomial +=
names[pos] +
" ";
1420 return taxname_after_binomial;
1428 if (!organelle.empty())
1461 vector<string> problems;
1464 ITERATE(vector<string>, it, values) {
1467 problems.push_back(
"'" + *it +
"'" +
" is not a valid value for Genome");
1470 problems.push_back(
"");
1512 vector<string> problems;
1516 ITERATE(vector<string>, it, values) {
1519 problems.push_back(
"'" + *it +
"'" +
" is not a valid value for Origin");
1522 problems.push_back(
"");
1542 vector<string> values;
1545 CBioSource::TSubtype::iterator it = src.
SetSubtype().begin();
1551 string orig_val =
"";
1552 if ((*it)->IsSetName()) {
1553 orig_val = (*it)->GetName();
1556 if (
i < values.size())
1559 (*it)->SetName(orig_val);
1569 for (;
i < values.size();
i++)
1588 CBioSource::TSubtype::iterator it = in_out_bioSource.
SetSubtype().begin();
1589 while (it != in_out_bioSource.
SetSubtype().end()) {
1591 it = in_out_bioSource.
SetSubtype().erase(it);
1607 CBioSource::TSubtype::const_iterator it = in_out_bioSource.
GetSubtype().begin();
1608 while (it != in_out_bioSource.
GetSubtype().end()) {
1609 if ((*it)->GetSubtype() ==
m_Subtype && (*it)->IsSetName()) {
1610 val = (*it)->GetName();
1626 vector<string> vals;
1629 CBioSource::TSubtype::const_iterator it = biosrc.
GetSubtype().begin();
1631 if ((*it)->GetSubtype() ==
m_Subtype && (*it)->IsSetName()) {
1632 string val = (*it)->GetName();
1637 vals.push_back(
val);
1654 vector<string> values;
1659 COrgName::TMod::iterator it = src.
SetOrg().SetOrgname().SetMod().begin();
1660 while (it != src.
SetOrg().SetOrgname().SetMod().end()) {
1662 string orig_val =
"";
1663 if ((*it)->IsSetSubname()) {
1664 orig_val = (*it)->GetSubname();
1667 if (
i < values.size())
1671 (*it)->SetSubname(orig_val);
1680 for (;
i < values.size();
i++)
1683 src.
SetOrg().SetOrgname().SetMod().push_back(s);
1693 COrgName::TMod::iterator it = in_out_bioSource.
SetOrg().SetOrgname().SetMod().begin();
1694 while (it != in_out_bioSource.
SetOrg().SetOrgname().SetMod().end()) {
1696 it = in_out_bioSource.
SetOrg().SetOrgname().SetMod().erase(it);
1702 in_out_bioSource.
SetOrg().SetOrgname().ResetMod();
1713 if ((*it)->GetSubtype() ==
m_Subtype && (*it)->IsSetSubname()) {
1714 val = (*it)->GetSubname();
1725 vector<string> vals;
1729 if ((*it)->GetSubtype() ==
m_Subtype && (*it)->IsSetSubname()) {
1730 string val = (*it)->GetSubname();
1731 vals.push_back(
val);
1756 for (; iter != sm_VouchMap.end(); ++iter){
1757 if (iter->second == stype_part){
1768 if (iter != sm_VouchMap.end()){
1769 return iter->second;
1787 string inst, coll, id;
1805 vector<string> vals;
1808 vals.push_back(
val);
1816 COrgName::TMod::iterator it = in_out_bioSource.
SetOrg().SetOrgname().SetMod().begin();
1817 while (it != in_out_bioSource.
SetOrg().SetOrgname().SetMod().end()) {
1818 if ((*it)->GetSubtype() ==
m_Subtype && (*it)->IsSetSubname()) {
1820 string inst, coll, id;
1837 it = in_out_bioSource.
SetOrg().SetOrgname().SetMod().erase(it);
1839 (*it)->SetSubname(new_subname);
1847 in_out_bioSource.
SetOrg().SetOrgname().ResetMod();
1863 COrgName::TMod::iterator it = src.
SetOrg().SetOrgname().SetMod().begin();
1864 while (it != src.
SetOrg().SetOrgname().SetMod().end()) {
1867 string inst, coll, id;
1868 if ((*it)->IsSetSubname()) {
1894 (*it)->SetSubname(new_subname);
1904 string inst, coll, id;
1926 src.
SetOrg().SetOrgname().SetMod().push_back(s);
1951 if (!string_constraint) {
2001 if (!
set.Get().front()->IsSetSeq()) {
2007 if (!
set.Get().front()->IsSetName()) {
2032 vector<string> vals;
2036 if (add.size() > 0) {
2037 vals.insert(vals.end(), add.begin(), add.end());
2047 vector<string> vals;
2053 if (add.size() > 0) {
2054 vals.insert(vals.end(), add.begin(), add.end());
2062 if (add.size() > 0) {
2063 vals.insert(vals.end(), add.begin(), add.end());
2076 vector<string> vals;
2082 if ((*it)->IsSetSeq()) {
2083 vals.push_back((*it)->GetSeq());
2090 if ((*it)->IsSetName()) {
2091 vals.push_back((*it)->GetName());
2105 bool try_this =
false;
2149 set.Set().push_back(primer);
2166 set.Set().push_back(primer);
2181 vector<string> values;
2188 string val = orig_val;
2193 if ((*it)->IsSetSeq()) {
2194 str = (*it)->GetSeq();
2211 string val = orig_val;
2216 if ((*it)->IsSetName()) {
2217 str = (*it)->GetName();
2225 (*it)->SetName(name);
2237 for (;
i < values.size();
i++)
2249 CPCRReactionSet::Tdata::iterator it = src.
SetPcr_primers().Set().begin();
2252 if (!(*it)->IsSetForward() && !(*it)->IsSetReverse()) {
2290 CPCRPrimerSet::Tdata::iterator it =
set.Set().
begin();
2291 while (it !=
set.Set().
end()) {
2292 bool is_empty =
true;
2293 if ((*it)->IsSetName()) {
2294 string str = (*it)->GetName();
2301 if((*it)->IsSetSeq()) {
2302 string str = (*it)->GetSeq();
2325 vector<string> values;
2329 string value = newValue;
2336 for (;
i < values.size();
i++)
2352 if (vals.size() > 0) {
2362 vector<string> vals;
2367 if (add.size() > 0) {
2368 vals.insert(vals.end(), add.begin(), add.end());
2420 string primer_value = fwdseq->GetFromBioSource(src);
2422 primer_value = revseq->GetFromBioSource(src);
2424 primer_value = fwdname->GetFromBioSource(src);
2426 primer_value = revname->GetFromBioSource(src);
2430 return primer_value;
2435 vector <string> vals;
2438 string note = fwdseq->GetFromBioSource(src);
2439 if (!note.empty()) {
2440 vals.push_back(note);
2444 note = revseq->GetFromBioSource(src);
2445 if (!note.empty()) {
2446 vals.push_back(note);
2450 note = fwdname->GetFromBioSource(src);
2451 if (!note.empty()) {
2452 vals.push_back(note);
2456 note = revname->GetFromBioSource(src);
2457 if (!note.empty()) {
2458 vals.push_back(note);
2504 (*db)->GetTag().AsString(oss);
2514 vector<string> vals;
2522 (*db)->GetLabel(&
label);
2523 vals.push_back(
label);
2539 vector<string> values;
2541 for (
auto value : values)
2546 if (!db.empty() && !
tag.empty())
2565 (*db)->GetTag().AsString(oss);
2568 tag.SetStr(orig_val);
2581 catch (exception &) {
2585 in_out_bioSource.
SetOrg().SetDb().push_back(db_tag);
2592 if (in_out_bioSource.IsSetOrg() && in_out_bioSource.GetOrg().IsSetDb()) {
2593 in_out_bioSource.SetOrg().ResetDb();
2601 vector <string> vals;
2606 if (!note.empty()) {
2607 vals.push_back(note);
2613 if (!note.empty()) {
2614 vals.push_back(note);
2625 if ( !note_values.empty() ){
2626 return note_values.front();
2646 in_out_bioSource.
SetOrg().SetTaxId(
val);
2648 }
catch (exception &) {
2656 COrg_ref::TDb::iterator it = in_out_bioSource.
SetOrg().SetDb().begin();
2657 while (it != in_out_bioSource.
SetOrg().SetDb().end()) {
2659 it = in_out_bioSource.
SetOrg().SetDb().erase(it);
2674 }
catch (exception &) {
2687 string sTitle = column_name;
2689 if ( nl_pos !=
NPOS ) {
2690 sTitle = sTitle.substr(0, nl_pos);
2696 if (desc_pos !=
NPOS) {
2697 sTitle = sTitle.substr(0, desc_pos);
2699 }
if (feat_pos !=
NPOS) {
2700 sTitle = sTitle.substr(0, feat_pos);
2704 if (sTitle.empty()) {
2723 string organelle = sTitle.substr(6,
NPOS);
2765 string subtype = sTitle.substr(0, pos);
2794 if( !
column.IsSetHeader() || !
column.GetHeader().IsSetTitle() ) {
2798 string sTitle =
column.GetHeader().GetTitle();
2818 size_t num_cols = columns.size();
2823 vector< CRef<CSrcTableColumnBase> > vecColEditFactories;
2829 vecColEditFactories.push_back(bogus);
2838 for (
int row = 0; row < values_table->
GetNum_rows() && (
size_t) row < id_col->GetData().GetSize(); row++) {
2844 new_source_desc->
Assign(*desc_ci);
2850 for(
size_t col = 1; col < num_cols; ++col ) {
2851 if (vecColEditFactories[col])
2852 vecColEditFactories[col]->ClearInBioSource(bioSource);
2857 for(
size_t col = 1; col < num_cols; ++col ) {
2858 if (vecColEditFactories[col] && columns[col]->GetData().GetSize() > (
size_t) row) {
2859 vecColEditFactories[col]->AddToBioSource(
2869 cmd->AddCommand (*ecmd);
2889 string id1_label =
"";
2891 string id2_label =
"";
2894 size_t pos =
NStr::Find (id2_label, id1_label);
2896 if (
NStr::Equal(id2_label.substr(id1_label.length(), 1),
".")) {
2899 }
else if (pos != string::npos &&
NStr::EndsWith(id2_label, id1_label)) {
2900 string delim = id2_label.substr(pos - 1, 1);
2912 if (!
id || !id_col) {
2918 while (row < id_col->GetData().GetSize() && !found) {
2926 id->Assign(*row_id);
2932 while (row < id_col->GetData().GetSize() && !found) {
2941 id->Assign(*row_id);
2946 id->Assign(*row_id);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
static bool AutoFill(objects::COrg_ref &org)
const string & GetLineage(void) const
bool IsSetCommon(void) const
const string & GetTaxname(void) const
bool IsSetOrgMod(void) const
static string GetOrganelleByGenome(unsigned int genome)
const string & GetCommon(void) const
const COrgName & GetOrgname(void) const
const string & GetDivision(void) const
static CBioSource::EOrigin GetOriginByString(const string &origin, NStr::ECase use_case=NStr::eCase, bool starts_with=false)
bool IsSetLineage(void) const
bool IsSetDivision(void) const
static CBioSource::EGenome GetGenomeByOrganelle(const string &organelle, NStr::ECase use_case=NStr::eCase, bool starts_with=false)
static string GetStringFromOrigin(unsigned int origin)
bool IsSetTaxname(void) const
virtual string GetValue(const objects::CBioSource &src)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
objects::COrgMod::TSubtype m_Subtype
COrgModQual()
Constructors.
virtual string GetValue(const objects::CBioSource &src)
virtual string GetFormatErrors(string value)
@OrgMod.hpp User-defined methods of the data storage class.
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static string GetSubtypeName(TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static string MakeStructuredVoucher(const string &inst, const string &coll, const string &id)
static bool ParseStructuredVoucher(const string &str, string &inst, string &coll, string &id)
size_t GetSize(void) const
namespace ncbi::objects::
void AddColumnsToSeqTable(CRef< objects::CSeq_table > values_table)
void x_AddOneOfProblems(CRef< objects::CSeq_table >, vector< string > one_of_list, CRef< objects::CSeqTable_column > problems)
int x_AddUniquenessProblems(CRef< objects::CSeq_table > values_table, vector< string > uniqueness_list, vector< string > &row_problems)
void SetExamples(EWizardType wizard_type, EWizardSrcType src_type)
@ eWizardSrcType_cultured_fungus
@ eWizardSrcType_virus_norovirus
@ eWizardSrcType_virus_foot_and_mouth
@ eWizardSrcType_bacteria_or_archaea
@ eWizardSrcType_virus_influenza
@ eWizardSrcType_vouchered_fungus
@ eWizardSrcType_virus_rotavirus
CSourceRequirements()
Constructors.
virtual ~CSourceRequirements()
Destructor.
void AddUniquenessList(vector< string > list)
void AddOneOfList(vector< string > list)
TSrcQualList m_Requirements
vector< vector< string > > m_UniquenessLists
void AddRequirement(string name, bool required, string example="")
vector< vector< string > > m_OneOfLists
@ eWizardType_uncultured_samples
@ eWizardType_microsatellite
@ eWizardType_rrna_its_igs
void PreferentiallyAddRequirement(CRef< objects::CSeq_table > values_table, string choice1, string choice2, bool required)
CRef< objects::CSeqTable_column > CheckSourceQuals(CRef< objects::CSeq_table > values_table)
virtual ~CSrcQual()
Destructor.
virtual string GetValue(const objects::CBioSource &src)
void x_ParsePartsFromStructuredVoucher(const string &qualifier, string &inst, string &coll, string &id) const
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &src) const
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
static const string & GetName_StrVoucherPart(EStructVouchPart stype_part)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
EStructVouchPart m_SubtypePart
static EStructVouchPart GetStrVoucherPart_FromName(const string &name)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &biosrc) const
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &src) const
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &src) const
static CRef< CSrcTableColumnBase > Create(const objects::CSeqTable_column &column)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &src) const
vector< CRef< objects::edit::CApplyObject > > GetApplyObjects(CBioseq_Handle bsh)
string GetVal(const CObject &object)
vector< string > GetVals(const CObject &object)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const =0
vector< CConstRef< CObject > > GetObjects(CBioseq_Handle bsh)
void SetSourceType(ESourceType type)
void ClearVal(CObject &object)
virtual string GetFromBioSource(const objects::CBioSource &biosrc) const
virtual bool AllowMultipleValues()
virtual bool AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue, objects::edit::EExistingText existing_text)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &biosrc) const
virtual string GetFromBioSource(const objects::CBioSource &biosrc) const
virtual string GetFromBioSource(const objects::CBioSource &biosrc) const
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual vector< string > IsValid(const vector< string > &values)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
CSrcTableGenomeColumn(const string &organelle=kEmptyStr)
virtual string GetFromBioSource(const objects::CBioSource &biosrc) const
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &biosrc) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
objects::COrgMod::TSubtype m_Subtype
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual vector< string > IsValid(const vector< string > &values)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual vector< string > GetValsFromBioSource(const CBioSource &src) const
bool x_ApplyStringToReaction(const string &val, CPCRReaction &reaction, objects::edit::EExistingText existing_text)
bool x_DoesPrimerSetHaveSpace(const CPCRPrimerSet &set)
bool x_DoesReactionMatchConstraint(const CPCRReaction &reaction) const
virtual void SetConstraint(const string &field_name, CConstRef< edit::CStringConstraint > string_constraint)
bool x_AddFieldToPrimerSet(const string &val, CPCRPrimerSet &set)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
bool x_ApplyStringToPrimerSet(const string &val, CPCRPrimerSet &set, objects::edit::EExistingText existing_text)
bool x_DoesReactionHaveSpace(const CPCRReaction &reaction)
void x_RemoveEmptyValues(CBioSource &src)
static EPrimerColType GetPrimerColumnType(const string &field_name)
virtual void ClearInBioSource(objects::CBioSource &src)
virtual string GetFromBioSource(const objects::CBioSource &src) const
CRef< edit::CStringConstraint > m_StringConstraint
EPrimerColType m_ConstraintCol
vector< string > x_GetValues(EPrimerColType col, const CBioSource &src) const
objects::CSubSource::TSubtype m_Subtype
virtual vector< string > GetValsFromBioSource(const objects::CBioSource &biosrc) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual bool AddToBioSource(objects::CBioSource &in_out_bioSource, const string &newValue, objects::edit::EExistingText existing_text)
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
string x_GetTextAfterNomial(const string &taxname) const
virtual void ClearInBioSource(objects::CBioSource &in_out_bioSource)
virtual string GetFromBioSource(const objects::CBioSource &in_out_bioSource) const
virtual bool AddToBioSource(objects::CBioSource &src, const string &newValue, objects::edit::EExistingText existing_text)
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
TBase::const_iterator const_iterator
static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)
static string GetSubtypeName(CSubSource::TSubtype stype, EVocabulary vocabulary=eVocabulary_raw)
static bool NeedsNoText(const TSubtype &subtype)
vector< string > m_BadIsolationSourceValues
objects::CSubSource::TSubtype m_Subtype
virtual string GetFormatErrors(string value)
CSubSrcQual()
Constructors.
virtual string GetValue(const objects::CBioSource &src)
virtual string GetValue(const objects::CBioSource &src)
virtual string GetFormatErrors(string value)
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
static const struct name_t names[]
const char * kGenomeProjectID
const char * kSubSourceNote
const char * kSequenceIdColLabel
#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.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define ENUM_METHOD_NAME(EnumName)
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
E_SIC
Compare return values.
@ e_YES
SeqIds compared, but are different.
@ eContent
Untagged human-readable accession or the like.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id) const
Get Bioseq handle from the TSE of this Seq-entry.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
bool IsSetClass(void) const
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_STD::string::size_type SIZE_TYPE
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 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 spaces in a string (in-place)
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
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 EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another 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 SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
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 enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to 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 & ToUpper(string &str)
Convert string to upper case – string& version.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ eReverseSearch
Search in a backward direction.
@ eTrunc_End
Truncate trailing spaces only.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
static const char label[]
const Tdata & Get(void) const
Get the member data.
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
const TPcr_primers & GetPcr_primers(void) const
Get the Pcr_primers member data.
TGenome GetGenome(void) const
Get the Genome member data.
TOrigin GetOrigin(void) const
Get the Origin member data.
void ResetGenome(void)
Reset Genome data member.
void ResetOrigin(void)
Reset Origin data member.
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.
bool IsSetPcr_primers(void) const
Check if a value has been assigned to Pcr_primers data member.
void SetOrigin(TOrigin value)
Assign a value to Origin data member.
const TForward & GetForward(void) const
Get the Forward member data.
void SetSeq(const TSeq &value)
Assign a value to Seq 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.
void SetGenome(TGenome value)
Assign a value to Genome data member.
void SetForward(TForward &value)
Assign a value to Forward data member.
bool IsSetGenome(void) const
Check if a value has been assigned to Genome data member.
void ResetReverse(void)
Reset Reverse data member.
void SetPcr_primers(TPcr_primers &value)
Assign a value to Pcr_primers data member.
void SetReverse(TReverse &value)
Assign a value to Reverse data member.
void SetName(const TName &value)
Assign a value to Name data member.
void SetOrg(TOrg &value)
Assign a value to Org data member.
bool IsSetReverse(void) const
Check if a value has been assigned to Reverse data member.
void ResetForward(void)
Reset Forward data member.
const TReverse & GetReverse(void) const
Get the Reverse member data.
list< CRef< CPCRReaction > > Tdata
bool IsSetForward(void) const
Check if a value has been assigned to Forward data member.
bool IsSet(void) const
Check if a value has been assigned to data member.
bool IsSet(void) const
Check if a value has been assigned to data member.
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
void ResetPcr_primers(void)
Reset Pcr_primers data member.
void ResetSubtype(void)
Reset Subtype data member.
list< CRef< CPCRPrimer > > Tdata
@ eSubtype_isolation_source
void SetTag(TTag &value)
Assign a value to Tag data member.
void SetDb(const TDb &value)
Assign a value to Db data member.
const TMod & GetMod(void) const
Get the Mod member data.
bool IsSetDb(void) const
ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.
void SetSubtype(TSubtype value)
Assign a value to Subtype data member.
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
const TDb & GetDb(void) const
Get the Db 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.
void SetSubname(const TSubname &value)
Assign a value to Subname 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
const TColumns & GetColumns(void) const
Get the Columns member data.
void SetHeader(THeader &value)
Assign a value to Header data member.
vector< CRef< CSeqTable_column > > TColumns
void SetData(TData &value)
Assign a value to Data data member.
TNum_rows GetNum_rows(void) const
Get the Num_rows member data.
const TString & GetString(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetColumns(void) const
data in columns Check if a value has been assigned to Columns data member.
TColumns & SetColumns(void)
Assign a value to Columns data member.
const TId & GetId(void) const
Get the variant data.
@ eField_id_location_id
location Seq-id
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.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
bool IsBiosrc(void) const
Check if variant Biosrc is selected.
bool IsLocal(void) const
Check if variant Local is selected.
@ eClass_nuc_prot
nuc acid and coded proteins
const TSource & GetSource(void) const
Get the variant data.
bool IsSource(void) const
Check if variant Source is selected.
list< CRef< CSeq_id > > TId
TSource & SetSource(void)
Select the variant.
@ e_Source
source of materials, includes Org-ref
@ eMol_na
just a nucleic acid
char * dbname(DBPROCESS *dbproc)
Get name of current database.
fallback to Cassandra storage</td > n</tr > n</table > n</td > n< td > no and not provided</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 smart and slim</td> n<td> orig</td> n</tr> n<tr> n<td> exclude_blobs</td> n<td> optional</td> n<td> String</td> n<td class=\"description\"> A comma separated list of blob identifiers which client already has If provided then n if the resolution of sequence identifier sequence identifier type matches one of the n blob identifiers in the list then the blob will not be sent The format of the blob n identifier depends on a processor For example
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
constexpr auto sort(_Init &&init)
static const GLdouble origin[]
#define FOR_EACH_DBXREF_ON_ORGREF(Itr, Var)
FOR_EACH_DBXREF_ON_ORGREF EDIT_EACH_DBXREF_ON_ORGREF.
#define EDIT_EACH_DBXREF_ON_ORGREF(Itr, Var)
bool MatchColumnName(string name1, string name2)
bool IsOrgColumnName(string name)
CRef< CSeqTable_column > FindSeqTableColumnByName(CRef< objects::CSeq_table > values_table, string column_name)
void AddValueToTable(CRef< CSeq_table > table, string subtype_name, string value, size_t row, edit::EExistingText existing_text=edit::eExistingText_replace_old)
CRef< CCmdComposite > ApplySrcTableToSeqEntry(CRef< CSeq_table >values_table, CSeq_entry_Handle seh)
static bool IsExampleTableRowAcceptable(const ExampleTableData *e1, string field_name, CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType src_type)
CRef< CSeq_table > GetSeqTableForSrcQualFromSeqEntry(CSeq_entry_Handle seh, vector< string > qual_names)
static bool s_IsAllNumbers(string val)
void SplitValues(const string &name, const string &newValue, vector< string > &values)
static const TStructVoucherPart s_StrVouchPartName[]
bool IsFwdPrimerSeq(string name)
static string s_MakeUniquenessVal(vector< CRef< CSeqTable_column > > cols, size_t row)
bool RelaxedMatch(CRef< CSeq_id > id1, CRef< CSeq_id > id2)
string GetPrimerSetNameValues(const CPCRPrimerSet &primer_set)
static int CompareExampleTableRows(const ExampleTableData *e1, const ExampleTableData *e2)
CRef< CSeq_table > GetSeqTableFromSeqEntry(CSeq_entry_Handle seh)
string JoinValues(const string &name, const vector< string > &values)
string GetPrimerSetSeqValues(const CPCRPrimerSet &primer_set)
static bool OneRowOk(CRef< CSeq_id > id, CRef< CSeqTable_column > id_col, CSeq_entry_Handle seh)
SStaticPair< const char *, CSrcStructuredVoucherPartColumn::EStructVouchPart > TStructVoucherPart
DEFINE_STATIC_ARRAY_MAP(TStrcVouchMap, sm_VouchMap, s_StrVouchPartName)
bool IsRevPrimerSeq(string name)
static const int k_NumExampleTableRows
struct exampletable ExampleTableData
static const string nomial_keywords[]
bool IsFwdPrimerName(string name)
CStaticArrayMap< string, CSrcStructuredVoucherPartColumn::EStructVouchPart > TStrcVouchMap
bool IsRevPrimerName(string name)
CSourceRequirements * GetSrcRequirements(CSourceRequirements::EWizardType wizard_type, CSourceRequirements::EWizardSrcType source_type, CRef< CSeq_table > values_table)
static const ExampleTableData s_ExampleTable[]
void RemoveLastCharacter(string &str)
vector< CSrcQual * > TSrcQualList
static const char * str(char *buf, int n)
static const char * column
@ eExistingText_leave_old
@ eExistingText_replace_old
bool AddValueToString(string &str, const string &value, EExistingText existing_text)
Add text to an existing string, using the "existing_text" directive to combine new text with existing...
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...