mailRe: Difficulty with noe.py sample script


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

Header


Content

Posted by Tyler Reddy on October 07, 2008 - 19:58:
Hi Edward,

Thanks for your continued patience.

Okay, it seems that aligning the data height column by the left most digit
rather than the right most digit is not tolerated. Now the script (1.2) almost
gets to the end, but there is still an error output, where the program opens
noe.out for writing (see below). The noe.out file is created, but it's blank.
Assuming I can get functional input for the 1.2 version (which is supposed to
work), if this input doesn't work for the 1.3 version I'm happy to submit the
bug report at that stage.

Also, I think it would be very useful if a sample of functional input data, as
you supplied for me in the previous email, would be incorporated in the relax
manual. Different labs can have different naming conventions and formats, even
within a Sparky list, and the column alignment can be tricky (even if trivial
once you know about it). Also, if there is sensitivity to the nomenclature
system employed (as some of your previous responses on this topic attest), then
an example directly in the manual would definitely be appreciated. I know that
part of the design philosophy is that it's very easy to incorporate new format
tolerance into relax, but it's even faster for a new user who uses a slightly
different format to just read the relevant section of the manual and format
that way.

Output:
Calculating the unit XH vectors from the structure.

relax> noe.read(run='noe', file='NOnoe500_select.list', dir=None,
spectrum_type='ref', format='sparky
', heteronuc='N', proton='HN', int_col=None)
Reference spectrum.
Sparky formatted data file.

Opening the file 'NOnoe500_select.list' for reading.
Number of header lines found: 2

relax> noe.read(run='noe', file='noe500_select.list', dir=None,
spectrum_type='sat', format='sparky',
heteronuc='N', proton='HN', int_col=None)
Saturated spectrum.
Sparky formatted data file.

Opening the file 'noe500_select.list' for reading.
Number of header lines found: 2

relax> noe.error(run='noe', error=15.4933, spectrum_type='ref', res_num=None,
res_name=None)

relax> noe.error(run='noe', error=10.1449, spectrum_type='sat', res_num=None,
res_name=None)

relax> calc(run='noe', print_flag=1)

relax> value.write(run='noe', param='noe', file='noe.out', dir=None, force=1)
Opening the file 'noe.out' for writing.
Traceback (most recent call last):
 File "/Applications/relax-1.2.14/relax", line 457, in <module>
   Relax()
 File "/Applications/relax-1.2.14/relax", line 167, in __init__
   self.interpreter.run()
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 216, in run
   run_script(intro=self.relax.intro_string, local=self.local,
script_file=self.relax.script_file, q
uit=1)
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 391, in
run_script
   console.interact(intro, local, script_file, quit)
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 343, in
interact_script
   execfile(script_file, local)
 File "noe_12.py", line 75, in <module>
   value.write(name, param='noe', file='noe.out', force=1)
 File "/Applications/relax-1.2.14/prompt/value.py", line 506, in write
self.__relax__.generic.value.write(run=run, param=param, file=file, dir=dir,
force=force)
 File "/Applications/relax-1.2.14/generic_fns/value.py", line 537, in write
   self.write_data(file, return_value)
 File "/Applications/relax-1.2.14/generic_fns/value.py", line 549, in
write_data
   self.function_type =
self.relax.data.run_types[self.relax.data.run_names.index(run)]
ValueError: list.index(x): x not in list



Quoting Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>:

Hi,

This is again a bug, as relax hasn't managed to catch a file formatted
in a way it cannot recognise and then respond with a error message
which is understandable.  The error indicates to me that relax is
thinking this is a Sparky formatted peak list, but that the intensity
column is missing (at least in one position).  The file should look
something like:

     Assignment         w1         w2   Data Height

        LEU3N-HN    122.454      8.397       129722
        GLY4N-HN    111.999      8.719       422375
        SER5N-HN    115.085      8.176       384180
        MET6N-HN    120.934      8.812       272100
        ASP7N-HN    122.394      8.750       174970
        SER8N-HN    113.916      7.836       218762
       GLU11N-HN    122.194      8.604        30412
       GLY12N-HN    110.525      9.028        90144

The NOE analysis works in version 1.2.14, but not in 1.3.1 yet.  The
idea for filing the bug report and then me creating a system test
within relax using a tiny subset of the data was simply a suggestion
that would allow me to quickly make the NOE analysis functional in the
next relax 1.3 version.  Then other relax users would benefit from
having this code functional again too.  But if you need the NOE data
quickly, relax 1.2.14 will do the job with a Sparky peak list
possessing all four columns.

Regards,

Edward



On Tue, Oct 7, 2008 at 4:12 PM, Tyler Reddy <TREDDY@xxxxxx> wrote:
I ran the 1.2 version of the noe.py script with the 1.2 version of relax on
the
same machine and had a slightly different error output (below). If this is
simply a version-change problem with the script as you say, then I'm not
sure
why I'd get a convoluted error with version 1.2 as well.

Output:

Calculating and averaging the unit XH vectors from all structures.

relax> noe.read(run='noe', file='NOnoe500.list', dir=None,
spectrum_type='ref',
format='sparky', heteronuc='N', proton='HN', int_col=None)
Reference spectrum.
Sparky formatted data file.

Opening the file 'NOnoe500.list' for reading.
Number of header lines found: 2
Traceback (most recent call last):
 File "/Applications/relax-1.2.14/relax", line 457, in <module>
  Relax()
 File "/Applications/relax-1.2.14/relax", line 167, in __init__
  self.interpreter.run()
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 216, in run
  run_script(intro=self.relax.intro_string, local=self.local,
script_file=self.relax.script_file, quit=1)
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 391, in
run_script
  console.interact(intro, local, script_file, quit)
 File "/Applications/relax-1.2.14/prompt/interpreter.py", line 343, in
interact_script
  execfile(script_file, local)
 File "noe_12.py", line 35, in <module>
  noe.read(name, file='NOnoe500.list', spectrum_type='ref')
 File "/Applications/relax-1.2.14/prompt/noe.py", line 226, in read
  self.__relax__.specific.noe.read(run=run, file=file, dir=dir,
spectrum_type=spectrum_type, format=format, heteronuc=heteronuc,
proton=proton,
int_col=int_col)
 File "/Applications/relax-1.2.14/specific_fns/noe.py", line 110, in read
  self.relax.generic.intensity.read(run=run, file=file, dir=dir,
format=format, heteronuc=heteronuc, proton=proton, int_col=int_col,
assign_func=self.assign_function)
 File "/Applications/relax-1.2.14/generic_fns/intensity.py", line 232, in
read
  res_num, H_name, X_name, intensity = self.intensity(self.file_data[i])
 File "/Applications/relax-1.2.14/generic_fns/intensity.py", line 92, in
intensity_sparky
  intensity = float(line[self.int_col])
IndexError: list index out of range



Quoting Edward d'Auvergne <edward.dauvergne@xxxxxxxxx>:

Hi,

This is definitely a bug!  If you could file a bug report
(https://gna.org/bugs/?func=additem&group=relax), that would be much
appreciated.  If you would like a description of how this is done,
please see section 3.3 of the relax manual (version 1.3) or the online
HTML version (currently at
http://www.nmr-relax.com/manual/1.3/node49.html).

The reason this is failing is because this code in the 1.3 relax
versions has not been converted to the new design yet.  For me or the
relax developers to implement this, first a system test should be
added to the test suite.  The test suite can be run by typing:

$ relax --test-suite

The system test is simply a very tiny, although complete, version of
the analysis you would like to do.  This can include a small subset of
the base data, randomised if you'd like to protect the data prior to
publication.  With the small data subset, I can include your full
analysis script into the test suite and execute it with the data.
Then once the test passes, an NOE analysis will be possible.  The data
and script can be attached to the bug report.  If you would like to
help in getting this test implemented, that would be much appreciated.

Thanks,

Edward



On Mon, Oct 6, 2008 at 3:31 PM, Tyler Reddy <TREDDY@xxxxxx> wrote:

Hello,

I am having trouble with the noe.py script. I have peptide data with 6
backbone
15N labels, and I suspect it's a problem with input. I've tried several
permutations of full PDB file and full .list Sparky format files as well
as
files trimmed down to include only the labeled residues. I'm not sure
which is
preferable/required for input, and if unlabeled residues can simply be
left
with a blank column value or if there is a special way to treat this?

Here is a sample of the output I get with any of my tries so far:

Scientific Python PDB parser.
Loading all structures from the PDB file.
Structure('select.pdb'):
 Peptide chain A of length 6


relax> structure.load_spins(spin_id='@N', ave_pos=True)
Adding the following spins to the relax data store.

Mol_name   Res_num    Res_name   Spin_num   Spin_name
A          254        LEU        68         N
A          258        LEU        142        N
A          261        GLY        197        N
A          264        LEU        230        N
A          268        ALA        294        N
A          273        LEU        366        N

relax> noe.read(file='NOnoe500_true.list', dir=None, spectrum_type='ref',
format='sparky', heteronuc='N', proton='HN', int_col=None)
Reference spectrum.
Traceback (most recent call last):
 File "/Applications/relax-1.3.1/relax", line 408, in <module>
  Relax()
 File "/Applications/relax-1.3.1/relax", line 125, in __init__
  self.interpreter.run(self.script_file)
 File "/Applications/relax-1.3.1/prompt/interpreter.py", line 270, in run
  return run_script(intro=self.__intro_string, local=self.local,
script_file=script_file, quit=self.__quit_flag,
show_script=self.__show_script,
raise_relax_error=self.__raise_relax_error)
 File "/Applications/relax-1.3.1/prompt/interpreter.py", line 531, in
run_script
  return console.interact(intro, local, script_file, quit,
show_script=show_script, raise_relax_error=raise_relax_error)
 File "/Applications/relax-1.3.1/prompt/interpreter.py", line 427, in
interact_script
  execfile(script_file, local)
 File "noe.py", line 36, in <module>
  noe.read(file='NOnoe500_true.list', spectrum_type='ref')
 File "/Applications/relax-1.3.1/prompt/noe.py", line 216, in read
  noe_obj.read(file=file, dir=dir, spectrum_type=spectrum_type,
format=format,
heteronuc=heteronuc, proton=proton, int_col=int_col)
 File "/Applications/relax-1.3.1/specific_fns/noe.py", line 114, in read
  self.relax.generic.intensity.read(run=run, file=file, dir=dir,
format=format, heteronuc=heteronuc, proton=proton, int_col=int_col,
assign_func=self.assign_function)
AttributeError: Noe instance has no attribute 'relax'


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-users mailing list
relax-users@xxxxxxx

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://nmr-relax.com)

This is the relax-users mailing list
relax-users@xxxxxxx

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://nmr-relax.com)

This is the relax-users mailing list
relax-users@xxxxxxx

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







Related Messages


Powered by MHonArc, Updated Tue Oct 07 21:40:20 2008