Fix residue test to allow "UNL" as unknown ligand.

This commit is contained in:
Geoff Hutchison
2014-03-15 15:26:03 -04:00
parent 83b6be4636
commit 85c5c6cd3d
+7 -7
View File
@@ -2,14 +2,14 @@
residue.cpp - Unit tests for Open Babel OBResidue class
Copyright (C) 2005-2006 Geoffrey R. Hutchison
This file is part of the Open Babel project.
For more information, see <http://openbabel.org/>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -45,7 +45,7 @@ void CheckValidDipeptide(OBConversion &conv,
int residue(int argc, char* argv[])
{
int defaultchoice = 1;
int choice = defaultchoice;
if (argc > 1) {
@@ -79,7 +79,7 @@ int residue(int argc, char* argv[])
OBConversion conv;
OBMol mol;
OBFormat *inFormat = conv.FindFormat("SMI");
conv.SetInFormat(inFormat);
conv.ReadString(&mol, loopTest1);
chainsparser.PerceiveChains(mol);
@@ -155,7 +155,7 @@ int residue(int argc, char* argv[])
CheckValidDipeptide(conv, ala_val, ++testCount);
static const string cys_leu("NC(CS)C(=O)NC(CC(C)C)C(=O)O");
CheckValidDipeptide(conv, cys_leu, ++testCount);
// the number of tests for "prove"
cout << "1.." << testCount << "\n";
@@ -193,13 +193,13 @@ void CheckInvalidResidue(OBConversion &conv,
unsigned int testCount)
{
OBMol mol;
mol.Clear();
conv.ReadString(&mol, test);
chainsparser.PerceiveChains(mol);
if (mol.NumResidues() != 0) {
OBResidue *res = mol.GetResidue(0);
if (res->GetName() == "LIG") { // ligand, not residue
if (res->GetName() == "LIG" || res->GetName() == "UNL" ) { // ligand, not residue
cout << "ok " << testCount << " # found ligand, not residue "
<< test << '\n';
} else {