Menu

#12 Error message upon loading PDB file - NEW

fixed
structure (1)
4.1.1
relax's source code
All analyses
2019-03-13
2019-03-08
No

Hello, it seems that the problem of loading the spins from a PDB file has not been fully resolved. Please help.
SC

1 Attachments

Related

Bugs: #12

Discussion

  • Edward d'Auvergne

    Note that the messages from the relax GUI if you update from 4.1.0 to 4.1.1 are a little different, and more informative. There was a bug fixed in 4.1.1 causing the GUI to not display all content. I can reproduce the issue and I see:

    relax> structure.read_pdb(file='/data/relax/relax/test_suite/shared_data/structures/1RTE_trunc_#1.pdb', dir=None, read_mol=None, set_mol_name=None, read_model=None, set_model_num=None, alt_loc=None, verbosity=1, merge=False)
    
    Internal relax PDB parser.
    Opening the file '/data/relax/relax/test_suite/shared_data/structures/1RTE_trunc_#1.pdb' for reading.
    RelaxWarning: The following atom numbers from the CONECT records cannot be found within the ATOM and HETATM records:  [662, 1651].
    Adding molecule '1RTE_trunc_#1_mol1' (from the original molecule number 1).
    
    relax> structure.load_spins(spin_id='@N', from_mols=None, mol_name_target=None, ave_pos=True, spin_num=True)
    Adding the following spins to the relax data store.
    
    Traceback (most recent call last):
      File "/data/relax/relax/gui/interpreter.py", line 306, in run
        fn(*args, **kwds)
      File "/data/relax/relax/pipe_control/structure/main.py", line 953, in load_spins
        spin_cont.pos = pos
    AttributeError: 'NoneType' object has no attribute 'pos'
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 16762, in <lambda>
        lambda event: event.callable(*event.args, **event.kw) )
      File "/data/relax/relax/gui/spin_viewer/frame.py", line 192, in refresh_safe
        self.tree_panel.update()
      File "/data/relax/relax/gui/spin_viewer/tree.py", line 919, in update
        self.update_mol(mol, mol_id)
      File "/data/relax/relax/gui/spin_viewer/tree.py", line 965, in update_mol
        'select': is_mol_selected(mol_id)
      File "/data/relax/relax/pipe_control/selection.py", line 373, in is_mol_selected
        for spin in spin_loop(selection):
      File "/data/relax/relax/pipe_control/mol_res_spin.py", line 3832, in spin_loop
        select_obj = Selection(selection)
      File "/data/relax/relax/lib/selection.py", line 396, in __init__
        mol_token, res_token, spin_token = tokenise(select_string)
      File "/data/relax/relax/lib/selection.py", line 191, in tokenise
        raise RelaxError("Invalid molecule selection '%s'." % mol_info)
    lib.errors.RelaxError: RelaxError: Invalid molecule selection '#1RTE_trunc_#1_mol1'.
    
     
  • Edward d'Auvergne

    The issue here is that the molecule name cannot contain the '#' character, however this is not caught. The '#' character has a special meaning as the molecule name is used directly for the spin ID strings. From the 'Spin ID string' section of http://www.nmr-relax.com/manual/Molecule_residue_and_spin_containers.html:

    Spins are often identified in relax using their ID strings. The spin ID strings follow the basic construct found in a number of other NMR software such as MOLMOL. The identification string is composed of three components:

    • The molecule ID token beginning with the “#” character,
    • The residue ID token beginning with the “:” character,
    • The atom or spin system ID token beginning with the “@” character.

    Each token can be composed of multiple elements - one per spin - separated by the “,” character and each individual element can either be a number (which must be an integer, in string format), a name, or a range of numbers separated by the “-” character. Negative numbers are supported. The full ID string specification is “#<mol_name> :<res_id>[, <res_id>[, <res_id>, ...]]</res_id></res_id> @<atom_id>[, <atom_id>[, <atom_id>, ...]]</atom_id></atom_id>”, where the token elements are “<mol_name>”, the name of the molecule, “<res_id>”, the residue identifier which can be a number, name, or range of numbers, “<atom_id>”, the atom or spin system identifier which can be a number, name, or range of numbers.</atom_id></res_id></mol_name></atom_id></res_id></mol_name>

    If one of the tokens is left out then all elements will be assumed to match. For example if the string does not contain the “#” character then all molecules will match the string. If only the molecule ID component is specified, then all spins of the molecule will match.

    Regular expression can, in some instances, be used to select spins. For example the string “@H*” will select the protons 'H', 'H2' and 'H98'.

    This means that we need to check the molecule name for invalid '#' characters before loading the PDB file, and raise an appropriate RelaxError message explaining the issue. I can create a system test for catching that.

    This probably also means that we should validate residue names too to avoid ':', as well as atom names to avoid '@'.

     

    Last edit: Edward d'Auvergne 2019-03-13
  • Edward d'Auvergne

    • labels: --> structure
    • status: open --> fixed
    • Release: master --> 4.1.1
     
  • Edward d'Auvergne

    This was fixed in commit ad9499. The fix was to catch the invalid '#' character in the molecule name and to raise a RelaxError explaining the issue.

     

Log in to post a comment.

MongoDB Logo MongoDB