Achim
unread,Jul 20, 2011, 10:34:05 AM7/20/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to biolccc
Dear Anton,
I was processing a long list of sequences, when pyBioLCCC fell over
due to the presence of an 'X' in the sequence. The error message that
I got was:
========================
Traceback (most recent call last):
File "<pyshell#20>", line 3, in <module>
pyBioLCCC.standardChromoConditions)
File "/usr/local/lib/python2.6/dist-packages/pyBioLCCC.py", line
2022, in calculateRT
return _pyBioLCCC.calculateRT(*args)
BioLCCCException
========================
It might be worth trapping these occurences to at least produce a more
meaningful error message. You could use this 'isAminoAcid' function
that was inspired by Katja Schuerer/Catherine Letondal's python
tutorial:
========================
# test if this is an amino acid
from string import *
aa_mass = { 'A': 71.03711, 'R':156.10111, 'N':114.04293,
'D':115.02694, 'C':103.00919, 'E':129.04259,
'Q':128.05858, 'G': 57.02146, 'H':137.05891,
'I':113.08406, 'L':113.08406, 'K':128.09496,
'M':131.04049, 'F':147.06841, 'P': 97.05276,
'S': 87.03203, 'T':101.04768, 'W':186.07931,
'Y':163.06333, 'V': 99.06841
}
def isAminoAcid(aa):
aa=upper(aa)
if aa in 'ACDEFGHIKLMNPQRSTVWY':
return True
else:
return False
# main program for testing
pepMass = 0
seq = raw_input("Please enter a peptide sequence: ")
seq = upper(seq)
for i in range(len(seq)):
if not isAminoAcid(seq[i]):
print "This peptide contains an undefined amino acid in
position",(i+1)
break
else:
pepMass += aa_mass[seq[i]]
========================
Best wishes,
Achim