Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to select minus (-) residue number #2021

Open
locitran opened this issue Dec 25, 2024 · 1 comment
Open

How to select minus (-) residue number #2021

locitran opened this issue Dec 25, 2024 · 1 comment

Comments

@locitran
Copy link

locitran commented Dec 25, 2024

pdb = pd.parsePDB('2HHN', subset='calpha')
pdb.select('chain A and resid -1 and resname ARG')

Error

UFuncTypeError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
pdb['A'].getAtomGroup().getResnums()
# array([ -2,  -1,   0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10, ... ])

It seems the selection method cannot take the negative value. Is there any alternative method to do so?
Thanks

@jamesmkrieger
Copy link
Contributor

I think there was a way to do this but I will need to check it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants