mailRe: AIC from ModeFree data


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

Header


Content

Posted by Edward d'Auvergne on April 03, 2008 - 18:40:
Hi,

The addition of the functions acting on the 'aic' run were correct.
This is because the model selection copies the information of the
selected run to the new 'aic' run (in the terminology of the future of
relax, the contents of the selected data pipe are copied to the new
and empty 'aic' data pipe).  So that is why you needed to add the
missing information back to the 'aic' data pipe.  However I think that
the reported bug was caused by the missing information in the 'm1',
'm2', etc. runs, so that the subsequent addition of this data to the
'aic' run would not fix the bug.  If this information is read out of
the mfout file though, then the bug would be resolved.  Otherwise the
script must add this data to the runs (data pipes) prior to model
selection.

Cheers,

Edward


On Thu, Apr 3, 2008 at 3:52 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:

 Hi Ed,

 Thanks for taking a look at this in a new thread !


 For the script you proposed, as I had noticed yesterday, it won't work
since the results.write() function asks for a sequence...

 ========================
 relax> results.write(run=name, file='results', force=1)
 Opening the file 'aic/results.bz2' for writing.
 RelaxError: The sequence data for the run 'aic' does not exist.
 ========================


 If I give it a sequence, it then asks for a diffusion tensor...

 ========================
 relax> results.write(run=name, file='results', force=1)
 Opening the file 'aic/results.bz2' for writing.
 RelaxError: No diffusion tensor data is loaded for the run 'aic'.
 ========================


 Then, what I get is a bigger error message which can be solved by
submitting data sets with frequency labels...

 ========================
 relax> results.write(run=name, file='results', force=1)
 Opening the file 'aic/results.bz2' for writing.
 Traceback (most recent call last):
   File "<console>", line 1, in ?
   File
"/home/semor/packages/relax-1.2___FOR__TEM-1__-2.712/prompt/results.py",
line 201, in write
     self.__relax__.generic.results.write(run=run, file=file, directory=dir,
force=force, format=format, compress_type=compress_type)
   File
"/home/semor/packages/relax-1.2___FOR__TEM-1__-2.712/generic_fns/results.py",
line 166, in write
     self.write_function(results_file, run)
   File
"/home/semor/packages/relax-1.2___FOR__TEM-1__-2.712/specific_fns/model_free.py",
line 4664, in write_columnar_results
     self.write_columnar_line(file=file, num='Num', name='Name',
select='Selected', data_set='Data_set', nucleus='Nucleus', model='Model',
equation='Equation', params='Params', param_set='Param_set', s2='S2',
s2f='S2f', s2s='S2s', local_tm='Local_tm_(' + self.return_units('local_tm')
+ ')', te='te_(' + self.return_units('te') + ')', tf='tf_(' +
self.return_units('tf') + ')', ts='ts_(' + self.return_units('ts') + ')',
rex='Rex_(' + replace(self.return_units('rex'), ' ', '_') + ')',
r='Bond_length_(' + self.return_units('r') + ')', csa='CSA_(' +
self.return_units('csa') + ')', chi2='Chi-squared', i='Iter', f='f_count',
g='g_count', h='h_count', warn='Warning', diff_type='Diff_type',
diff_params=diff_params, pdb='PDB', pdb_model='PDB_model',
pdb_heteronuc='PDB_heteronuc', pdb_proton='PDB_proton', xh_vect='XH_vector',
ri_labels='Ri_labels', remap_table='Remap_table', frq_labels='Frq_labels',
frq='Frequencies', ri=ri, ri_error=ri_error)
   File
"/home/semor/packages/relax-1.2___FOR__TEM-1__-2.712/specific_fns/model_free.py",
line 3732, in return_units
     return self.relax.data.frq_labels[self.run][0] + ' MHz'
 AttributeError: Data instance has no attribute 'frq_labels'
 ========================


 Thus, if I rewrite the script in a more logical way :


========================
 runs = ['m1', 'm2', 'm3', 'm4', 'm5']
 diff_tensor_Phi = 22.4
 diff_tensor_Theta = -3.49
 diff_tensor_Dratio = 1.22
 diff_tensor_tm = 1.242e-08

 for name in runs:
     run.create(name, 'mf')
     sequence.read(name, 'sequence')
     diffusion_tensor.init(name, (diff_tensor_tm, diff_tensor_Dratio,
diff_tensor_Theta, diff_tensor_Phi), param_types=2, spheroid_type='prolate',
fixed=1)
     palmer.extract(run=name)

 name = 'aic'
 run.create(name, 'mf')
 model_selection(method='AIC', modsel_run=name)
 sequence.read(name, 'sequence')
 diffusion_tensor.init(name, (diff_tensor_tm, diff_tensor_Dratio,
diff_tensor_Theta, diff_tensor_Phi), param_types=2, spheroid_type='prolate',
fixed=1)
 relax_data.read(name, 'R1', '800', 799.812 * 1e6,
'800_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '800', 799.812 * 1e6,
'800_R2.dat_plus_sequence')
 relax_data.read(name, 'R1', '600', 599.739 * 1e6,
'600_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '600', 599.739 * 1e6,
'600_R2.dat_plus_sequence')
 relax_data.read(name, 'NOE', '600', 599.739 * 1e6,
'600_NOE.dat_plus_sequence')
 relax_data.read(name, 'R1', '500', 499.827 * 1e6,
'500_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '500', 499.827 * 1e6,
'500_R2.dat_plus_sequence')
 relax_data.read(name, 'NOE', '500', 499.827 * 1e6,
'500_NOE.dat_plus_sequence')
 results.write(run=name, file='results', force=1)
 ========================


 Note however that it is not needed to input all data as only submitting one
dataset will avoid getting the error message for 'frq_labels'...

 I think this works in the 'palmer.py' script since at stage 2, the script
loads a saved state from stage 1 where all those information were input...


 For the run 'None' being selected, yes, it is for all spins... Running with
the '--debug' flag doesn't change anything...


 Cheers,


 Séb







 Edward d'Auvergne wrote:
 On Wed, Apr 2, 2008 at 7:11 PM, Sébastien Morin
<sebastien.morin.1@xxxxxxxxx> wrote:


 Hi,

 I tried to use the palmer.extract() function, with no real success...

 I have to admit that my Modelfree star format parser is not of very
high quality. It woks if you use the palmer.py sample script, but
obviously not in this situation. Nothing that's not fixable though.
I'll start a new thread about this in the relax-devel mailing list.




 I had several error message during my first tries and manage to get rid of
them with a script like :

 =======================================

 runs = ['m1', 'm2', 'm3', 'm4', 'm5']
 diff_tensor_Phi = 22.4
 diff_tensor_Theta = -3.49
 diff_tensor_Dratio = 1.22
 diff_tensor_tm = 1.242e-08

 for name in runs:
 run.create(name, 'mf')
 sequence.read(name, 'sequence')
 diffusion_tensor.init(name, (diff_tensor_tm, diff_tensor_Dratio,
diff_tensor_Theta, diff_tensor_Phi), param_types=2, spheroid_type='prolate',
fixed=1)
 palmer.extract(run=name)

 name = 'aic'
 run.create(name, 'mf')
 sequence.read(name, 'sequence')
 relax_data.read(name, 'R1', '800', 799.812 * 1e6,
'800_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '800', 799.812 * 1e6,
'800_R2.dat_plus_sequence')
 relax_data.read(name, 'R1', '600', 599.739 * 1e6,
'600_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '600', 599.739 * 1e6,
'600_R2.dat_plus_sequence')
 relax_data.read(name, 'NOE', '600', 599.739 * 1e6,
'600_NOE.dat_plus_sequence')
 relax_data.read(name, 'R1', '500', 499.827 * 1e6,
'500_R1.dat_plus_sequence')
 relax_data.read(name, 'R2', '500', 499.827 * 1e6,
'500_R2.dat_plus_sequence')
 relax_data.read(name, 'NOE', '500', 499.827 * 1e6,
'500_NOE.dat_plus_sequence')
 diffusion_tensor.init(name, (diff_tensor_tm, diff_tensor_Dratio,
diff_tensor_Theta, diff_tensor_Phi), param_types=2, spheroid_type='prolate',
fixed=1)
 model_selection(method='AIC', modsel_run=name)
 results.write(run=name, file='results', force=1)

 =======================================

 It is a little strange that you need to read in the sequence and the
relaxation data for the 'aic' run. If you look at the palmer.py
sample script in the exec_stage_2() function, you'll see that none of
this is done. The following should also work:


=======================================

runs = ['m1', 'm2', 'm3', 'm4', 'm5']
diff_tensor_Phi = 22.4
diff_tensor_Theta = -3.49
diff_tensor_Dratio = 1.22
diff_tensor_tm = 1.242e-08

for name in runs:
 run.create(name, 'mf')
 sequence.read(name, 'sequence')
 diffusion_tensor.init(name, (diff_tensor_tm, diff_tensor_Dratio,
diff_tensor_Theta, diff_tensor_Phi), param_types=2,
spheroid_type='prolate', fixed=1)
 The rest of the setup user functions ....
 palmer.extract(run=name)

name = 'aic'
run.create(name, 'mf')
model_selection(method='AIC', modsel_run=name)
results.write(run=name, file='results', force=1)

=======================================




 However, there is one problem still present : no model is chosen during AIC
selection... Here is what I get after the command
"model_selection(method='AIC', modsel_run=name)" :

 =======================================

 ...

 Instance 261.

 Run Num_params_(k) Num_data_sets_(n) Chi2
Criterion

 The model from the run None has been selected.

 ...

 =======================================

 Is this for all spins? Maybe running relax with the --debug flag will
give more information.




 It seems the mfout (which are all located in their respective folder : m1,
m2 , m3, m4 and m5) are not loaded properly...

 Do you have any clue about this issue ?

 Sorry, I don't have any idea. This will require investigation of the
relax data storage object to see what data is loaded from the mfout
file, and quite likely a little bit of coding, if you wish to do so.
Please refer to my post to relax-devel which will come soon.




 Also, is there a way of extracting information from a mfout with relax
without inputing any sequence, diffusion tensor, or data..? I thought it
would be possible to use palmer.extract() in a short script like this :

 =======================================

 runs = ['m1', 'm2', 'm3', 'm4', 'm5']

 for name in runs:
 palmer.extract(run=name)

 name = 'aic'
 run.create(name, 'mf')
 model_selection(method='AIC', modsel_run=name)
 results.write(run=name, file='results', force=1)

 =======================================


 Do you see anything I do wrong ?

 There is nothing wrong, the mfout file parser doesn't yet extract this
information. I'll continue this in my post to relax-devel.

Cheers,

Edward






Related Messages


Powered by MHonArc, Updated Fri Apr 04 22:20:53 2008