Hi, This is a difficult question as efficiency changes with any change to the pipe_control.mol_res_spin module, as well as the data set up and specific questions you have. You should browse the functions in that module to see what you have access to:
$ grep "def " pipe_control/mol_res_spin.py You may even find that implementing your own custom function in that module would be the best. I think for your purposes though, that the spin_index_loop() function is what you need. This loops over the molecule, residue, and spin indices. From what I understand of your aims, you will have the same sequence data for all the data pipes you would like to compare. Is this correct? If this is the case, then the molecule, residue, and spin indices will be the same for all pipes. So you could use code in your script such as: # relax module imports. from pipe_control.mol_res_spin import spin_index_loop from pipe_control.pipes import get_pipe # Get the two pipes. dp1 = get_pipe('first pipe') dp2 = get_pipe('second pipe') # Loop over the sequence data. for mol_index, res_index, spin_index in spin_index_loop(): # Alias the spins for the two pipes. spin1 = dp1.mol[mol_index].res[res_index].spin[spin_index] spin2 = dp2.mol[mol_index].res[res_index].spin[spin_index] # Sanity check. if spin1.x != spin2.x: raise RelaxError("X is not X?!?") That should be the absolute fastest implementation. But have a look at the code to get a better idea. As I know you are after the fastest possible solution to be able to scan lots of data, looking at the relax code would give you an idea of what the best solution is. You may find inefficiencies that can be fixed in the relax code too. Regards, Edward On 14 February 2014 12:50, Troels Emtekær Linnet <tlin...@nmr-relax.com> wrote: > Hi, > > I need an efficient way to compare spin.X values between pipes. > Here X could be: > > - spin.r2eff > - spin.chi2 > - spin.kex > etc. > > I have tried implementing the following: > > for spin, mol_name, res_num, res_name, spin_id in spin_loop(full_info=True, > return_id=True, skip_desel=True): > cur_r2eff = spin.r2eff[index_str] > > The problem is that r2eff is a saved as a dictionary, with a current name > convention of: > sq_cpmg_599.%8f_0.000_100.000 > sq_cpmg_599.%8f_0.000_133.333 > sq_cpmg_599.%8f_0.000_133.%3f > > This naming convention is likely to change pattern. > > Do there exist a efficient way to compare data values between two pipes? > > I would need to compare one pipe to about 50 other pipes, where each > pipe contains about 80 spins recorded at 10-15 v_cpmg frequencies. > > The difference between pipe data would undergo standard statistics as RMS > etc. > > Best > Troels > > _______________________________________________ > relax (http://www.nmr-relax.com) > > This is the relax-users mailing list > relax-users@gna.org > > To unsubscribe from this list, get a password > reminder, or change your subscription options, > visit the list information page at > https://mail.gna.org/listinfo/relax-users > _______________________________________________ relax (http://www.nmr-relax.com) This is the relax-users mailing list relax-users@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-users