示例#1
0
 def test_from_atom_empty(self, name, number, chain):
     atom = Chem.Atom(1)
     mi = Chem.AtomPDBResidueInfo()
     if name is not None:
         mi.SetResidueName(name)
     if number is not None:
         mi.SetResidueNumber(number)
     if chain is not None:
         mi.SetChainId(chain)
     atom.SetMonomerInfo(mi)
     resid = ResidueId.from_atom(atom)
     assert resid == ResidueId()
示例#2
0
 def test_from_atom(self, name, number, chain):
     atom = Chem.Atom(1)
     mi = Chem.AtomPDBResidueInfo()
     if name:
         mi.SetResidueName(name)
     if number:
         mi.SetResidueNumber(number)
     if chain:
         mi.SetChainId(chain)
     atom.SetMonomerInfo(mi)
     resid = ResidueId.from_atom(atom)
     assert resid.name == name
     assert resid.number == number
     assert resid.chain == chain
示例#3
0
 def test_from_atom(self, name, number, chain):
     atom = Chem.Atom(1)
     mi = Chem.AtomPDBResidueInfo()
     if name is not None:
         mi.SetResidueName(name)
     if number is not None:
         mi.SetResidueNumber(number)
     if chain is not None:
         mi.SetChainId(chain)
     atom.SetMonomerInfo(mi)
     resid = ResidueId.from_atom(atom)
     name = name or "UNK"
     number = number or 0
     chain = chain or None
     assert resid.name == name
     assert resid.number == number
     assert resid.chain == chain
示例#4
0
 def test_from_atom_no_mi(self):
     atom = Chem.Atom(1)
     resid = ResidueId.from_atom(atom)
     assert resid.name is None
     assert resid.number is None
     assert resid.chain is None
示例#5
0
 def test_init(self, mol):
     resid = ResidueId.from_atom(mol.GetAtomWithIdx(0))
     assert mol.resid == resid