Author: bugman
Date: Fri Jan 30 11:45:54 2015
New Revision: 27385
URL: http://svn.gna.org/viewcvs/relax?rev=27385&view=rev
Log:
Added the Test_seq_align.test_find_alignment and
Test_seq_align.test_find_missing_alignment unit tests.
These are in the _data_store.test_seq_align unit test module. They check the
functionality of the
currently unimplemented Sequence_alignment.find_alignment() method which will
be used to return
pre-existing alignments.
Modified:
trunk/test_suite/unit_tests/_data_store/test_seq_align.py
Modified: trunk/test_suite/unit_tests/_data_store/test_seq_align.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_data_store/test_seq_align.py?rev=27385&r1=27384&r2=27385&view=diff
==============================================================================
--- trunk/test_suite/unit_tests/_data_store/test_seq_align.py (original)
+++ trunk/test_suite/unit_tests/_data_store/test_seq_align.py Fri Jan 30
11:45:54 2015
@@ -36,8 +36,8 @@
self.seq_align = Sequence_alignments()
- def test_alignment_addition(self):
- """Test the creation of a new sequence alignment object."""
+ def return_align_data(self):
+ """Return a data set for alignment testing."""
# The data.
object_ids = ['frame_order', 'ensemble', 'ensemble', 'ensemble',
'ensemble', 'ensemble', 'ensemble', 'ensemble']
@@ -92,6 +92,16 @@
end_gap_open_penalty = 0.0
end_gap_extend_penalty = 0.0
+ # Return the data.
+ return object_ids, models, molecules, sequences, strings, gaps,
msa_algorithm, pairwise_algorithm, matrix, gap_open_penalty,
gap_extend_penalty, end_gap_open_penalty, end_gap_extend_penalty
+
+
+ def test_alignment_addition(self):
+ """Test the creation of a new sequence alignment object."""
+
+ # The data.
+ object_ids, models, molecules, sequences, strings, gaps,
msa_algorithm, pairwise_algorithm, matrix, gap_open_penalty,
gap_extend_penalty, end_gap_open_penalty, end_gap_extend_penalty =
self.return_align_data()
+
# Add the alignment.
self.seq_align.add(object_ids=object_ids, models=models,
molecules=molecules, sequences=sequences, strings=strings, gaps=gaps,
msa_algorithm=msa_algorithm, pairwise_algorithm=pairwise_algorithm,
matrix=matrix, gap_open_penalty=gap_open_penalty,
gap_extend_penalty=gap_extend_penalty,
end_gap_open_penalty=end_gap_open_penalty,
end_gap_extend_penalty=end_gap_extend_penalty)
@@ -120,3 +130,45 @@
self.assertEqual(self.seq_align[0].gap_extend_penalty,
gap_extend_penalty)
self.assertEqual(self.seq_align[0].end_gap_open_penalty,
end_gap_open_penalty)
self.assertEqual(self.seq_align[0].end_gap_extend_penalty,
end_gap_extend_penalty)
+
+
+ def test_find_alignment(self):
+ """Test the retrieval of pre-existing alignment."""
+
+ # Execute the body of the test_alignment_addition() unit test to set
up the object.
+ self.test_alignment_addition()
+
+ # The identifying data.
+ object_ids, models, molecules, sequences, strings, gaps,
msa_algorithm, pairwise_algorithm, matrix, gap_open_penalty,
gap_extend_penalty, end_gap_open_penalty, end_gap_extend_penalty =
self.return_align_data()
+
+ # Retrieve the alignment.
+ align = self.seq_align.find_alignment(object_ids=object_ids,
models=models, molecules=molecules, sequences=sequences,
msa_algorithm=msa_algorithm, pairwise_algorithm=pairwise_algorithm,
matrix=matrix, gap_open_penalty=gap_open_penalty,
gap_extend_penalty=gap_extend_penalty,
end_gap_open_penalty=end_gap_open_penalty,
end_gap_extend_penalty=end_gap_extend_penalty)
+
+ # Check that something was returned.
+ self.assertNotEqual(align, None)
+
+ # Check some of the data.
+ for i in range(8):
+ print("Checking \"%s\"" % ids[i])
+ self.assertEqual(self.seq_align[0].object_ids[i], object_ids[i])
+ self.assertEqual(self.seq_align[0].models[i], models[i])
+ self.assertEqual(self.seq_align[0].molecules[i], molecules[i])
+
+
+ def test_find_missing_alignment(self):
+ """Test the retrieval of non-existent alignment."""
+
+ # Execute the body of the test_alignment_addition() unit test to set
up the object.
+ self.test_alignment_addition()
+
+ # The identifying data.
+ object_ids, models, molecules, sequences, strings, gaps,
msa_algorithm, pairwise_algorithm, matrix, gap_open_penalty,
gap_extend_penalty, end_gap_open_penalty, end_gap_extend_penalty =
self.return_align_data()
+
+ # Change a gap penalty.
+ gap_open_penalty = 0.5
+
+ # Retrieve the alignment.
+ align = self.seq_align.find_alignment(object_ids=object_ids,
models=models, molecules=molecules, sequences=sequences,
msa_algorithm=msa_algorithm, pairwise_algorithm=pairwise_algorithm,
matrix=matrix, gap_open_penalty=gap_open_penalty,
gap_extend_penalty=gap_extend_penalty,
end_gap_open_penalty=end_gap_open_penalty,
end_gap_extend_penalty=end_gap_extend_penalty)
+
+ # Check that nothing was returned.
+ self.assertEqual(align, None)
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits