Author: semor
Date: Tue Oct 14 18:50:59 2008
New Revision: 7695
URL: http://svn.gna.org/viewcvs/relax?rev=7695&view=rev
Log:
Added the support of unassigned peaks in Sparky formatted peak lists.
The unassigned peak show up as '?-?'.
Thanks to Ryan Hoffman and his bug report (https://gna.org/bugs/?11913).
Modified:
1.3/generic_fns/intensity.py
1.3/test_suite/shared_data/peak_lists/ref_ave.list
Modified: 1.3/generic_fns/intensity.py
URL:
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/intensity.py?rev=7695&r1=7694&r2=7695&view=diff
==============================================================================
--- 1.3/generic_fns/intensity.py (original)
+++ 1.3/generic_fns/intensity.py Tue Oct 14 18:50:59 2008
@@ -86,29 +86,36 @@
@raises RelaxError: When the expected peak intensity is not a float.
"""
+
# The Sparky assignment.
- assignment = split('([A-Z]+)', line[0])
- assignment = assignment[1:-1]
+ assignment = ''
+ res_num=''
+ h_name=''
+ x_name=''
+ intensity=''
+ if line[0]!='?-?':
+ assignment = split('([A-Z]+)', line[0])
+ assignment = assignment[1:-1]
# The residue number.
- try:
- res_num = int(assignment[1])
- except:
- raise RelaxError, "Improperly formatted Sparky file."
+ try:
+ res_num = int(assignment[1])
+ except:
+ raise RelaxError, "Improperly formatted Sparky file."
# Nuclei names.
- x_name = assignment[2]
- h_name = assignment[4]
+ x_name = assignment[2]
+ h_name = assignment[4]
# The peak intensity column.
- if int_col == None:
- int_col = 3
+ if int_col == None:
+ int_col = 3
# Intensity.
- try:
- intensity = float(line[int_col])
- except ValueError:
- raise RelaxError, "The peak intensity value " + `intensity` + "
from the line " + `line` + " is invalid."
+ try:
+ intensity = float(line[int_col])
+ except ValueError:
+ raise RelaxError, "The peak intensity value " + `intensity` +
" from the line " + `line` + " is invalid."
# Return the data.
return res_num, h_name, x_name, intensity
Modified: 1.3/test_suite/shared_data/peak_lists/ref_ave.list
URL:
http://svn.gna.org/viewcvs/relax/1.3/test_suite/shared_data/peak_lists/ref_ave.list?rev=7695&r1=7694&r2=7695&view=diff
==============================================================================
--- 1.3/test_suite/shared_data/peak_lists/ref_ave.list (original)
+++ 1.3/test_suite/shared_data/peak_lists/ref_ave.list Tue Oct 14 18:50:59
2008
@@ -4,3 +4,4 @@
GLY4N-HN 111.978 8.720 148614
SER5N-HN 115.069 8.177 166842
MET6N-HN 120.910 8.813 128690
+ ?-? 122.562 7.960 87879
_______________________________________________
relax (http://nmr-relax.com)
This is the relax-commits mailing list
relax-commits@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-commits