本文整理汇总了C++中Species::addCVTerm方法的典型用法代码示例。如果您正苦于以下问题:C++ Species::addCVTerm方法的具体用法?C++ Species::addCVTerm怎么用?C++ Species::addCVTerm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Species
的用法示例。
在下文中一共展示了Species::addCVTerm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSBML
LIBSBML_CPP_NAMESPACE_USE
int
main (int argc, char *argv[])
{
SBMLDocument* d;
unsigned int errors, n;
Species *s;
if (argc != 3)
{
cout << endl
<< " usage: addCVTerms <input-filename> <output-filename>" << endl
<< " Adds controlled vocabulary term to a species" << endl
<< endl;
return 2;
}
d = readSBML(argv[1]);
errors = d->getNumErrors();
if (errors > 0)
{
cout << "Read Error(s):" << endl;
d->printErrors(cout);
cout << "Correct the above and re-run." << endl;
}
else
{
n = d->getModel()->getNumSpecies();
if (n <= 0)
{
cout << "Model has no species.\n Cannot add CV terms\n";
}
else
{
s = d->getModel()->getSpecies(0);
CVTerm *cv = new CVTerm();
cv->setQualifierType(BIOLOGICAL_QUALIFIER);
cv->setBiologicalQualifierType(BQB_IS_VERSION_OF);
cv->addResource("http://www.geneontology.org/#GO:0005892");
CVTerm *cv2 = new CVTerm();
cv2->setQualifierType(BIOLOGICAL_QUALIFIER);
cv2->setBiologicalQualifierType(BQB_IS);
cv2->addResource("http://www.geneontology.org/#GO:0005895");
CVTerm *cv1 = new CVTerm();
cv1->setQualifierType(BIOLOGICAL_QUALIFIER);
cv1->setBiologicalQualifierType(BQB_IS_VERSION_OF);
cv1->addResource("http://www.ebi.ac.uk/interpro/#IPR002394");
s->addCVTerm(cv);
s->addCVTerm(cv2);
s->addCVTerm(cv1);
writeSBML(d, argv[2]);
}
}
delete d;
return errors;
}