prody/ProDy

Failure to correctly parse resnames with 4 letters

Opened this issue · 3 comments

Hi,
I have a problem with parsing 4 letter resnames (for example, membrane) in a correct way.

See below. All POPE and POPC are taken as 'POP'. I remember that some time ago, something was changed in parsing 3- and 4-letter resnames. I updated ProDy to the most current version. This code was working correctly a few months ago, I checked the code on two different systems, so I think this is because of this change that was made a few months ago.

Best, Karolina


AttributeError Traceback (most recent call last)
File ~/run1/generateDihe.py:12
10 total_dihe = []
11 sele_membrane = pdb.select('resname POPG POPE DOPC DOPE MCL2 TLCL TLCL2 PMCL')
---> 12 nr_sele_membrane = np.unique(sele_membrane.getResnums())
15 for nr_i,i in enumerate(nr_sele_membrane):
16 sele = sele_membrane.select('resid '+str(nr_sele_membrane[nr_i]))

AttributeError: 'NoneType' object has no attribute 'getResnums'

In [2]: np.unique((pdb.select('all not protein')).getResnames())
Out[2]: array(['CLA', 'FE1', 'FE2', 'PMC', 'POP', 'POT', 'TIP'], dtype='<U6')

Hi Karolina,

There is now an option for parsePDB called long_resname that is set to False by default. If you set it to True then it should give you the behaviour that you want.

We could also make it True by default. I don't remember why we didn't.

Oh, I missed that. Thanks James. I will try that later.

You're welcome