mailr16356 - /1.3/sample_scripts/model_free/bmrb_deposition.py


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

Header


Content

Posted by edward on May 21, 2012 - 09:37:
Author: bugman
Date: Mon May 21 09:37:25 2012
New Revision: 16356

URL: http://svn.gna.org/viewcvs/relax?rev=16356&view=rev
Log:
Created a sample script for BMRB data deposition.


Added:
    1.3/sample_scripts/model_free/bmrb_deposition.py
      - copied, changed from r16355, 
1.3/test_suite/system_tests/scripts/bmrb_rw.py

Copied: 1.3/sample_scripts/model_free/bmrb_deposition.py (from r16355, 
1.3/test_suite/system_tests/scripts/bmrb_rw.py)
URL: 
http://svn.gna.org/viewcvs/relax/1.3/sample_scripts/model_free/bmrb_deposition.py?p2=1.3/sample_scripts/model_free/bmrb_deposition.py&p1=1.3/test_suite/system_tests/scripts/bmrb_rw.py&r1=16355&r2=16356&rev=16356&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/scripts/bmrb_rw.py (original)
+++ 1.3/sample_scripts/model_free/bmrb_deposition.py Mon May 21 09:37:25 2012
@@ -1,67 +1,58 @@
-# Script for testing the reading and writing of BMRB files.
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2012 Edward d'Auvergne                                       
 #
+#                                                                            
 #
+# This file is part of the program relax.                                    
 #
+#                                                                            
 #
+# relax is free software; you can redistribute it and/or modify              
 #
+# it under the terms of the GNU General Public License as published by       
 #
+# the Free Software Foundation; either version 2 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# relax is distributed in the hope that it will be useful,                   
 #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
+# GNU General Public License for more details.                               
 #
+#                                                                            
 #
+# You should have received a copy of the GNU General Public License          
 #
+# along with relax; if not, write to the Free Software                       
 #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
+#                                                                            
 #
+###############################################################################
 
-# Python module imports.
-import sys
-from os import sep
-
-# relax module imports.
-from data import Relax_data_store; ds = Relax_data_store()
-from status import Status; status = Status()
+"""Script for creating a NMR-STAR 3.1 formatted file for BMRB deposition of 
model-free results."""
 
 
-# Missing temp file (allow this script to run outside of the system test 
framework).
-state_file = 'devnull'
-if not hasattr(ds, 'tmpfile'):
-    stand_alone = True
-    ds.tmpfile = 'temp_bmrb'
-    ds.version = '3.1'
-    state_file = 'temp_bmrb_state'
-
-# Create the data pipe.
-pipe.create(pipe_name='results', pipe_type='mf')
+# Create a data pipe to hold the final model-free results.
+pipe.create(pipe_name='final_results', pipe_type='mf')
 
 # Read the results.
-results.read(file='final_results_trunc_1.3', dir=status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'OMP')
+results.read(file='results.bz2', dir='final')
 
-# Play with the data.
-deselect.all()
-spin.copy(spin_from=':9', spin_to=':9@NE')
-select.spin(':9')
-select.spin(':10')
-select.spin(':11')
-spin.name(name='N')
-spin.element(element='N')
-molecule.name(name='OMP')
+# Set up the molecule information.
+molecule.name(name='Ap4Aase')
 molecule.type(type='protein')
 bmrb.thiol_state(state='reduced')
 
-# Display the data (as a test).
-relax_data.display(ri_id='R1_800')
-
 # Temperature control and peak intensity type.
 ri_ids = ['R1_600', 'R2_600', 'NOE_600', 'R1_800', 'R2_800', 'NOE_800']
-for i in range(6):
+for i in range(len(ri_ids)):
     relax_data.temp_calibration(ri_id=ri_ids[i], method='methanol')
     relax_data.temp_control(ri_id=ri_ids[i], method='single fid 
interleaving')
     relax_data.peak_intensity_type(ri_id=ri_ids[i], type='height')
 
-# Set up some BMRB information.
+# The software used for the analysis.
 bmrb.software_select('NMRPipe')
 bmrb.software_select('Sparky', version='3.106')
-bmrb.citation(cite_id='test', authors=[["Edward", "d'Auvergne", "E.", "J."], 
["Paul", "Gooley", "P.", "R."]], doi="10.1039/b702202f", 
pubmed_id="17579774", full_citation="d'Auvergne E. J., Gooley P. R. (2007). 
Set theory formulation of the model-free problem and the diffusion seeded 
model-free paradigm. Mol. Biosyst., 3(7), 483-494.", title="Set theory 
formulation of the model-free problem and the diffusion seeded model-free 
paradigm.", status="published", type="journal", journal_abbrev="Mol. 
Biosyst.", journal_full="Molecular Biosystems", volume=3, issue=7, 
page_first=483, page_last=498, year=2007)
-bmrb.software(name='X', url='http://www.nmr-relax.com', vendor_name='me', 
cite_ids=['test'], tasks=['procrastinating', 'nothing much', 'wasting time'])
-bmrb.script(file='noe.py', dir=status.install_path+sep+'sample_scripts', 
analysis_type='noe', engine='relax')
-bmrb.script(file='relax_fit.py', 
dir=status.install_path+sep+'sample_scripts', analysis_type='relax_fit', 
engine='relax')
-bmrb.script(file='dauvergne_protocol.py', 
dir=status.install_path+sep+'sample_scripts'+sep+'model_free', 
analysis_type='mf', model_selection='AIC', engine='relax', model_elim=True, 
universal_solution=True)
+bmrb.software(name='X', url='http://www.nmr-relax.com', vendor_name='me', 
cite_ids=['dAuvergneGooley07'], tasks=['procrastinating', 'nothing much', 
'wasting time'])
 
-# Write, then read the data to a new data pipe.
-bmrb.write(file=ds.tmpfile, dir=None, version=ds.version, force=True)
-pipe.create(pipe_name='new', pipe_type='mf')
-bmrb.read(file=ds.tmpfile, version=ds.version)
+# All relevant citations.
+bmrb.citation(cite_id='dAuvergneGooley07', authors=[["Edward", "d'Auvergne", 
"E.", "J."], ["Paul", "Gooley", "P.", "R."]], doi="10.1039/b702202f", 
pubmed_id="17579774", full_citation="d'Auvergne E. J., Gooley P. R. (2007). 
Set theory formulation of the model-free problem and the diffusion seeded 
model-free paradigm. Mol. Biosyst., 3(7), 483-494.", title="Set theory 
formulation of the model-free problem and the diffusion seeded model-free 
paradigm.", status="published", type="journal", journal_abbrev="Mol. 
Biosyst.", journal_full="Molecular Biosystems", volume=3, issue=7, 
page_first=483, page_last=498, year=2007)
 
-# Display tests.
-sequence.display()
-relax_data.display(ri_id='R1_800')
+# Add the scripts used in the relaxation data and model-free analyses.
+bmrb.script(file='noe.py', dir='relax_data', analysis_type='noe', 
engine='relax')
+bmrb.script(file='relax_fit.py', dir='relax_data', 
analysis_type='relax_fit', engine='relax')
+bmrb.script(file='dauvergne_protocol.py', dir='model_free', 
analysis_type='mf', model_selection='AIC', engine='relax', model_elim=True, 
universal_solution=True)
 
-# Save the program state.
-state.save(state_file, force=True)
+# Write out the BMRB NMR-STAR file.
+bmrb.write(file='bmrb.star', dir=None, version='3.1', force=True)




Related Messages


Powered by MHonArc, Updated Mon May 21 22:40:02 2012