NCBI C++ ToolKit
strain_serotype_influenza.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: strain_serotype_influenza.cpp 36923 2016-11-14 21:55:59Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Andrea Asztalos
27  */
28 
29 #include <ncbi_pch.hpp>
30 #include <objmgr/feat_ci.hpp>
35 
36 #include <wx/msgdlg.h>
37 
40 
42  const CSeq_entry* se, const CSeqdesc* seqDesq, const CSeq_feat* seqFeat)
43 {
44  CRef<CSerialObject> edited_object;
45  edited_object.Reset((CSerialObject*)CBioSource::GetTypeInfo()->Create());
46  edited_object->Assign(biosource);
47  CBioSource& edited_biosource = dynamic_cast<CBioSource&>(*edited_object);
48 
49 
50  bool modified=false;
51  switch (m_chosen_cmd) {
53  AddToInfluenzaNames (edited_biosource, modified);
54  break;
56  FixupOrganismNames (edited_biosource, modified);
57  break;
59  break;
61  SplittingQualifiersAtCommas (edited_biosource, modified);
62  break;
64  SplittingStructCollections (edited_biosource, modified);
65  break;
67  TrimmingOrganismNames (edited_biosource, modified);
68  break;
69  }
70 
71  if (modified){
73  CObject* actual = (CObject*) &biosource;
74  cmd->Add(actual, CConstRef<CObject>(edited_object));
75  composite->AddCommand(*cmd);
76  }
77  }
78 
80  const CSeq_entry* se, const CSeqdesc* seqDesq, const CSeq_feat* seqFeat)
81 {
82  CRef<CSerialObject> edited_object;
83  edited_object.Reset((CSerialObject*)CBioSource::GetTypeInfo()->Create());
84  edited_object->Assign(biosource);
85 
86  CBioSource& edited_biosource = dynamic_cast<CBioSource&>(*edited_object);
87 
88  string strain, serotype;
89  if (IsParsableInfluenzaVirusName (edited_biosource, strain, serotype)){
90  is_parsable = true;
91  count += CountStrainSerotypeConflicts (edited_biosource, strain, serotype);
92  }
93 }
94 
96  const bool& update, const CSeq_entry* se, const CSeqdesc* seqDesq, const CSeq_feat* seqFeat)
97 {
98  CRef<CSerialObject> edited_object;
99  edited_object.Reset((CSerialObject*)CBioSource::GetTypeInfo()->Create());
100  edited_object->Assign(biosource);
101 
102  CBioSource& edited_biosource = dynamic_cast<CBioSource&>(*edited_object);
103 
104  bool modified=false;
106  string strain, serotype;
107  if (IsParsableInfluenzaVirusName (edited_biosource, strain, serotype)){
108  UpdateExistingStrainSerotype (edited_biosource, strain, serotype, update, modified);
109  }
110  }
111 
112  if (modified){
114  CObject* actual = (CObject*) &biosource;
115  cmd->Add(actual, CConstRef<CObject>(edited_object));
116  composite->AddCommand(*cmd);
117  }
118 
119 }
120 
122 {
124  if ((*it)->IsSource()){
125  ApplyToBioSource ((*it)->GetSource(), composite, &se, *it, NULL);
126  }
127  }
128 
129  if (se.IsSet()) {
131  ApplyToCSeq_entry (**it, composite);
132  }
133  }
134 }
135 
136 void CStrainSerotypeInfluenza::ApplyToCSeq_entry (const CSeq_entry& se, CCmdComposite* composite, const bool& update)
137 {
139  if ((*it)->IsSource()){
140  DoParsingOnBiosource((*it)->GetSource(), composite, update, &se, *it, NULL);
141  }
142  }
143 
144  if (se.IsSet()) {
146  ApplyToCSeq_entry (**it, composite, update);
147  }
148  }
149 }
150 
151 void CStrainSerotypeInfluenza::ApplyToCSeq_entry (const CSeq_entry& se, int& count)
152 {
154  if ((*it)->IsSource()){
155  TestBiosourceForParsing ((*it)->GetSource(), count, &se, *it, NULL);
156  }
157  }
158 
159  if (se.IsSet()) {
161  ApplyToCSeq_entry (**it, count);
162  }
163  }
164 }
165 
166 void CStrainSerotypeInfluenza::apply_to_seq_and_feat(objects::CSeq_entry_Handle tse, CCmdComposite* composite)
167 {
168  CStrainSerotypeInfluenza::ApplyToCSeq_entry (*(tse.GetCompleteSeq_entry()), composite);
170  while (feat){
171  ApplyToBioSource(feat->GetData().GetBiosrc(), composite, NULL, NULL, &(feat->GetOriginalFeature()));
172  ++feat;
173  }
174 }
175 
176 bool CStrainSerotypeInfluenza::apply(objects::CSeq_entry_Handle tse, ICommandProccessor* cmdProcessor, string title)
177 
178 {
179  if (tse) {
180  CRef<CCmdComposite> composite(new CCmdComposite(title));
181  apply_to_seq_and_feat(tse,composite);
182  cmdProcessor->Execute(composite.GetPointer());
183  return true;
184  }
185  else
186  return false;
187 }
188 
189 void CStrainSerotypeInfluenza::TestSeqEntryForParsing(objects::CSeq_entry_Handle tse, int& count)
190 {
191  CStrainSerotypeInfluenza::ApplyToCSeq_entry (*(tse.GetCompleteSeq_entry()), count);
193  while (feat){
194  TestBiosourceForParsing(feat->GetData().GetBiosrc(), count, NULL, NULL, &(feat->GetOriginalFeature()));
195  ++feat;
196  }
197 
198 }
199 
201 {
203  //also check biosource features
205  while (feat){
206  DoParsingOnBiosource(feat->GetData().GetBiosrc(), composite, update, NULL, NULL, &(feat->GetOriginalFeature()));
207  ++feat;
208  }
209 }
210 
211 
213 {
214  if (!biosource.IsSetTaxname() || !NStr::StartsWith(biosource.GetTaxname(), "Influenza A virus", NStr::eNocase))
215  return;
216 
217  if (biosource.IsSetOrgname() && biosource.GetOrg().GetOrgname().IsSetMod()){
218  string strain_str, serotype_str;
219  bool found_strain = false, found_serotype = false;
220 
221  FOR_EACH_ORGMOD_ON_BIOSOURCE (orgmod, biosource)
222  if ((*orgmod)->IsSetSubtype() && (*orgmod)->IsSetSubname()){
223  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_strain){
224  strain_str = (*orgmod)->GetSubname();
225  found_strain=true;
226  }
227  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_serotype){
228  serotype_str = (*orgmod)->GetSubname();
229  found_serotype=true;
230  }
231 
232  }
233  if (!found_strain || !found_serotype)
234  return;
235  // both modifiers should be present
236 
237  string infl_name = "Influenza A virus";
238  string infl_name_wstrain = infl_name + " (" + strain_str + ")";
239  string new_name = infl_name + " (" + strain_str + "(" + serotype_str + "))";
240 
241  string old_taxname = biosource.GetOrg().GetTaxname();
242  NStr::TruncateSpacesInPlace(old_taxname);
243 
244  if (NStr::Equal(old_taxname, infl_name, NStr::eNocase)
245  || NStr::Equal(old_taxname, infl_name_wstrain, NStr::eNocase)){
246  biosource.SetOrg().SetTaxname( new_name );
247  modified = true;
248  modified |= edit::CleanupForTaxnameChange(biosource);
249  }
250  }
251 }
252 
254 {
255  if (!biosource.IsSetTaxname() || !NStr::StartsWith(biosource.GetTaxname(), "Influenza A virus", NStr::eNocase))
256  return;
257 
258  string new_taxname = biosource.GetOrg().GetTaxname();
259  while (NStr::FindNoCase (new_taxname," ") != NPOS) {
260  NStr::ReplaceInPlace (new_taxname, " ", " ");
261  }
262 
263  NStr::ReplaceInPlace (new_taxname, "( ", "(");
264  NStr::ReplaceInPlace (new_taxname, " (", "("); // for the case: "strain (sero"
265  NStr::ReplaceInPlace (new_taxname, " )", ")");
266 
267  // correct for too much space deletion
268  SIZE_TYPE pos = NStr::FindNoCase (new_taxname, "virus(");
269  if (pos != NPOS)
270  new_taxname.insert(pos+5," ");
271 
272  NStr::TruncateSpacesInPlace (new_taxname);
273  if (!NStr::Equal(new_taxname, biosource.GetOrg().GetTaxname(), NStr::eCase)){
274  biosource.SetOrg().SetTaxname(new_taxname);
275  modified=true;
276  modified |= edit::CleanupForTaxnameChange(biosource);
277  }
278 }
279 
280 bool CStrainSerotypeInfluenza::IsParsableInfluenzaVirusName (CBioSource& biosource, string& strain, string& serotype)
281 {
282  /* the name is not parseable if it's not "Influenza A virus" and the strain is missing
283  the presence of serotype is optional
284  */
285 
286  if (!biosource.IsSetTaxname() || !NStr::StartsWith(biosource.GetTaxname(), "Influenza A virus", NStr::eNocase)){
287  return false;
288  }
289 
290  string taxname = biosource.GetOrg().GetTaxname();
291  NStr::TruncateSpacesInPlace (taxname);
292 
293  SIZE_TYPE pos = NStr::FindNoCase (taxname, "(");
294  list<string> array_str;
295  if (pos != NPOS){
296  NStr::Split(taxname, "(", array_str, NStr::fSplit_Tokenize);
297 
298  // if there are more strings than strain and serotype
299  if (array_str.size() > 3){
300  wxMessageBox(wxT("Warning"),
301  wxT("Cannot distinguish the strain from the serotype as there are additional '(' characters."),
302  wxOK);
303  return false;
304  } else if (array_str.size() == 3) { // strain and serotype are both specified
305  strain = *(++array_str.begin());
306  serotype = array_str.back();
307 
308  // trimming the last ')' characters from the end if there are any
310  pos = NStr::FindNoCase (strain, ")");
311  while (pos != NPOS){
312  strain.erase(pos);
313  pos = NStr::FindNoCase (strain, ")");
314  }
315 
316  pos = NStr::FindNoCase (serotype, ")");
317  while (pos != NPOS){
318  serotype.erase(pos);
319  pos = NStr::FindNoCase (serotype, ")");
320  }
321  return true;
322  } else if (array_str.size() == 2) { // only the strain is specified
323  strain = array_str.back();
324  pos = NStr::FindNoCase (strain, ")");
325  while (pos != NPOS){
326  strain.erase(pos);
327  pos = NStr::FindNoCase (strain, ")");
328  }
329  return true;
330  }
331  }
332 
333  return false;
334 }
335 
336 
337 int CStrainSerotypeInfluenza::CountStrainSerotypeConflicts (CBioSource& biosource, const string& strain, const string& serotype)
338 {
339  /* return the number of cases when either the strain or the serotype is different from
340  the ones on the record (OrgMod qualifiers)
341  */
342  int count=0;
343  if (biosource.GetOrg().IsSetOrgname() && biosource.GetOrg().GetOrgname().IsSetMod()){
344  FOR_EACH_ORGMOD_ON_BIOSOURCE (orgmod, biosource){
345  if ((*orgmod)->IsSetSubtype() && (*orgmod)->IsSetSubname()){
346  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_strain)
347  if (!NStr::Equal((*orgmod)->GetSubname(), strain, NStr::eCase)){
348  count++;
349  }
350 
351  if (!NStr::IsBlank(serotype) && (*orgmod)->GetSubtype() == COrgMod::eSubtype_serotype)
352  if (!NStr::Equal((*orgmod)->GetSubname(), serotype, NStr::eCase)){
353  count++;
354  }
355  }
356  }
357  }
358 
359  return count;
360 }
361 
362 
364  const string& strain, const string& serotype, const bool& update, bool& modified)
365 {
366  /* if update = true
367  update every OrgMod qualifier with the new strain & serotype values
368  where necessary, add new OrgMod qualifiers
369 
370  if update = false
371  do not overwrite the existing values with the new strain & serotype
372  where necessary, add new OrgMod qualifiers
373  */
374 
375  // the rest of the cases are when new OrgMod qualifiers need to be added to the biosource
376  if (!biosource.GetOrg().IsSetOrgname()) {
377  biosource.SetOrg().SetOrgname();
378  }
379  if (!biosource.GetOrg().GetOrgname().IsSetMod()) {
380  COrgName_Base::TMod new_mod;
381  CRef<COrgMod> new_orgmod_a(new COrgMod(COrgMod_Base::eSubtype_strain, strain));
382  new_mod.push_back(new_orgmod_a);
383  if (!NStr::IsBlank(serotype)){
384  CRef<COrgMod> new_orgmod_b(new COrgMod(COrgMod_Base::eSubtype_serotype, serotype));
385  new_mod.push_back(new_orgmod_b);
386  }
387  biosource.SetOrg().SetOrgname().SetMod() = new_mod;
388  modified = true;
389  } else { // there are OrgMod qualifiers, not sure whether strain and serotype
390 
391  bool found_strain = false, found_serotype = false;
392  EDIT_EACH_ORGMOD_ON_BIOSOURCE (orgmod, biosource){
393  if((*orgmod)->IsSetSubtype() && (*orgmod)->IsSetSubname()){
394  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_strain){
395  found_strain=true;
396  if (update && !NStr::Equal((*orgmod)->GetSubname(), strain, NStr::eCase)){
397  (*orgmod)->SetSubname() = strain;
398  modified = true;
399  }
400  }
401 
402  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_serotype){
403  found_serotype=true;
404  if (update && !NStr::IsBlank(serotype) && !NStr::Equal((*orgmod)->GetSubname(), serotype, NStr::eCase)){
405  (*orgmod)->SetSubname() = serotype;
406  modified=true;
407  }
408  }
409  }
410  }
411 
412  if (!found_strain){
413  CRef<COrgMod> new_orgmod_a(new COrgMod(COrgMod_Base::eSubtype_strain, strain));
414  biosource.SetOrg().SetOrgname().SetMod().push_back(new_orgmod_a);
415  modified = true;
416  }
417  if (!NStr::IsBlank(serotype) && !found_serotype){
418  CRef<COrgMod> new_orgmod_a(new COrgMod(COrgMod_Base::eSubtype_serotype, serotype));
419  biosource.SetOrg().SetOrgname().SetMod().push_back(new_orgmod_a);
420  modified = true;
421  }
422  }
423 }
424 
426 {
427 
428  if (biosource.IsSetOrg() && biosource.IsSetOrgname() && biosource.IsSetOrgMod()){
429 
430  bool found_multiple_strain = false;
431  list<string> array_str;
432  EDIT_EACH_ORGMOD_ON_BIOSOURCE( orgmod, biosource )
433  if ((*orgmod)->IsSetSubtype() && (*orgmod)->IsSetSubname()){
434  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_strain){
435  string multiple_strain = (*orgmod)->GetSubname();
436  if (NStr::FindNoCase(multiple_strain, ",")!=NPOS){
437 
438  found_multiple_strain=true;
439  NStr::Split(multiple_strain, ",", array_str, NStr::fSplit_Tokenize);
440  NStr::TruncateSpacesInPlace(array_str.front());
441  (*orgmod)->SetSubname() = array_str.front();
442  modified=true;
443  }
444  }
445  }
446 
447  if (found_multiple_strain && array_str.size()>1){
448  list<string>::iterator it = array_str.begin();
449  it++;
450  for (it; it!=array_str.end(); ++it){
451  string strain=*it;
453  if (!NStr::IsBlank(strain)){
454  CRef<COrgMod> new_orgmod(new COrgMod(COrgMod_Base::eSubtype_strain, strain));
455  biosource.SetOrg().SetOrgname().SetMod().push_back(new_orgmod);
456  modified=true;
457  }
458  }
459  }
460  }
461 
462 }
463 
465 {
466  if (!biosource.IsSetOrgMod())
467  return;
468 
469  EDIT_EACH_ORGMOD_ON_BIOSOURCE ( orgmod, biosource){
470  if ((*orgmod)->IsSetSubtype() && (*orgmod)->IsSetSubname()){
471  if ((*orgmod)->GetSubtype() == COrgMod::eSubtype_bio_material ||
472  (*orgmod)->GetSubtype() == COrgMod::eSubtype_culture_collection ||
473  (*orgmod)->GetSubtype() == COrgMod::eSubtype_specimen_voucher){
474 
475  if (NStr::FindNoCase((*orgmod)->GetSubname(), ";") != NPOS){
476 
477  string multiple_mod = (*orgmod)->GetSubname();
478  COrgMod_Base::TSubtype tsub = (*orgmod)->GetSubtype();
479  bool atleastone=false; // there is at least one string that is not empty
480  list<string> tmp;
481  list<string>::iterator iter;
482  NStr::Split(multiple_mod, ";", tmp, NStr::fSplit_Tokenize);
483 
484  for (iter = tmp.begin(); iter != tmp.end(); iter++){
486  if (!NStr::IsBlank(*iter))
487  atleastone=true;
488  }
489 
490  if (atleastone){
491  iter=tmp.begin();
492  while (iter != tmp.end() && NStr::IsBlank(*iter))
493  iter++;
494  (*orgmod)->SetSubname() = *iter;
495  modified=true;
496  orgmod++;
497 
498  iter++;
499  while (iter != tmp.end()){
500  if (!NStr::IsBlank(*iter)){
501  CRef<COrgMod> new_orgmod (new COrgMod( tsub, *iter));
502  biosource.SetOrg().SetOrgname().SetMod().insert(orgmod, new_orgmod);
503  modified = true;
504  }
505  iter++;
506  }
507  }
508  tmp.clear();
509  }
510  }
511  }
512  }
513 }
514 
515 
517 {
518  if (!biosource.IsSetTaxname())
519  return;
520 
521  string old_taxname = biosource.GetOrg().GetTaxname();
522  NStr::TruncateSpacesInPlace (old_taxname);
523 
524  SIZE_TYPE pos=NStr::FindNoCase(old_taxname, " ");
525  vector<string> array_str;
526  if (pos != NPOS)
527  NStr::Split(old_taxname, " ", array_str, NStr::fSplit_Tokenize);
528  SIZE_TYPE len = 1;
529  if (array_str.size() > len){
530  string new_taxname = kEmptyStr;
531  bool uncult = false; // flag to indicate whether it's an uncultured organism
532  if (NStr::Equal(array_str[0], "Uncultured", NStr::eNocase)) {
533  uncult = true;
534  new_taxname = array_str[0] + " ";
535  }
536 
537  short index = uncult ? 1 : 0;
538  bool is_spec_word = false;
539 
540  while (index < (short)array_str.size()
541  && ((uncult && index < 4) || (!uncult && index < 3))
542  && !is_spec_word) {
543 
544  if (NStr::Equal(array_str[index], "sp.", NStr::eNocase) ||
545  NStr::Equal(array_str[index], "aff.",NStr::eNocase) ||
546  NStr::Equal(array_str[index], "cf.",NStr::eNocase)) {
547  is_spec_word = true;
548  new_taxname += array_str[index] + " ";
549  index++;
550  if (index < (short)array_str.size()) {
551  new_taxname += array_str[index];
552  }
553  } else {
554  if ((uncult && index < 3) || (!uncult && index < 2)) {
555  new_taxname += array_str[index] + " ";
556  }
557  }
558 
559  index++;
560  }
561 
563  if (new_taxname.back() == ':') {
564  new_taxname.pop_back();
565  }
566  if (!NStr::Equal (new_taxname, biosource.GetOrg().GetTaxname(), NStr::eCase)){
567  biosource.SetOrg().SetTaxname() = new_taxname;
568  modified = true;
569  modified |= edit::CleanupForTaxnameChange(biosource);
570  }
571  }
572 }
573 
static char tmp[2048]
Definition: utf8.c:62
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:485
void TestBiosourceForParsing(const objects::CBioSource &biosource, int &count, const objects::CSeq_entry *se, const objects::CSeqdesc *seqDesq, const objects::CSeq_feat *seqFeat)
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:102
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:970
bool IsSetOrgMod(void) const
Definition: BioSource.cpp:415
void DoParsingOnBiosource(const objects::CBioSource &biosource, CCmdComposite *composite, const bool &update, const objects::CSeq_entry *se, const objects::CSeqdesc *seqDesq, const objects::CSeq_feat *seqFeat)
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.
Definition: ncbistr.cpp:3306
Case insensitive compare.
Definition: ncbistr.hpp:1177
void SplittingQualifiersAtCommas(objects::CBioSource &biosource, bool &modified)
bool apply(objects::CSeq_entry_Handle tse, ICommandProccessor *cmdProcessor, string title)
#define EDIT_EACH_ORGMOD_ON_BIOSOURCE(Itr, Var)
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
void apply_to_seq_and_feat(objects::CSeq_entry_Handle tse, CCmdComposite *composite)
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.
Definition: ncbistr.cpp:2888
bool CleanupForTaxnameChange(objects::CBioSource &src)
Function removes old-name modifier and the tax-id, resets the common name and removes the synonyms fo...
Definition: source_edit.cpp:51
void ApplyToCSeq_entry(const objects::CSeq_entry &se, CCmdComposite *composite)
SAnnotSelector –.
#define NULL
Definition: ncbistd.hpp:225
#define kEmptyStr
Definition: ncbistr.hpp:120
void ApplyToBioSource(const objects::CBioSource &biosource, CCmdComposite *composite, const objects::CSeq_entry *se, const objects::CSeqdesc *seqDesq, const objects::CSeq_feat *seqFeat)
#define NPOS
Definition: ncbistr.hpp:130
const TBiosrc & GetBiosrc(void) const
Get the variant data.
void UpdateExistingStrainSerotype(objects::CBioSource &biosource, const string &strain, const string &serotype, const bool &update, bool &modified)
All delimiters are merged and trimmed, to get non-empty tokens only.
Definition: ncbistr.hpp:2429
void FixupOrganismNames(objects::CBioSource &biosource, bool &modified)
bool IsSetOrgname(void) const
Definition: BioSource.cpp:405
void DoParsingOnSeqEntry(objects::CSeq_entry_Handle tse, CCmdComposite *composite, const bool &update)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
#define FOR_EACH_ORGMOD_ON_BIOSOURCE(Itr, Var)
FOR_EACH_ORGMOD_ON_BIOSOURCE EDIT_EACH_ORGMOD_ON_BIOSOURCE.
CFeat_CI –.
Definition: feat_ci.hpp:63
int CountStrainSerotypeConflicts(objects::CBioSource &biosource, const string &strain, const string &serotype)
const TTaxname & GetTaxname(void) const
Get the Taxname member data.
Definition: Org_ref_.hpp:358
void SetOrg(TOrg &value)
Assign a value to Org data member.
Definition: BioSource_.cpp:108
void SplittingStructCollections(objects::CBioSource &biosource, bool &modified)
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
Definition: Org_ref_.hpp:501
bool IsSet(void) const
Check if variant Set is selected.
Definition: Seq_entry_.hpp:263
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
CChangeUnindexedObjectCommand< objects::CBioSource > CChangeBioSourceCommand
CSeq_entry_Handle –.
#define FOR_EACH_SEQDESC_ON_SEQENTRY(Itr, Var)
FOR_EACH_SEQDESC_ON_SEQENTRY EDIT_EACH_SEQDESC_ON_SEQENTRY.
bool IsParsableInfluenzaVirusName(objects::CBioSource &biosource, string &strain, string &serotype)
const string & GetTaxname(void) const
Definition: BioSource.cpp:340
#define FOR_EACH_SEQENTRY_ON_SEQSET(Itr, Var)
FOR_EACH_SEQENTRY_ON_SEQSET EDIT_EACH_SEQENTRY_ON_SEQSET.
void AddToInfluenzaNames(objects::CBioSource &biosource, bool &modified)
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
Definition: Seq_entry.hpp:55
const TOrgname & GetOrgname(void) const
Get the Orgname member data.
Definition: Org_ref_.hpp:513
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
int len
bool IsSetTaxname(void) const
Definition: BioSource.cpp:335
Base class for all serializable objects.
Definition: serialbase.hpp:148
CObject –.
Definition: ncbiobj.hpp:180
list< CRef< COrgMod > > TMod
Definition: OrgName_.hpp:332
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
Case sensitive compare.
Definition: ncbistr.hpp:1176
static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string (in-place)
Definition: ncbistr.cpp:3096
#define wxT(x)
Definition: muParser.cpp:41
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:129
void TrimmingOrganismNames(objects::CBioSource &biosource, bool &modified)
const CSeqFeatData & GetData(void) const
namespace ncbi::objects::
Definition: Seq_feat.hpp:56
Undo/Redo interface for editing operations.
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
Definition: OrgName_.hpp:803
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.
Definition: ncbistr.cpp:3362
void AddCommand(IEditCommand &command)
.hpp User-defined methods of the data storage class.
Definition: OrgMod.hpp:53
USING_SCOPE(objects)
static bool Equal(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern, ECase use_case=eCase)
Test for equality of a substring with a pattern.
Definition: ncbistr.hpp:5384
void TestSeqEntryForParsing(objects::CSeq_entry_Handle tse, int &count)
void Add(CObject *obj, const CObject *new_obj)
Truncate trailing spaces only.
Definition: ncbistr.hpp:2176
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: BioSource_.hpp:497
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:756
static char cmd[512]
Definition: bcp.c:20
Modified on Sat May 27 15:28:56 2017 by modify_doxy.py rev. 533848