trim.pdb() with 'inverse' argument
Issue #176
resolved
I made a small revision of the trim.pdb() function to enable trimming of the inverse selection. Usage could e.g. be to select everything else than the protein:
pdb <- read.pdb("1BPX")
sele <- atom.select(pdb, "protein")
np <- trim.pdb(pdb, sele, invese=TRUE)
Only a small revision is needed in the function.
if(inverse) {
sele.all <- atom.select(pdb, "all", verbose=verbose)
tmp <- NULL
tmp$atom <- which(!(sele.all$atom %in% inds$atom))
tmp$xyz <- atom2xyz(tmp$atom)
class(tmp) <- "select"
inds <- tmp
rm(tmp)
if(verbose) {
cat("\n Selection inverted. Summary of new indices follows: \n")
print(inds)
}
}
Comments (4)
-
-
That's a good point! Have you already implemented it in the function?
-
reporter I have a version in trim.pdb, but perhaps it makes more sense to put it in atom.select. I will try
-
reporter - changed status to resolved
implemented in atom.select() (commit cca9397)
- Log in to comment
Looks good - perhaps atom.select() itself would benefit from this capability?