mailr8189 - /1.3/generic_fns/structure/main.py


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

Header


Content

Posted by edward on December 11, 2008 - 11:14:
Author: bugman
Date: Thu Dec 11 11:14:00 2008
New Revision: 8189

URL: http://svn.gna.org/viewcvs/relax?rev=8189&view=rev
Log:
Final fixes for bug #12735 (https://gna.org/bugs/index.php?12735).

The last problem was again triggered by the Scientific python PDB reader 
weirdness.  Residues ending
in '+' were being treated by the PDB reader as a different molecule.  But 
then the molecule names
LYS+, ARG+, etc. were causing problems as '+' was being treated as regular 
expression when matching
molecule names.  Therefore the '+' character has been stripped from all 
molecule, residue, and atom
names.


Modified:
    1.3/generic_fns/structure/main.py

Modified: 1.3/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=8189&r1=8188&r2=8189&view=diff
==============================================================================
--- 1.3/generic_fns/structure/main.py (original)
+++ 1.3/generic_fns/structure/main.py Thu Dec 11 11:14:00 2008
@@ -25,6 +25,7 @@
 from numpy import dot, float64, ndarray, zeros
 from os import F_OK, access
 from re import search
+from string import replace
 import sys
 from warnings import warn
 
@@ -70,6 +71,15 @@
 
     # Loop over all atoms of the spin_id selection.
     for mol_name, res_num, res_name, atom_num, atom_name, element, pos in 
cdp.structure.atom_loop(atom_id=spin_id, str_id=str_id, mol_name_flag=True, 
res_num_flag=True, res_name_flag=True, atom_num_flag=True, 
atom_name_flag=True, element_flag=True, pos_flag=True, ave=ave_pos):
+
+        # Remove the '+' regular expression character from the mol, res, and 
spin names!
+        if mol_name and search('\+', mol_name):
+            mol_name = replace(mol_name, '+', '')
+        if res_name and search('\+', res_name):
+            res_name = replace(res_name, '+', '')
+        if atom_name and search('\+', atom_name):
+            atom_name = replace(atom_name, '+', '')
+
         # Initialise the identification string.
         id = ''
 




Related Messages


Powered by MHonArc, Updated Thu Dec 11 11:20:02 2008