Exemplo n.º 1
0
 def test_get_subs_matrix_incomplete(self):
     # Ensure understandable exception is raised when a WT/var
     # combo is absent from the data.
     d = load_dataset("test/data_incomplete.txt")
     self.assertRaises(AssertionError, get_subs_matrix, d)
Exemplo n.º 2
0
 def test_get_subs_matrix(self):
     d = load_dataset("test/data.txt")
     mat = get_subs_matrix(d)
     self.assertEqual(len(mat), 400)
Exemplo n.º 3
0
 def test_load_dataset_col_names(self):
     # Ensure custom column names can be specified.
     d1 = load_dataset("test/data.txt")
     d2 = load_dataset("test/data_colnames.txt",
                       cols=["Position", "wt", "Mutant", "fitness"])
     self.assertEqual(d1, d2)
Exemplo n.º 4
0
 def test_load_dataset_filtering(self):
     # Ensure synonymous variants and those with non-canonical WT
     # or variant AAs are ignored.
     d = load_dataset("test/data.txt")
     self.assertEqual(len(d), 380)
Exemplo n.º 5
0
 def test_load_dataset_col_order(self):
     # Ensure data cols can be in any order.
     d1 = load_dataset("test/data.txt")
     d2 = load_dataset("test/data_order.txt")
     self.assertEqual(d1, d2)