Skip to content
Snippets Groups Projects
Commit a0a5cfbe authored by Studer Gabriel's avatar Studer Gabriel
Browse files

make ClustalW unit test independent of sequence order

Andrius Merkys reported architecture dependent behaviour regarding
ordering of aligned sequences. We want to keep the order as given
by the used ClustalW executable which is potentially different as
in the unit test reference file.
parent 5f572c5a
Branches
Tags
No related merge requests found
...@@ -42,8 +42,16 @@ class TestClustalWBindings(unittest.TestCase): ...@@ -42,8 +42,16 @@ class TestClustalWBindings(unittest.TestCase):
def testMultipleClustalW(self): def testMultipleClustalW(self):
aln=clustalw.ClustalW(self.multseq) aln=clustalw.ClustalW(self.multseq)
assert self.mult_alignment.ToString(80) == aln.ToString(80), \ # order of sequences in aln may differ (reported by Andrius Merkys who
"Multiple alignment differs from precomputed one" # found architecture dependent behaviour)
# We therefore check for matching sequence names and respective sequences
# but not for order.
ref_sequences = {s.GetName(): str(s) for s in self.mult_alignment.sequences}
sequences = {s.GetName(): str(s) for s in aln.sequences}
self.assertEqual(sorted(ref_sequences.keys()), sorted(sequences.keys()))
for sname, s in ref_sequences.items():
self.assertEqual(s, sequences[sname])
def testStringClustalW(self): def testStringClustalW(self):
aln=clustalw.ClustalW(self.strseq1, self.strseq2) aln=clustalw.ClustalW(self.strseq1, self.strseq2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment