as.pdb(...)"as.pdb"(mol, ...)"as.pdb"(prmtop, crd=NULL, inds=NULL, inds.crd=inds, ncore=NULL, ...)"as.pdb"(pdb=NULL, xyz=NULL, type=NULL, resno=NULL, resid=NULL, eleno=NULL, elety=NULL, chain=NULL, insert=NULL, alt=NULL, o=NULL, b=NULL, segid=NULL, elesy=NULL, charge=NULL, verbose=TRUE, ...)
"mol2"
(obtained with
read.mol2
). "prmtop"
(obtained with
read.prmtop
). "crd"
(obtained with
read.crd.amber
). "select"
as obtained from
atom.select
. The indices points to which atoms in the
PRMTOP object to convert. ncore>1
requires package parallel installed. read.pdb
. ncol(as.xyz(xyz))/3
(see as.xyz
).
If xyz
is not provided the number of atoms will be based on
the length of eleno
, resno
, or resid
(in that
order). ncol(as.xyz(xyz))/3
. Alternatively, a single element
character vector can be provided which will be repeated to match
the number of atoms. ncol(as.xyz(xyz))/3
. ncol(as.xyz(xyz))/3
. Alternatively, a single element
character vector can be provided which will be repeated to match
the number of atoms. ncol(as.xyz(xyz))/3
. ncol(as.xyz(xyz))/3
. Alternatively, a single element
character vector can be provided which will be repeated to match
the number of atoms. ncol(as.xyz(xyz))/3
. Alternatively, a single element
character vector can be provided which will be repeated to match
the number of atoms. ncol(as.xyz(xyz))/3
. ncol(as.xyz(xyz))/3
. ncol(as.xyz(xyz))/3
. Alternatively, a single element
numeric vector can be provided which will be repeated for to match
the number of atoms. ncol(as.xyz(xyz))/3
.
Alternatively, a single element numeric vector can be provided
which will be repeated to match the number of atoms.ncol(as.xyz(xyz))/3
. Alternatively, a single element character vector can
be provided which will be repeated to match the number of
atoms. ncol(as.xyz(xyz))/3
. Alternatively, a single element character vector can
be provided which will be repeated to match the number of
atoms. ncol(as.xyz(xyz))/3
. Convert Tripos Mol2 format, or Amber parameter/topology and coordinate data to PDB format.
This function converts Tripos Mol2 format, Amber formatted parameter/topology (PRMTOP) and coordinate objects, and vector data to a PDB object.
While as.pdb.mol2
and as.pdb.prmtop
converts specific
objects to a PDB object, as.pdb.default
provides basic
functionality to convert raw data such as vectors of e.g. residue numbers,
residue identifiers, Cartesian coordinates, etc to a PDB object. When
pdb
is provided the returned PDB object is built from the input
object with fields replaced by any input vector arguments.
e.g. as.pdb(pdb, xyz=crd)
will return the same PDB object, with
only the Cartesian coordinates changed to crd
.
"pdb"
with the following components:
xyz
. nrow(atom)
with TRUE values indicating a C-alpha elety. Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696. http://ambermd.org/formats.html
## Vector(s) to PDB object pdb <- as.pdb(resno=1:6, elety="CA", resid="ALA", chain="A")Summary of PDB generation: .. number of atoms in PDB determined by 'resno' .. 6 atom(s) from 'string' selection .. 6 atom(s) in final combined selection .. number of atoms in PDB: 6 .. number of calphas in PDB: 6 .. number of residues in PDB: 6pdbCall: as.pdb.default(resno = 1:6, resid = "ALA", elety = "CA", chain = "A") Total Models#: 1 Total Atoms#: 6, XYZs#: 18 Chains#: 1 (values: A) Protein Atoms#: 6 (residues/Calpha atoms#: 6) Nucleic acid Atoms#: 0 (residues/phosphate atoms#: 0) Non-protein/nucleic Atoms#: 0 (residues: 0) Non-protein/nucleic resid values: [ none ] Protein sequence: AAAAAA + attr: atom, xyz, calpha, call## Read a PRMTOP file prmtop <- read.prmtop(system.file("examples/crambin.prmtop", package="bio3d")) ## Read Amber coordinates crds <- read.crd(system.file("examples/crambin.inpcrd", package="bio3d")) ## Atom selection ca.inds <- atom.select(prmtop, "calpha")Summary of PDB generation: .. number of atoms in PDB determined by 'xyz' .. 46 atom(s) from 'string' selection .. 46 atom(s) in final combined selection .. number of atoms in PDB: 639 .. number of calphas in PDB: 46 .. number of residues in PDB: 46## Convert to PDB format pdb <- as.pdb(prmtop, crds, inds=ca.inds)Summary of PDB generation: .. number of atoms in PDB determined by 'xyz' .. 46 atom(s) from 'string' selection .. 46 atom(s) in final combined selection .. number of atoms in PDB: 46 .. number of calphas in PDB: 46 .. number of residues in PDB: 46## Read a single entry MOL2 file ## (returns a single object) mol <- read.mol2( system.file("examples/aspirin.mol2", package="bio3d") ) ## Convert to PDB pdb <- as.pdb(mol)Summary of PDB generation: .. number of atoms in PDB determined by 'xyz' .. 0 atom(s) from 'string' selection .. 0 atom(s) in final combined selection .. number of atoms in PDB: 20 .. number of calphas in PDB: 0 .. number of residues in PDB: 1