- edited description
How to subset a PDB by range of residue
I have the attached PDB file.
The PDB read out with this code:
library(bio3d)
pdb_file <- "test.pdb"
pdb <- read.pdb(pdb_file)
pdb
looks like this:
Call: read.pdb(file = pdb_file)
Total Models#: 1
Total Atoms#: 712, XYZs#: 2136 Chains#: 1 (values: A)
Protein Atoms#: 712 (residues/Calpha atoms#: 44)
Nucleic acid Atoms#: 0 (residues/phosphate atoms#: 0)
Non-protein/nucleic Atoms#: 0 (residues: 0)
Non-protein/nucleic resid values: [ none ]
Protein sequence:
MGKGDPKKPRGKMSSYAFFVQTCREEHKKKHPDASVNFSEFSKK
+ attr: atom, xyz, calpha, call
What I want to do is to extract first 10 amino acid sequenceMGKGDPKKPR
from MGKGDPKKPRGKMSSYAFFVQTCREEHKKKHPDASVNFSEFSKK
(full) as PDB.
The final PDB is to include all atoms.
But with this code:
p1_sele <- atom.select(pdb, "protein", chain="A", resno = 1:10)
trim.pdb(pdb, p1_sele)
I only get MGK
.
Call: trim.pdb(pdb = pdb, p1_sele)
Total Models#: 1
Total Atoms#: 46, XYZs#: 138 Chains#: 1 (values: A)
Protein Atoms#: 46 (residues/Calpha atoms#: 3)
Nucleic acid Atoms#: 0 (residues/phosphate atoms#: 0)
Non-protein/nucleic Atoms#: 0 (residues: 0)
Non-protein/nucleic resid values: [ none ]
Protein sequence:
MGK
+ attr: atom, helix, sheet, seqres, xyz,
calpha, call
What’s the right way to do it?
Comments (9)
-
reporter -
reporter - edited description
-
The residue number in the PDB starts with 8. Hence, instead, you should use
resno=8:17
. -
reporter Thanks Xinqiu. I got it.
By the way is there a way using Bio3D to renumber the residue number from 8 to 1
on my test.pdb? -
Yes, try
clean.pdb(pdb, force.renumber=TRUE)
-
reporter Xinqiu, I appreciate your prompt reply.
What’s the difference of your suggestion with
convert.pdb(pdb, type = "pdb", renumber = TRUE, first.resno = 1)
?
Which is safer? -
They are the same effect.
clean.pdb()
does more checking and you may ignore some of the warnings (if there are any). -
reporter Xinqiu. Thank you so much.
-
- changed status to resolved
- Log in to comment