Esempio n. 1
0
 def test_ls_AA_in_df(self):
     df = residue_and_atom.find_AA("*", self.top, return_df=True)
     idxs = residue_and_atom._ls_AA_in_df("GLU",df)
     self.assertEqual(idxs,[0,4])
Esempio n. 2
0
 def test_just_numbers(self):
     np.testing.assert_array_equal(residue_and_atom.find_AA("28", self.geom2frags.top), [5, 13])
Esempio n. 3
0
 def test_doesnt_grab_index(self):
     idxs = residue_and_atom.find_AA(4, self.top)
     self.assertEqual(idxs,[])
Esempio n. 4
0
 def test_dataframe(self):
     from pandas import DataFrame
     df = residue_and_atom.find_AA("GLU", self.top, return_df=True)
     self.assertIsInstance(df,DataFrame)
Esempio n. 5
0
 def test_works(self):
     idxs = residue_and_atom.find_AA("GLU", self.top)
     self.assertEqual(idxs,[0,4])
Esempio n. 6
0
 def test_ambiguity(self):
     # AMBIGUOUS definition i.e. each residue is present in multiple fragments
     self.assertSequenceEqual(residue_and_atom.find_AA("LYS28", self.geom2frags.top), [5, 13]) # getting multiple idxs,as expected
     self.assertSequenceEqual(residue_and_atom.find_AA("K28", self.geom2frags.top), [5, 13])
Esempio n. 7
0
 def test_rules(self):
     res = residue_and_atom.find_AA("P0G", self.top)[0]
     res = self.top.residue(res)
     CA = residue_and_atom.find_CA(res, CA_dict={"P0G":"CAA"})
     assert CA.name=="CAA"
Esempio n. 8
0
 def test_malformed_code(self):
     with pytest.raises(ValueError):
         residue_and_atom.find_AA("ARGI200", self.geom.top)
Esempio n. 9
0
 def test_malformed_input(self):
     with pytest.raises(ValueError):
         residue_and_atom.find_AA("GLUTAMINE", self.geom.top)
Esempio n. 10
0
 def test_does_not_find_AA(self):
     assert (residue_and_atom.find_AA("lys20", self.geom.top)) == []   # small case won't give any result
     assert (residue_and_atom.find_AA('w32', self.geom.top)) == []    # small case won't give any result
     assert (residue_and_atom.find_AA('w 32', self.geom.top)) == []   # spaces between characters won't work
Esempio n. 11
0
 def test_short_long_AA_code(self):
     self.assertSequenceEqual(residue_and_atom.find_AA('GLU', self.geom.top), [0, 4])
Esempio n. 12
0
 def test_full_short_AA_code(self):
     self.assertSequenceEqual(residue_and_atom.find_AA('E30', self.geom.top), [0])
     self.assertSequenceEqual(residue_and_atom.find_AA('W32', self.geom.top), [2])
Esempio n. 13
0
 def test_full_long_AA_code(self):
     self.assertSequenceEqual(residue_and_atom.find_AA("GLU30", self.geom.top), [0])
     self.assertSequenceEqual(residue_and_atom.find_AA("LYS29", self.geom.top), [5])