Author: bugman
Date: Sat Jan 31 15:17:09 2015
New Revision: 27429

URL: http://svn.gna.org/viewcvs/relax?rev=27429&view=rev
Log:
Created the Structure.test_sequence_alignment_residue_number system test.

This will be used to test the structure.sequence_alignment user function 
together with the 'residue
number' MSA algorithm.  This is simply a copy of the
Structure.test_sequence_alignment_central_star_nw70_blosum62 system test with a 
few small changes.


Modified:
    trunk/test_suite/system_tests/structure.py

Modified: trunk/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=27429&r1=27428&r2=27429&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py  (original)
+++ trunk/test_suite/system_tests/structure.py  Sat Jan 31 15:17:09 2015
@@ -4719,6 +4719,82 @@
             self.assertEqual(ds.sequence_alignments[0].end_gap_extend_penalty, 
end_gap_extend_penalty)
 
 
+    def test_sequence_alignment_residue_number(self):
+        """Test of the structure.sequence_alignment user function using the 
'residue number' MSA algorithm."""
+
+        # Path of the structure file.
+        path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'cam'
+
+        # Load the two rotated structures.
+        self.interpreter.structure.read_pdb('1J7P_1st_NH.pdb', dir=path, 
set_model_num=1, set_mol_name='CaM A')
+        self.interpreter.structure.read_pdb('1J7P_1st_NH_rot.pdb', dir=path, 
set_model_num=1, set_mol_name='CaM B')
+
+        # Delete some residues.
+        self.interpreter.structure.delete("#CaM B:82")
+        self.interpreter.structure.delete("#CaM A:100-120")
+
+        # Perform the alignment.
+        self.interpreter.structure.sequence_alignment(pipes=['mf'], 
models=[[1, 1]], molecules=[['CaM A', 'CaM B']], msa_algorithm='residue number')
+
+        # Save the relax state.
+        self.tmpfile = mktemp()
+        self.interpreter.state.save(self.tmpfile, dir=None, force=True)
+
+        # Reset relax.
+        self.interpreter.reset()
+
+        # Load the results.
+        self.interpreter.state.load(self.tmpfile)
+
+        # The real data.
+        pipes = ['mf', 'mf']
+        models = [1, 1]
+        molecules = ['CaM A', 'CaM B']
+        ids = ["Object 'mf'; Model 1; Molecule 'CaM A'", "Object 'mf'; Model 
1; Molecule 'CaM B'"]
+        sequences = [
+            'EEEIREAFRVFDKDGNGYVDEMIREADIDGDGQVNYEEFVQMMTAK**',
+            
'EEIREAFRVFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIREADIDGDGQVNYEEFVQMMTAK**'
+        ]
+        strings = [
+            
'EEEIREAFRVFDKDGNGY---------------------VDEMIREADIDGDGQVNYEEFVQMMTAK**',
+            
'-EEIREAFRVFDKDGNGYISAAELRHVMTNLGEKLTDEEVDEMIREADIDGDGQVNYEEFVQMMTAK**'
+        ]
+        gaps = []
+        for i in range(len(strings)):
+            gaps.append([])
+            for j in range(len(strings[0])):
+                gaps[i].append(0)
+        for i in range(18, 39):
+            gaps[0][i] = 1
+        gaps[1][0] = 1
+        msa_algorithm = 'Central Star'
+        pairwise_algorithm = 'NW70'
+        matrix = 'BLOSUM62'
+        gap_open_penalty = 10.0
+        gap_extend_penalty = 1.0
+        end_gap_open_penalty = 0.5
+        end_gap_extend_penalty = 0.1
+
+        # Check the data.
+        for i in range(2):
+            print("Checking \"%s\"" % molecules[i])
+            self.assertEqual(ds.sequence_alignments[0].ids[i], ids[i])
+            self.assertEqual(ds.sequence_alignments[0].object_ids[i], pipes[i])
+            self.assertEqual(ds.sequence_alignments[0].models[i], models[i])
+            self.assertEqual(ds.sequence_alignments[0].molecules[i], 
molecules[i])
+            self.assertEqual(ds.sequence_alignments[0].sequences[i], 
sequences[i])
+            self.assertEqual(ds.sequence_alignments[0].strings[i], strings[i])
+            for j in range(len(strings[0])):
+                self.assertEqual(ds.sequence_alignments[0].gaps[i, j], 
gaps[i][j])
+            self.assertEqual(ds.sequence_alignments[0].msa_algorithm, 
msa_algorithm)
+            self.assertEqual(ds.sequence_alignments[0].pairwise_algorithm, 
pairwise_algorithm)
+            self.assertEqual(ds.sequence_alignments[0].matrix, matrix)
+            self.assertEqual(ds.sequence_alignments[0].gap_open_penalty, 
gap_open_penalty)
+            self.assertEqual(ds.sequence_alignments[0].gap_extend_penalty, 
gap_extend_penalty)
+            self.assertEqual(ds.sequence_alignments[0].end_gap_open_penalty, 
end_gap_open_penalty)
+            self.assertEqual(ds.sequence_alignments[0].end_gap_extend_penalty, 
end_gap_extend_penalty)
+
+
     def test_superimpose_fit_to_first(self):
         """Test of the structure.superimpose user function, fitting to the 
first structure."""
 


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

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

Reply via email to