diff --git a/modules/conop/pymod/export_builder.cc b/modules/conop/pymod/export_builder.cc index 28608ab6ee36e49f6ad539d56b210be6c5cd9cb2..1897983f90b7c4065316633db738732c0ba4b93f 100644 --- a/modules/conop/pymod/export_builder.cc +++ b/modules/conop/pymod/export_builder.cc @@ -36,7 +36,7 @@ void export_Builder() { .add_property("dialect", &Builder::GetDialect, &Builder::SetDialect) .add_property("strict_hydrogens", &Builder::GetStrictHydrogenMode, &Builder::SetStrictHydrogenMode) - .add_property("feasibility_check", &Builder::GetBondFeasibilityCheck, + .add_property("bond_feasibility_check", &Builder::GetBondFeasibilityCheck, &Builder::SetBondFeasibilityCheck) .def("GetDialect", &Builder::GetDialect) .def("SetDialect", &Builder::SetDialect) diff --git a/modules/io/pymod/__init__.py b/modules/io/pymod/__init__.py index ab19f54eedafd79ff57b017e4bc94b79011dea86..6e2f319b0ccd824c7f6e6763264802cf4676e790 100644 --- a/modules/io/pymod/__init__.py +++ b/modules/io/pymod/__init__.py @@ -86,7 +86,7 @@ def LoadPDB(filename, restrict_chains="", no_hetatms=None, fault_tolerant=None, load_multi=False, quack_mode=None, join_spread_atom_records=None, calpha_only=None, profile='DEFAULT', remote=False, dialect=None, - strict_hydrogens=None, seqres=False, bond_feasibility=None): + strict_hydrogens=None, seqres=False, bond_feasibility_check=None): """ Load PDB file from disk and return one or more entities. Several options allow to customize the exact behaviour of the PDB import. For more information @@ -147,7 +147,7 @@ def LoadPDB(filename, restrict_chains="", no_hetatms=None, prof.quack_mode=_override(prof.quack_mode, quack_mode) prof.strict_hydrogens=_override(prof.strict_hydrogens, strict_hydrogens) prof.fault_tolerant=_override(prof.fault_tolerant, fault_tolerant) - prof.bond_feasibility=_override(prof.bond_feasibility, bond_feasibility) + prof.bond_feasibility_check=_override(prof.bond_feasibility_check, bond_feasibility_check) prof.join_spread_atom_records=_override(prof.join_spread_atom_records, join_spread_atom_records) @@ -165,7 +165,7 @@ def LoadPDB(filename, restrict_chains="", no_hetatms=None, elif prof.dialect=='CHARMM': builder.dialect=conop.CHARMM_DIALECT builder.strict_hydrogens=prof.strict_hydrogens - builder.bond_feasibility=prof.bond_feasibility + builder.bond_feasibility_check=prof.bond_feasibility_check reader=PDBReader(filename, prof) reader.read_seqres=seqres try: diff --git a/modules/io/pymod/export_pdb_io.cc b/modules/io/pymod/export_pdb_io.cc index 6f7566906d43c81d8b1921168fadbf551c9f7a11..c5abad5d434ddbdf1285c854cf4a427a8d0f34b9 100644 --- a/modules/io/pymod/export_pdb_io.cc +++ b/modules/io/pymod/export_pdb_io.cc @@ -43,7 +43,7 @@ void export_pdb_io() arg("join_spread_atom_records")=false, arg("no_hetatms")=false, arg("calpha_only")=false, - arg("bond_feasibility")=true))) + arg("bond_feasibility_check")=true))) .def_readwrite("dialect", &IOProfile::dialect) .def_readwrite("fault_tolerant", &IOProfile::fault_tolerant) .def_readwrite("quack_mode", &IOProfile::quack_mode) @@ -51,7 +51,7 @@ void export_pdb_io() .def_readwrite("no_hetatms", &IOProfile::no_hetatms) .def_readwrite("calpha_only", &IOProfile::calpha_only) .def_readwrite("join_spread_atom_records", &IOProfile::join_spread_atom_records) - .def_readwrite("bond_feasibility", &IOProfile::bond_feasibilty) + .def_readwrite("bond_feasibility_check", &IOProfile::bond_feasibility_check) .def("Copy", &IOProfile::Copy) .def(self_ns::str(self)) ; diff --git a/modules/io/src/mol/io_profile.hh b/modules/io/src/mol/io_profile.hh index a51572636e43cc1da175929b00d94e5c290b855e..b4802583a838156ef5aac62048c158b50bff65d3 100644 --- a/modules/io/src/mol/io_profile.hh +++ b/modules/io/src/mol/io_profile.hh @@ -29,11 +29,11 @@ struct DLLEXPORT IOProfile { public: IOProfile(String d, bool sh, bool qm, bool ft, bool js, bool nh, bool co, bool bf): dialect(d), strict_hydrogens(sh), quack_mode(qm), fault_tolerant(ft), - join_spread_atom_records(js), no_hetatms(nh), calpha_only(co), bond_feasibilty(bf) + join_spread_atom_records(js), no_hetatms(nh), calpha_only(co), bond_feasibility_check(bf) { } IOProfile(): dialect("PDB"), strict_hydrogens(true), quack_mode(false), fault_tolerant(false), join_spread_atom_records(false), no_hetatms(false), - calpha_only(false), bond_feasibilty(true) + calpha_only(false), bond_feasibility_check(true) { } virtual ~IOProfile() { } @@ -44,12 +44,12 @@ public: bool join_spread_atom_records; bool no_hetatms; bool calpha_only; - bool bond_feasibilty; + bool bond_feasibility_check; IOProfile Copy() { return IOProfile(dialect, strict_hydrogens, quack_mode, fault_tolerant, - join_spread_atom_records, no_hetatms, calpha_only, bond_feasibilty); + join_spread_atom_records, no_hetatms, calpha_only, bond_feasibility_check); } virtual void PostImport(mol::EntityHandle ent) { } }; @@ -62,8 +62,8 @@ inline std::ostream& operator<<(std::ostream& stream, const IOProfile& p) << (p.join_spread_atom_records ? "True" : "False") << ", no_hetatms=" << (p.no_hetatms ? "True" : "False") << ", calpha_only=" << (p.calpha_only ? "True" : "False") << ", fault_tolerant=" - << (p.fault_tolerant ? "True" : "False") << ", bond_feasibilty=" - << (p.bond_feasibilty ? "True" : "False") << ")"; + << (p.fault_tolerant ? "True" : "False") << ", bond_feasibility_check=" + << (p.bond_feasibility_check ? "True" : "False") << ")"; return stream; } diff --git a/modules/io/tests/test_io_pdb.py b/modules/io/tests/test_io_pdb.py index c8bb3902dbd45b1fb08aea68b81982662d3178a1..6c43dd4214f6ea4c594f9833caa3edcde4137588 100644 --- a/modules/io/tests/test_io_pdb.py +++ b/modules/io/tests/test_io_pdb.py @@ -11,7 +11,22 @@ class TestPDB(unittest.TestCase): ch = e.FindChain("A"); self.assertEquals(ch.GetIntProp("mol_id"), 1) +class TestPDB(unittest.TestCase): + def setUp(self): + pass + + def test_compnd_parser(self): + profiles=io.IOProfiles() + profiles['NO_FEAS_CHECK']=io.IOProfile(bond_feasibility_check=False) + + e=io.LoadPDB('testfiles/pdb/simple_defective.pdb', restrict_chains="A",profile='NO_FEAS_CHECK') + + res=e.FindResidue('A',3) + + self.assertTrue(mol.BondExists(res.FindAtom("CA"),res.FindAtom("CB"))) + if __name__== '__main__': unittest.main() + \ No newline at end of file