Open main menu

Changes

Tutorial for model free SBiNLab

2,299 bytes added, 07:08, 16 October 2017
rm -rf result_06_check_intermediate
relax 06_check_intermediate.py -t 06_check_intermediate.log
</source>
 
=== 06_check_intermediate_spin_info.py - Spin info ===
We would like to extract more info from the spin_containers in the final run.
 
Make a '''06_check_intermediate_spin_info.py''' file, with this content.
 
{| class="mw-collapsible mw-collapsed wikitable"
! See file content
|-
|
<source lang="python">
# Python module imports.
import os, stat
 
# relax module imports.
from specific_analyses.model_free.model import determine_model_type
import lib.io
from pipe_control import pipes
from pipe_control.mol_res_spin import spin_loop
 
# Read the state with the setup
var = 'result_06_check_intermediate'
results_dir = os.getcwd() + os.sep + var + os.sep + 'final'
# Load the state with setup data.
state.load(state='results.bz2', dir=results_dir, force=True)
 
# Show pipes
pipe.display()
pipe_name = pipes.cdp_name()
pipe_bundle = pipes.get_bundle(pipe_name)
 
# Get model
value.write(param='model', file='model.txt', dir=results_dir, force=True)
# Get equation
value.write(param='equation', file='equation.txt', dir=results_dir, force=True)
 
# Inspect manually
out_results = []
i=0
for c_s, c_s_mol, c_s_resi, c_s_resn, c_s_id in spin_loop(full_info=True, return_id=True, skip_desel=True):
# See what we can extract from the spin container
if i == 0:
print dir(c_s)
 
# First convert to string
c_s_resi = str(c_s_resi)
# Append
out_results.append([c_s_mol, c_s_resi, c_s_resn, c_s.element, c_s_id, c_s.model, c_s.equation])
# Print
print("mol: %s, resi: %s, resn: %s, element: %s, id: %s, model: %s, equation: %s" % tuple(out_results[-1]) )
i += 1
 
# Write file
file_name = "results_collected_spin_info.txt"
file_path = lib.io.get_file_path(file_name, results_dir)
file = lib.io.open_write_file(file_path, force=True)
 
# Write the file.
headings = ["mol", "resi", "resn", "element", "id", "model", "equation"]
lib.io.write_data(out=file, headings=headings, data=out_results)
file.close()
</source>
|}
 
Run with relax
<source lang="bash">
relax 06_check_intermediate_spin_info.py
</source>
From the above run of check_intermediate, we can inspect grace images.
We could also make more graphs, if the right informationis contained in the relax data pipe.Specifically, since we have problems with convergence, we would like to see the chi2value per iteration for the different models. This is not so easy to get, and we haveto make a script, that loads each result file per '''round''' folder and extract the chi2 value.
Make a '''06_check_intermediate_grace_extra.py ''' file, with this content.
Trusted, Bureaucrats
1,382

edits