


                                  relax repository checkout r18624
                svn+ssh://bugman@svn.gna.org/svn/relax/branches/frame_order_testing

                              Molecular dynamics by NMR data analysis

                             Copyright (C) 2001-2006 Edward d'Auvergne
                         Copyright (C) 2006-2013 the relax development team

This is free software which you are welcome to modify and redistribute under the conditions of the
GNU General Public License (GPL).  This program, including all modules, is licensed under the GPL
and comes with absolutely no warranty.  For details type 'GPL' within the relax prompt.

Assistance in using the relax prompt and scripting interface can be accessed by typing 'help' within
the prompt.

Processor fabric:  Uni-processor.

script = 'rigid_test.py'
----------------------------------------------------------------------------------------------------
###############################################################################
#                                                                             #
# Copyright (C) 2004-2013 Edward d'Auvergne                                   #
#                                                                             #
# This file is part of the program relax (http://www.nmr-relax.com).          #
#                                                                             #
# This program 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 3 of the License, or           #
# (at your option) any later version.                                         #
#                                                                             #
# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.       #
#                                                                             #
###############################################################################

"""Script for testing translation and rotation in the frame order analyses.

This script should be run from the directory where it is found with the commands:

$ ../../../../relax full_analysis.py
"""

# Python module imports.
from numpy import array, float64


# Create the data pipe.
pipe.create(pipe_name='rigid test', pipe_type='frame order')

# Read the structures.
structure.read_pdb('displaced.pdb', set_mol_name='fancy_mol')

# Set up the 15N and 1H spins.
structure.load_spins()
spin.isotope(isotope='15N', spin_id='@N')
spin.isotope(isotope='1H', spin_id='@H')

# Define the magnetic dipole-dipole relaxation interaction.
dipole_pair.define(spin_id1='@N', spin_id2='@H', direct_bond=True)
dipole_pair.set_dist(spin_id1='@N', spin_id2='@H', ave_dist=1.041 * 1e-10)
dipole_pair.unit_vectors()

# The lanthanides and data files.
ln = ['dy', 'tb', 'tm', 'er', 'yb', 'ho']
pcs_files = [
    'pcs_dy.txt',
    'pcs_tb.txt',
    'pcs_tm.txt',
    'pcs_er.txt',
    'pcs_yb.txt',
    'pcs_ho.txt'
]
rdc_files = [
    'rdc_dy.txt',
    'rdc_tb.txt',
    'rdc_tm.txt',
    'rdc_er.txt',
    'rdc_yb.txt',
    'rdc_ho.txt'
]

# Loop over the alignments.
for i in range(len(ln)):
    # Load the RDCs.
    rdc.read(align_id=ln[i], file=rdc_files[i], dir='.', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4)

    # The PCS (only a subset of ~5 spins for fast initial optimisations).
    pcs.read(align_id=ln[i], file=pcs_files[i], dir='.', mol_name_col=1, res_num_col=2, spin_name_col=5, data_col=6, error_col=7)

    # The temperature and field strength.
    temperature(id=ln[i], temp=303.0)
    frq.set(id=ln[i], frq=800.0, units="MHz")

# Load the tensors (the full tensors).
align_tensor.init(tensor='Dy fixed', align_id='dy', params=(-0.000283041921495, 0.00017331020651, 0.000348144461756, 0.00109678563394, -0.000261126459214), param_types=2)
align_tensor.init(tensor='Dy fixed', align_id='dy', params=(1.32405973595e-05, 1.69451339335e-05, 1.11420056339e-05, 1.2902359091e-05, 1.06231229491e-05), param_types=2, errors=True)
align_tensor.init(tensor='Tb fixed', align_id='tb', params=(0.000167738428636, -0.000311103377008, 0.000231043994111, 0.000927908442481, -0.00042448381621), param_types=2)
align_tensor.init(tensor='Tb fixed', align_id='tb', params=(9.23106516114e-06, 1.23864406564e-05, 9.25138110416e-06, 1.0025121852e-05, 8.6027985631e-06), param_types=2, errors=True)
align_tensor.init(tensor='Tm fixed', align_id='tm', params=(-0.000214531334757, 0.000250016686133, -0.000318452894707, -0.000566585709341, 0.000458689017372), param_types=2)
align_tensor.init(tensor='Tm fixed', align_id='tm', params=(8.18656207912e-06, 1.09649975373e-05, 8.43998269558e-06, 8.63599444168e-06, 7.95937745247e-06), param_types=2, errors=True)
align_tensor.init(tensor='Er fixed', align_id='er', params=(-9.34632913359e-05, 7.71986454118e-05, -0.000234020357448, -0.000363596427557, 0.000177874820425), param_types=2)
align_tensor.init(tensor='Er fixed', align_id='er', params=(6.32851257036e-06, 9.3721066722e-06, 7.36682050165e-06, 7.52806731357e-06, 9.79003188793e-06), param_types=2, errors=True)
align_tensor.init(tensor='Yb fixed', align_id='yb', params=(2.20524016343e-05, -6.04903356962e-05, -0.000114723702615, -0.000214855846027, 0.000143730520814), param_types=2)
align_tensor.init(tensor='Yb fixed', align_id='yb', params=(4.2812326053e-06, 5.43186247053e-06, 4.83605375312e-06, 5.10468453851e-06, 4.31847329676e-06), param_types=2, errors=True)
align_tensor.init(tensor='Ho fixed', align_id='ho', params=(-6.99147985047e-05, -8.00899711508e-06, 0.000102219102441, 0.000424559081645, -0.000255281322523), param_types=2)
align_tensor.init(tensor='Ho fixed', align_id='ho', params=(7.74711876341e-06, 9.55677606858e-06, 9.13852550558e-06, 7.82230105216e-06, 7.33515152376e-06), param_types=2, errors=True)

# Define the domains.
domain(id='moving', spin_id=":0-100")
domain(id='fixed', spin_id=":101-200")

# The tensor domains and reductions.
full = ['Dy fixed', 'Tb fixed', 'Tm fixed', 'Er fixed', 'Yb fixed', 'Ho fixed']
red =  ['Dy moving', 'Tb moving', 'Tm moving', 'Er moving', 'Yb moving', 'Ho moving']
for i in range(len(full)):
    # Initialise the reduced tensors (fitted during optimisation).
    align_tensor.init(tensor=red[i], align_id=ln[i], params=(0, 0, 0, 0, 0))

    # Set the domain info.
    align_tensor.set_domain(tensor=full[i], domain='fixed')
    align_tensor.set_domain(tensor=red[i], domain='moving')

    # Specify which tensor is reduced.
    align_tensor.reduction(full_tensor=full[i], red_tensor=red[i])

# Set the reference domain.
frame_order.ref_domain('fixed')

# Link the domains to the PDB files.
frame_order.domain_to_pdb(domain='fixed', pdb='displaced.pdb')

# Allow the average domain to be translated during optimisation.
frame_order.ave_pos_translate()

# Set the initial pivot point (should make no difference for the rigid model).
pivot = array([0, 0, 0], float64)
frame_order.pivot(pivot, fix=True)

# Set the paramagnetic centre position.
paramag.centre(pos=[-5, -7, -9])

# Set the number of integration points.
frame_order.num_int_pts(10000)

# Set the real parameter values (the inverted displacement values).
cdp.ave_pos_x = -1
cdp.ave_pos_y = -2
cdp.ave_pos_z = -3
cdp.ave_pos_alpha = 0.14159265359
cdp.ave_pos_beta  = 2.0
cdp.ave_pos_gamma = 2.14159265359

# Set some parameters close to zero, but far enough away from zero to allow for the numerical integration.
cdp.cone_s1 = 0.99
cdp.cone_theta = 0.1
cdp.cone_theta_x = 0.1
cdp.cone_theta_y = 0.1
cdp.cone_sigma_max = 0.1

# Loop over all frame order models, showing that they should all have a chi-squared close to zero.
for model in ['rigid', 'free rotor', 'rotor', 'iso cone, torsionless', 'iso cone, free rotor', 'iso cone', 'pseudo-ellipse, torsionless', 'pseudo-ellipse']:
    # Print out.
    text = "# Model: %s" % model
    print("\n\n%s\n%s" % (text, '#'*len(text)))

    # Select the Frame Order model.
    frame_order.select_model(model=model)

    # Calculate the chi2 value.
    calc()

    # Attempt to mimimise.
    #minimise('simplex', constraints=False)
----------------------------------------------------------------------------------------------------

relax> pipe.create(pipe_name='rigid test', pipe_type='frame order', bundle=None)

relax> structure.read_pdb(file='displaced.pdb', dir=None, read_mol=None, set_mol_name='fancy_mol', read_model=None, set_model_num=None, parser='internal', alt_loc=None)

Internal relax PDB parser.
Opening the file 'displaced.pdb' for reading.
Adding molecule 'fancy_mol' to model None (from the original molecule number 1 of model None)

relax> structure.load_spins(spin_id=None, mol_name_target=None, ave_pos=True)
Adding the following spins to the relax data store.

# mol_name    res_num    res_name    spin_num    spin_name    
fancy_mol     0          GLY         1           N            
fancy_mol     0          GLY         2           H            
fancy_mol     1          GLY         3           N            
fancy_mol     1          GLY         4           H            
fancy_mol     2          GLY         5           N            
fancy_mol     2          GLY         6           H            
fancy_mol     3          GLY         7           N            
fancy_mol     3          GLY         8           H            
fancy_mol     4          GLY         9           N            
fancy_mol     4          GLY         10          H            
fancy_mol     5          GLY         11          N            
fancy_mol     5          GLY         12          H            
fancy_mol     6          GLY         13          N            
fancy_mol     6          GLY         14          H            
fancy_mol     7          GLY         15          N            
fancy_mol     7          GLY         16          H            
fancy_mol     8          GLY         17          N            
fancy_mol     8          GLY         18          H            
fancy_mol     9          GLY         19          N            
fancy_mol     9          GLY         20          H            
fancy_mol     10         GLY         21          N            
fancy_mol     10         GLY         22          H            
fancy_mol     11         GLY         23          N            
fancy_mol     11         GLY         24          H            
fancy_mol     12         GLY         25          N            
fancy_mol     12         GLY         26          H            
fancy_mol     13         GLY         27          N            
fancy_mol     13         GLY         28          H            

relax> spin.isotope(isotope='15N', spin_id='@N', force=False)

relax> spin.isotope(isotope='1H', spin_id='@H', force=False)

relax> dipole_pair.define(spin_id1='@N', spin_id2='@H', direct_bond=True)
Magnetic dipole-dipole interactions are now defined for the following spins:

# Spin_ID_1          Spin_ID_2            
'#fancy_mol:0@N'     '#fancy_mol:0@H'     
'#fancy_mol:1@N'     '#fancy_mol:1@H'     
'#fancy_mol:2@N'     '#fancy_mol:2@H'     
'#fancy_mol:3@N'     '#fancy_mol:3@H'     
'#fancy_mol:4@N'     '#fancy_mol:4@H'     
'#fancy_mol:5@N'     '#fancy_mol:5@H'     
'#fancy_mol:6@N'     '#fancy_mol:6@H'     
'#fancy_mol:7@N'     '#fancy_mol:7@H'     
'#fancy_mol:8@N'     '#fancy_mol:8@H'     
'#fancy_mol:9@N'     '#fancy_mol:9@H'     
'#fancy_mol:10@N'    '#fancy_mol:10@H'    
'#fancy_mol:11@N'    '#fancy_mol:11@H'    
'#fancy_mol:12@N'    '#fancy_mol:12@H'    
'#fancy_mol:13@N'    '#fancy_mol:13@H'    

relax> dipole_pair.set_dist(spin_id1='@N', spin_id2='@H', ave_dist=1.0409999999999999e-10, unit='meter')
The following averaged distances have been set:

# Spin_ID_1          Spin_ID_2            Ave_distance(meters)      
'#fancy_mol:0@N'     '#fancy_mol:0@H'     1.0409999999999999e-10    
'#fancy_mol:1@N'     '#fancy_mol:1@H'     1.0409999999999999e-10    
'#fancy_mol:2@N'     '#fancy_mol:2@H'     1.0409999999999999e-10    
'#fancy_mol:3@N'     '#fancy_mol:3@H'     1.0409999999999999e-10    
'#fancy_mol:4@N'     '#fancy_mol:4@H'     1.0409999999999999e-10    
'#fancy_mol:5@N'     '#fancy_mol:5@H'     1.0409999999999999e-10    
'#fancy_mol:6@N'     '#fancy_mol:6@H'     1.0409999999999999e-10    
'#fancy_mol:7@N'     '#fancy_mol:7@H'     1.0409999999999999e-10    
'#fancy_mol:8@N'     '#fancy_mol:8@H'     1.0409999999999999e-10    
'#fancy_mol:9@N'     '#fancy_mol:9@H'     1.0409999999999999e-10    
'#fancy_mol:10@N'    '#fancy_mol:10@H'    1.0409999999999999e-10    
'#fancy_mol:11@N'    '#fancy_mol:11@H'    1.0409999999999999e-10    
'#fancy_mol:12@N'    '#fancy_mol:12@H'    1.0409999999999999e-10    
'#fancy_mol:13@N'    '#fancy_mol:13@H'    1.0409999999999999e-10    

relax> dipole_pair.unit_vectors(ave=True)
Averaging all vectors.
Calculated 1 N-H unit vector between the spins '#fancy_mol:0@N' and '#fancy_mol:0@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:1@N' and '#fancy_mol:1@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:2@N' and '#fancy_mol:2@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:3@N' and '#fancy_mol:3@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:4@N' and '#fancy_mol:4@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:5@N' and '#fancy_mol:5@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:6@N' and '#fancy_mol:6@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:7@N' and '#fancy_mol:7@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:8@N' and '#fancy_mol:8@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:9@N' and '#fancy_mol:9@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:10@N' and '#fancy_mol:10@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:11@N' and '#fancy_mol:11@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:12@N' and '#fancy_mol:12@H'.
Calculated 1 N-H unit vector between the spins '#fancy_mol:13@N' and '#fancy_mol:13@H'.

relax> rdc.read(align_id='dy', file='rdc_dy.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_dy.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H       -9.167726231480437                    None    
#fancy_mol:1@N     #fancy_mol:1@H       -9.167726231480437                    None    
#fancy_mol:2@N     #fancy_mol:2@H        5.613516605642060                    None    
#fancy_mol:3@N     #fancy_mol:3@H        5.613516605642060                    None    
#fancy_mol:4@N     #fancy_mol:4@H        3.554209625838377                    None    
#fancy_mol:5@N     #fancy_mol:5@H        3.554209625838377                    None    
#fancy_mol:6@N     #fancy_mol:6@H       25.562262046494947                    None    
#fancy_mol:7@N     #fancy_mol:7@H       25.562262046494947                    None    
#fancy_mol:8@N     #fancy_mol:8@H      -36.839441423200029                    None    
#fancy_mol:9@N     #fancy_mol:9@H      -36.839441423200029                    None    
#fancy_mol:10@N    #fancy_mol:10@H      21.804245234937383                    None    
#fancy_mol:11@N    #fancy_mol:11@H      21.804245234937383                    None    
#fancy_mol:12@N    #fancy_mol:12@H     -10.527065858232305                    None    
#fancy_mol:13@N    #fancy_mol:13@H     -10.527065858232305                    None    

relax> pcs.read(align_id='dy', file='pcs_dy.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_dy.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N               0.381591678950299    None         
fancy_mol     0          None        None        H              -1.045782626935530    None         
fancy_mol     1          None        None        N               3.222491549737241    None         
fancy_mol     1          None        None        H               2.871531885350636    None         
fancy_mol     2          None        None        N               9.184654818533405    None         
fancy_mol     2          None        None        H              10.055301669871810    None         
fancy_mol     3          None        None        N               1.620383385368995    None         
fancy_mol     3          None        None        H               1.337945169559467    None         
fancy_mol     4          None        None        N               8.341697973983985    None         
fancy_mol     4          None        None        H               8.838342806062290    None         
fancy_mol     5          None        None        N               1.808690819550863    None         
fancy_mol     5          None        None        H               1.527322753303476    None         
fancy_mol     6          None        None        N               1.593168613826736    None         
fancy_mol     6          None        None        H               1.845648733697696    None         
fancy_mol     7          None        None        N              15.536678634195614    None         
fancy_mol     7          None        None        H              12.285792652714894    None         
fancy_mol     8          None        None        N               0.534682911048748    None         
fancy_mol     8          None        None        H               0.889449438534435    None         
fancy_mol     9          None        None        N               8.178477910520167    None         
fancy_mol     9          None        None        H               8.167522129575378    None         
fancy_mol     10         None        None        N               3.373241782100002    None         
fancy_mol     10         None        None        H               3.651954710083263    None         
fancy_mol     11         None        None        N               1.738076920275070    None         
fancy_mol     11         None        None        H               2.289711906996397    None         
fancy_mol     12         None        None        N               2.734479681568111    None         
fancy_mol     12         None        None        H               3.104245436667263    None         
fancy_mol     13         None        None        N               2.051382392621004    None         
fancy_mol     13         None        None        H               2.598394838840286    None         

relax> temperature(id='dy', temp=303.0)

relax> frq.set(id='dy', frq=800.0, units='MHz')

relax> rdc.read(align_id='tb', file='rdc_tb.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_tb.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H        5.433046751912797                    None    
#fancy_mol:1@N     #fancy_mol:1@H        5.433046751912797                    None    
#fancy_mol:2@N     #fancy_mol:2@H      -10.076636616349330                    None    
#fancy_mol:3@N     #fancy_mol:3@H      -10.076636616349330                    None    
#fancy_mol:4@N     #fancy_mol:4@H        4.643589864436533                    None    
#fancy_mol:5@N     #fancy_mol:5@H        4.643589864436533                    None    
#fancy_mol:6@N     #fancy_mol:6@H       15.859622964942446                    None    
#fancy_mol:7@N     #fancy_mol:7@H       15.859622964942446                    None    
#fancy_mol:8@N     #fancy_mol:8@H      -34.191660830111154                    None    
#fancy_mol:9@N     #fancy_mol:9@H      -34.191660830111154                    None    
#fancy_mol:10@N    #fancy_mol:10@H      24.213642618770717                    None    
#fancy_mol:11@N    #fancy_mol:11@H      24.213642618770717                    None    
#fancy_mol:12@N    #fancy_mol:12@H      -5.881604753602003                    None    
#fancy_mol:13@N    #fancy_mol:13@H      -5.881604753602003                    None    

relax> pcs.read(align_id='tb', file='pcs_tb.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_tb.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N              -2.595639770905467    None         
fancy_mol     0          None        None        H              -3.815439630990876    None         
fancy_mol     1          None        None        N               2.483705143691746    None         
fancy_mol     1          None        None        H               2.321009154644442    None         
fancy_mol     2          None        None        N               7.847176096718653    None         
fancy_mol     2          None        None        H               9.147759548425455    None         
fancy_mol     3          None        None        N               0.052785854111965    None         
fancy_mol     3          None        None        H              -0.084436278862352    None         
fancy_mol     4          None        None        N               3.419532470872468    None         
fancy_mol     4          None        None        H               3.429299246694192    None         
fancy_mol     5          None        None        N               0.986771041951341    None         
fancy_mol     5          None        None        H               0.848603084304595    None         
fancy_mol     6          None        None        N               0.850336260080253    None         
fancy_mol     6          None        None        H               0.975406030104386    None         
fancy_mol     7          None        None        N               5.130716724183375    None         
fancy_mol     7          None        None        H               4.688490862917817    None         
fancy_mol     8          None        None        N              -0.667885944031236    None         
fancy_mol     8          None        None        H              -0.483784454223244    None         
fancy_mol     9          None        None        N               7.650974167380636    None         
fancy_mol     9          None        None        H               7.037593817528286    None         
fancy_mol     10         None        None        N               2.928444569072922    None         
fancy_mol     10         None        None        H               3.030781802802175    None         
fancy_mol     11         None        None        N              -2.165271066700960    None         
fancy_mol     11         None        None        H              -1.537543005584773    None         
fancy_mol     12         None        None        N               1.280273178929380    None         
fancy_mol     12         None        None        H               1.464871139882033    None         
fancy_mol     13         None        None        N               1.059168157852220    None         
fancy_mol     13         None        None        H               1.324548107607155    None         

relax> temperature(id='tb', temp=303.0)

relax> frq.set(id='tb', frq=800.0, units='MHz')

relax> rdc.read(align_id='tm', file='rdc_tm.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_tm.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H       -6.948668715708259                    None    
#fancy_mol:1@N     #fancy_mol:1@H       -6.948668715708259                    None    
#fancy_mol:2@N     #fancy_mol:2@H        8.098039045462761                    None    
#fancy_mol:3@N     #fancy_mol:3@H        8.098039045462761                    None    
#fancy_mol:4@N     #fancy_mol:4@H       -1.149370329754501                    None    
#fancy_mol:5@N     #fancy_mol:5@H       -1.149370329754501                    None    
#fancy_mol:6@N     #fancy_mol:6@H       -9.206307129123637                    None    
#fancy_mol:7@N     #fancy_mol:7@H       -9.206307129123637                    None    
#fancy_mol:8@N     #fancy_mol:8@H       29.015553356406404                    None    
#fancy_mol:9@N     #fancy_mol:9@H       29.015553356406404                    None    
#fancy_mol:10@N    #fancy_mol:10@H     -15.262636752506486                    None    
#fancy_mol:11@N    #fancy_mol:11@H     -15.262636752506486                    None    
#fancy_mol:12@N    #fancy_mol:12@H      -4.546609474776280                    None    
#fancy_mol:13@N    #fancy_mol:13@H      -4.546609474776280                    None    

relax> pcs.read(align_id='tm', file='pcs_tm.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_tm.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N               3.517239090816979    None         
fancy_mol     0          None        None        H               4.446800229993385    None         
fancy_mol     1          None        None        N              -1.566014639948689    None         
fancy_mol     1          None        None        H              -1.516571874204474    None         
fancy_mol     2          None        None        N              -4.279423135558279    None         
fancy_mol     2          None        None        H              -5.194956458672402    None         
fancy_mol     3          None        None        N               0.356355902330968    None         
fancy_mol     3          None        None        H               0.395889284173577    None         
fancy_mol     4          None        None        N              -2.083853653656230    None         
fancy_mol     4          None        None        H              -2.548315967199689    None         
fancy_mol     5          None        None        N              -0.207017839027144    None         
fancy_mol     5          None        None        H              -0.168344320351883    None         
fancy_mol     6          None        None        N              -0.353465020438716    None         
fancy_mol     6          None        None        H              -0.394157316357051    None         
fancy_mol     7          None        None        N               1.499093568883347    None         
fancy_mol     7          None        None        H               0.203905319235307    None         
fancy_mol     8          None        None        N               1.070090589092676    None         
fancy_mol     8          None        None        H               0.996841613002720    None         
fancy_mol     9          None        None        N              -5.290681898801728    None         
fancy_mol     9          None        None        H              -4.664889281923594    None         
fancy_mol     10         None        None        N              -1.669256494430270    None         
fancy_mol     10         None        None        H              -1.681387701254227    None         
fancy_mol     11         None        None        N               2.497894949974841    None         
fancy_mol     11         None        None        H               2.083740960893368    None         
fancy_mol     12         None        None        N              -0.917404110679639    None         
fancy_mol     12         None        None        H              -0.940801974897010    None         
fancy_mol     13         None        None        N               0.210223178555607    None         
fancy_mol     13         None        None        H               0.104752742432137    None         

relax> temperature(id='tm', temp=303.0)

relax> frq.set(id='tm', frq=800.0, units='MHz')

relax> rdc.read(align_id='er', file='rdc_er.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_er.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H       -3.027275476137428                    None    
#fancy_mol:1@N     #fancy_mol:1@H       -3.027275476137428                    None    
#fancy_mol:2@N     #fancy_mol:2@H        2.500463686927797                    None    
#fancy_mol:3@N     #fancy_mol:3@H        2.500463686927797                    None    
#fancy_mol:4@N     #fancy_mol:4@H        0.526811789209631                    None    
#fancy_mol:5@N     #fancy_mol:5@H        0.526811789209631                    None    
#fancy_mol:6@N     #fancy_mol:6@H       -9.063626567654751                    None    
#fancy_mol:7@N     #fancy_mol:7@H       -9.063626567654751                    None    
#fancy_mol:8@N     #fancy_mol:8@H       16.745445800258906                    None    
#fancy_mol:9@N     #fancy_mol:9@H       16.745445800258906                    None    
#fancy_mol:10@N    #fancy_mol:10@H      -6.638888400118410                    None    
#fancy_mol:11@N    #fancy_mol:11@H      -6.638888400118410                    None    
#fancy_mol:12@N    #fancy_mol:12@H      -1.042930832485744                    None    
#fancy_mol:13@N    #fancy_mol:13@H      -1.042930832485744                    None    

relax> pcs.read(align_id='er', file='pcs_er.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_er.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N               1.215632440242554    None         
fancy_mol     0          None        None        H               1.818916966515856    None         
fancy_mol     1          None        None        N              -1.263324749015673    None         
fancy_mol     1          None        None        H              -1.179310745275672    None         
fancy_mol     2          None        None        N              -2.978669967561374    None         
fancy_mol     2          None        None        H              -3.345170588563368    None         
fancy_mol     3          None        None        N              -0.247074780056658    None         
fancy_mol     3          None        None        H              -0.173536433521376    None         
fancy_mol     4          None        None        N              -2.855953343434118    None         
fancy_mol     4          None        None        H              -3.282312331893201    None         
fancy_mol     5          None        None        N              -0.373264278504538    None         
fancy_mol     5          None        None        H              -0.303545551606845    None         
fancy_mol     6          None        None        N              -0.457751935737173    None         
fancy_mol     6          None        None        H              -0.523138767851861    None         
fancy_mol     7          None        None        N              -2.277944293279882    None         
fancy_mol     7          None        None        H              -2.221203373300016    None         
fancy_mol     8          None        None        N               0.284560688805528    None         
fancy_mol     8          None        None        H               0.189283408330012    None         
fancy_mol     9          None        None        N              -3.733259872932030    None         
fancy_mol     9          None        None        H              -3.456368355347425    None         
fancy_mol     10         None        None        N              -1.161480266569215    None         
fancy_mol     10         None        None        H              -1.229381977072340    None         
fancy_mol     11         None        None        N               0.460750643552136    None         
fancy_mol     11         None        None        H               0.193382716627997    None         
fancy_mol     12         None        None        N              -1.047190544269138    None         
fancy_mol     12         None        None        H              -1.120356768950163    None         
fancy_mol     13         None        None        N              -0.126153323960414    None         
fancy_mol     13         None        None        H              -0.287456268229377    None         

relax> temperature(id='er', temp=303.0)

relax> frq.set(id='er', frq=800.0, units='MHz')

relax> rdc.read(align_id='yb', file='rdc_yb.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_yb.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H        0.714277163828135                    None    
#fancy_mol:1@N     #fancy_mol:1@H        0.714277163828135                    None    
#fancy_mol:2@N     #fancy_mol:2@H       -1.959281630028457                    None    
#fancy_mol:3@N     #fancy_mol:3@H       -1.959281630028457                    None    
#fancy_mol:4@N     #fancy_mol:4@H        1.245004466200323                    None    
#fancy_mol:5@N     #fancy_mol:5@H        1.245004466200323                    None    
#fancy_mol:6@N     #fancy_mol:6@H       -4.013099304664880                    None    
#fancy_mol:7@N     #fancy_mol:7@H       -4.013099304664880                    None    
#fancy_mol:8@N     #fancy_mol:8@H       10.220340309676828                    None    
#fancy_mol:9@N     #fancy_mol:9@H       10.220340309676828                    None    
#fancy_mol:10@N    #fancy_mol:10@H      -5.265806873871861                    None    
#fancy_mol:11@N    #fancy_mol:11@H      -5.265806873871861                    None    
#fancy_mol:12@N    #fancy_mol:12@H      -0.941434131140088                    None    
#fancy_mol:13@N    #fancy_mol:13@H      -0.941434131140088                    None    

relax> pcs.read(align_id='yb', file='pcs_yb.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_yb.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N               0.856861388367882    None         
fancy_mol     0          None        None        H               1.191642795128779    None         
fancy_mol     1          None        None        N              -0.542113816975028    None         
fancy_mol     1          None        None        H              -0.505785771176070    None         
fancy_mol     2          None        None        N              -1.207247631647855    None         
fancy_mol     2          None        None        H              -1.413503167287496    None         
fancy_mol     3          None        None        N              -0.130138858704689    None         
fancy_mol     3          None        None        H              -0.106055946487537    None         
fancy_mol     4          None        None        N              -1.477667933857552    None         
fancy_mol     4          None        None        H              -1.795676865811413    None         
fancy_mol     5          None        None        N              -0.089808357354184    None         
fancy_mol     5          None        None        H              -0.064297971635458    None         
fancy_mol     6          None        None        N              -0.187292540470126    None         
fancy_mol     6          None        None        H              -0.212445440929183    None         
fancy_mol     7          None        None        N              -0.298173255329287    None         
fancy_mol     7          None        None        H              -0.546555032748818    None         
fancy_mol     8          None        None        N               0.217412284176744    None         
fancy_mol     8          None        None        H               0.176380148546896    None         
fancy_mol     9          None        None        N              -1.572273010150537    None         
fancy_mol     9          None        None        H              -1.470342487714918    None         
fancy_mol     10         None        None        N              -0.481978063544521    None         
fancy_mol     10         None        None        H              -0.501227224650511    None         
fancy_mol     11         None        None        N               0.065264123045407    None         
fancy_mol     11         None        None        H              -0.001736086880610    None         
fancy_mol     12         None        None        N              -0.538797215798210    None         
fancy_mol     12         None        None        H              -0.560721646070774    None         
fancy_mol     13         None        None        N               0.174896904196497    None         
fancy_mol     13         None        None        H               0.094081726204439    None         

relax> temperature(id='yb', temp=303.0)

relax> frq.set(id='yb', frq=800.0, units='MHz')

relax> rdc.read(align_id='ho', file='rdc_ho.txt', dir='.', data_type='D', spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4, sep=None, neg_g_corr=False, absolute=False)
Opening the file './rdc_ho.txt' for reading.
RelaxWarning: The RDC value of the line ['#', 'Spin_ID1', 'Spin_ID2', 'RDCs', 'RDC_error'] is invalid.
The following RDCs have been loaded into the relax data store:

# Spin_ID1         Spin_ID2           Value                   Error                   
#fancy_mol:0@N     #fancy_mol:0@H       -2.264539926929270                    None    
#fancy_mol:1@N     #fancy_mol:1@H       -2.264539926929270                    None    
#fancy_mol:2@N     #fancy_mol:2@H       -0.259411371121105                    None    
#fancy_mol:3@N     #fancy_mol:3@H       -0.259411371121105                    None    
#fancy_mol:4@N     #fancy_mol:4@H        2.523951298050375                    None    
#fancy_mol:5@N     #fancy_mol:5@H        2.523951298050375                    None    
#fancy_mol:6@N     #fancy_mol:6@H        5.862521203853300                    None    
#fancy_mol:7@N     #fancy_mol:7@H        5.862521203853300                    None    
#fancy_mol:8@N     #fancy_mol:8@H      -16.887268654876934                    None    
#fancy_mol:9@N     #fancy_mol:9@H      -16.887268654876934                    None    
#fancy_mol:10@N    #fancy_mol:10@H      12.472767123998956                    None    
#fancy_mol:11@N    #fancy_mol:11@H      12.472767123998956                    None    
#fancy_mol:12@N    #fancy_mol:12@H      -1.448019672975321                    None    
#fancy_mol:13@N    #fancy_mol:13@H      -1.448019672975321                    None    

relax> pcs.read(align_id='ho', file='pcs_ho.txt', dir='.', spin_id_col=None, mol_name_col=1, res_num_col=2, res_name_col=None, spin_num_col=None, spin_name_col=5, data_col=6, error_col=7, sep=None, spin_id=None)
Opening the file './pcs_ho.txt' for reading.
# mol_name    res_num    res_name    spin_num    spin_name    PCSs                    PCS_error    
fancy_mol     0          None        None        N              -1.194844711735275    None         
fancy_mol     0          None        None        H              -1.742559869570677    None         
fancy_mol     1          None        None        N               0.899184404082588    None         
fancy_mol     1          None        None        H               0.830111391808670    None         
fancy_mol     2          None        None        N               3.125136470282325    None         
fancy_mol     2          None        None        H               3.723340540002998    None         
fancy_mol     3          None        None        N               0.048599484516981    None         
fancy_mol     3          None        None        H               0.002333174502900    None         
fancy_mol     4          None        None        N               1.402347316880932    None         
fancy_mol     4          None        None        H               1.481561657486423    None         
fancy_mol     5          None        None        N               0.368426436571356    None         
fancy_mol     5          None        None        H               0.317936658937697    None         
fancy_mol     6          None        None        N               0.318861300910117    None         
fancy_mol     6          None        None        H               0.365735341641990    None         
fancy_mol     7          None        None        N               1.751949896843739    None         
fancy_mol     7          None        None        H               1.674669585123681    None         
fancy_mol     8          None        None        N              -0.306487816797618    None         
fancy_mol     8          None        None        H              -0.231190802372781    None         
fancy_mol     9          None        None        N               2.651126719813498    None         
fancy_mol     9          None        None        H               2.502949301378241    None         
fancy_mol     10         None        None        N               1.145375677567258    None         
fancy_mol     10         None        None        H               1.175563529419126    None         
fancy_mol     11         None        None        N              -0.669017415375353    None         
fancy_mol     11         None        None        H              -0.477722347124354    None         
fancy_mol     12         None        None        N               0.509598662933773    None         
fancy_mol     12         None        None        H               0.575455538188414    None         
fancy_mol     13         None        None        N               0.386254649591545    None         
fancy_mol     13         None        None        H               0.482688180861048    None         

relax> temperature(id='ho', temp=303.0)

relax> frq.set(id='ho', frq=800.0, units='MHz')

relax> align_tensor.init(tensor='Dy fixed', align_id='dy', domain=None, params=(-0.00028304192149499998, 0.00017331020651, 0.00034814446175600002, 0.00109678563394, -0.00026112645921399998), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Dy fixed', align_id='dy', domain=None, params=(1.32405973595e-05, 1.69451339335e-05, 1.1142005633899999e-05, 1.2902359091e-05, 1.0623122949100001e-05), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> align_tensor.init(tensor='Tb fixed', align_id='tb', domain=None, params=(0.000167738428636, -0.00031110337700799998, 0.00023104399411100001, 0.00092790844248100005, -0.00042448381621), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Tb fixed', align_id='tb', domain=None, params=(9.2310651611399999e-06, 1.23864406564e-05, 9.2513811041599996e-06, 1.0025121852e-05, 8.6027985630999999e-06), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> align_tensor.init(tensor='Tm fixed', align_id='tm', domain=None, params=(-0.00021453133475699999, 0.00025001668613300001, -0.000318452894707, -0.00056658570934099998, 0.00045868901737200002), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Tm fixed', align_id='tm', domain=None, params=(8.1865620791200007e-06, 1.0964997537299999e-05, 8.43998269558e-06, 8.6359944416799994e-06, 7.9593774524700003e-06), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> align_tensor.init(tensor='Er fixed', align_id='er', domain=None, params=(-9.3463291335899994e-05, 7.7198645411800002e-05, -0.000234020357448, -0.000363596427557, 0.000177874820425), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Er fixed', align_id='er', domain=None, params=(6.3285125703600001e-06, 9.3721066721999998e-06, 7.3668205016499996e-06, 7.5280673135700001e-06, 9.7900318879299994e-06), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> align_tensor.init(tensor='Yb fixed', align_id='yb', domain=None, params=(2.2052401634300001e-05, -6.0490335696200003e-05, -0.000114723702615, -0.00021485584602699999, 0.00014373052081400001), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Yb fixed', align_id='yb', domain=None, params=(4.2812326052999998e-06, 5.4318624705299996e-06, 4.8360537531199996e-06, 5.1046845385100003e-06, 4.3184732967600002e-06), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> align_tensor.init(tensor='Ho fixed', align_id='ho', domain=None, params=(-6.9914798504700006e-05, -8.0089971150799994e-06, 0.000102219102441, 0.00042455908164499998, -0.000255281322523), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.init(tensor='Ho fixed', align_id='ho', domain=None, params=(7.7471187634100007e-06, 9.5567760685799996e-06, 9.1385255055799994e-06, 7.8223010521599999e-06, 7.3351515237600004e-06), scale=1.0, angle_units='deg', param_types=2, errors=True)

relax> domain(id='moving', spin_id=':0-100')

relax> domain(id='fixed', spin_id=':101-200')

relax> align_tensor.init(tensor='Dy moving', align_id='dy', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Dy fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Dy moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Dy fixed', red_tensor='Dy moving')

relax> align_tensor.init(tensor='Tb moving', align_id='tb', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Tb fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Tb moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Tb fixed', red_tensor='Tb moving')

relax> align_tensor.init(tensor='Tm moving', align_id='tm', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Tm fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Tm moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Tm fixed', red_tensor='Tm moving')

relax> align_tensor.init(tensor='Er moving', align_id='er', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Er fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Er moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Er fixed', red_tensor='Er moving')

relax> align_tensor.init(tensor='Yb moving', align_id='yb', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Yb fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Yb moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Yb fixed', red_tensor='Yb moving')

relax> align_tensor.init(tensor='Ho moving', align_id='ho', domain=None, params=(0, 0, 0, 0, 0), scale=1.0, angle_units='deg', param_types=2, errors=False)

relax> align_tensor.set_domain(tensor='Ho fixed', domain='fixed')

relax> align_tensor.set_domain(tensor='Ho moving', domain='moving')

relax> align_tensor.reduction(full_tensor='Ho fixed', red_tensor='Ho moving')

relax> frame_order.ref_domain(ref='fixed')

relax> frame_order.domain_to_pdb(domain='fixed', pdb='displaced.pdb')

relax> frame_order.ave_pos_translate(flag=True)

relax> frame_order.pivot(pivot=array([ 0.,  0.,  0.]), fix=True)

relax> paramag.centre(pos=[-5, -7, -9], atom_id=None, pipe=None, verbosity=1, fix=True, ave_pos=True, force=False)
The paramagnetic centre position will be fixed during optimisation.
Paramagnetic centres located at:

Average paramagnetic centre located at:
    [  -5.000,   -7.000,   -9.000]

Using the average paramagnetic position.

relax> frame_order.num_int_pts(num=10000)


# Model: rigid
##############

relax> frame_order.select_model(model='rigid')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  0.0113763520134


# Model: free rotor
###################

relax> frame_order.select_model(model='free rotor')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  94337.6680299


# Model: rotor
##############

relax> frame_order.select_model(model='rotor')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  0.968768022709


# Model: iso cone, torsionless
##############################

relax> frame_order.select_model(model='iso cone, torsionless')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  2.80180329697


# Model: iso cone, free rotor
#############################

relax> frame_order.select_model(model='iso cone, free rotor')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  101224.40327


# Model: iso cone
#################

relax> frame_order.select_model(model='iso cone')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  175.440396354


# Model: pseudo-ellipse, torsionless
####################################

relax> frame_order.select_model(model='pseudo-ellipse, torsionless')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  2.80180329697


# Model: pseudo-ellipse
#######################

relax> frame_order.select_model(model='pseudo-ellipse')

relax> calc(verbosity=1)
Numerical integration via the quasi-random Sobol' sequence.
Number of integration points: 10000
Base data: ['RDCs', 'PCSs']
Chi2:  175.440396354

