atom.select() residues that are inserts
atom.select() does not appear to enable the selection of a single residue that is an insert.
So selecting just by the chain & resno ends up selecting more than one residue.
Comments (10)
-
-
I agree. Also, both NA and '' (empty string) can be used for 'non-inserted' residues.
-
so that
atom.select(pdb, resno=186, insert="") # equals to atom.select(pdb, resno=186, insert=NA)
?
-
Yes, I think so. What do you think?
-
Sure - sounds good. Though what is the new default for insert then?
-
Updated function in commit https://bitbucket.org/Grantlab/bio3d/commits/c14466a8c7a66adad689e39e26df2b9cfa7e5c4e (sorry I didn't see your comment before pushing the commit).
Default value is
insert = NULL
which will select both inserts and non-insert residues.> pdb$atom[ atom.select(pdb, "calpha", resno=186, insert="")$atom, 1:8] type eleno elety alt resid chain resno insert 1260 ATOM 1260 CA <NA> PRO A 186 <NA> > pdb$atom[ atom.select(pdb, "calpha", resno=186, insert=NA)$atom, 1:8] type eleno elety alt resid chain resno insert 1260 ATOM 1260 CA <NA> PRO A 186 <NA> > pdb$atom[ atom.select(pdb, "calpha", resno=186, insert=NULL)$atom, 1:8] type eleno elety alt resid chain resno insert 1260 ATOM 1260 CA <NA> PRO A 186 <NA> 1267 ATOM 1267 CA <NA> ARG A 186 A 1278 ATOM 1278 CA <NA> ARG A 186 B # same as > pdb$atom[ atom.select(pdb, "calpha", resno=186, insert=c(NA, "A", "B"))$atom, 1:8] type eleno elety alt resid chain resno insert 1260 ATOM 1260 CA <NA> PRO A 186 <NA> 1267 ATOM 1267 CA <NA> ARG A 186 A 1278 ATOM 1278 CA <NA> ARG A 186 B > pdb$atom[ atom.select(pdb, "calpha", resno=186, insert=c("A", "B"))$atom, 1:8] type eleno elety alt resid chain resno insert 1267 ATOM 1267 CA <NA> ARG A 186 A 1278 ATOM 1278 CA <NA> ARG A 186 B
-
Great. Thanks a lot!
-
- changed status to resolved
-
reporter I agree with setting insert = NULL as the default.
Thanks for committing the fix. You guys are super fast at responding to requests / bugs, that it is impressive.
-
- changed version to v2.2
- Log in to comment
Hi Mark, Thanks for reporting. We've been discussing if we should include an insert argument in the atom.select function. What do you and others think about the following addition: