mailr28112 - in /trunk/test_suite/system_tests: scripts/structure/ scripts/structure/pca.py structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on November 25, 2015 - 18:38:
Author: bugman
Date: Wed Nov 25 18:38:23 2015
New Revision: 28112

URL: http://svn.gna.org/viewcvs/relax?rev=28112&view=rev
Log:
Created an initial Structure.test_pca system test.

This executes the new structure.pca user function, and checks if data is 
stored in cdp.structure.

Added:
    trunk/test_suite/system_tests/scripts/structure/
    trunk/test_suite/system_tests/scripts/structure/pca.py
Modified:
    trunk/test_suite/system_tests/structure.py

Added: trunk/test_suite/system_tests/scripts/structure/pca.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/scripts/structure/pca.py?rev=28112&view=auto
==============================================================================
--- trunk/test_suite/system_tests/scripts/structure/pca.py      (added)
+++ trunk/test_suite/system_tests/scripts/structure/pca.py      Wed Nov 25 
18:38:23 2015
@@ -0,0 +1,28 @@
+# Python module imports.
+from os import sep
+
+# relax imports.
+from data_store import Relax_data_store; ds = Relax_data_store()
+from status import Status; status = Status()
+
+
+# Missing temp directory (allow this script to run outside of the system 
test framework).
+if not hasattr(ds, 'tmpdir'):
+    ds.tmpdir = 'temp_script'
+
+# Create a data pipe.
+pipe.create('pca test', 'N-state')
+
+# Load the structures.
+path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'+sep+'pca'
+structure.read_pdb('distribution.pdb', dir=path, read_mol=1, 
set_mol_name='CaM A')
+structure.read_pdb('distribution.pdb', dir=path, read_mol=4, 
set_mol_name='CaM A', merge=True)
+
+# Sequence alignment.
+structure.sequence_alignment(msa_algorithm='residue number')
+
+# PCA analysis.
+structure.pca(dir=ds.tmpdir)
+
+# Save the program state.
+state.save(force=True, dir=ds.tmpdir)

Modified: trunk/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=28112&r1=28111&r2=28112&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py  (original)
+++ trunk/test_suite/system_tests/structure.py  Wed Nov 25 18:38:23 2015
@@ -4130,6 +4130,18 @@
             self.assertEqual(contents[i], lines[i])
 
 
+    def test_pca(self):
+        """Test the principle component analysis of the structure.pca user 
function."""
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'structure'+sep+'pca.py')
+
+        # Checks.
+        self.assert_(hasattr(cdp.structure, 'pca_values'))
+        self.assert_(hasattr(cdp.structure, 'pca_vectors'))
+        self.assert_(hasattr(cdp.structure, 'pca_proj'))
+
+
     def test_pdb_combined_secondary_structure(self):
         """Test the handling of secondary structure metadata when combining 
multiple PDB structures."""
 




Related Messages


Powered by MHonArc, Updated Wed Nov 25 18:40:03 2015