write.pqr {bio3d} | R Documentation |
Write PQR Format Coordinate File
Description
Write a PQR file for a given ‘xyz’ Cartesian coordinate vector or matrix.
Usage
write.pqr(pdb = NULL, xyz = pdb$xyz, resno = NULL, resid = NULL, eleno =
NULL, elety = NULL, chain = NULL, o = NULL, b = NULL,
append = FALSE, verbose = FALSE, chainter = FALSE, file = "R.pdb")
Arguments
pdb |
|
xyz |
Cartesian coordinates as a vector or 3xN matrix. |
resno |
vector of residue numbers of length equal to length(xyz)/3. |
resid |
vector of residue types/ids of length equal to length(xyz)/3. |
eleno |
vector of element/atom numbers of length equal to length(xyz)/3. |
elety |
vector of element/atom types of length equal to length(xyz)/3. |
chain |
vector of chain identifiers with length equal to length(xyz)/3. |
o |
atomic partial charge values of length equal to length(xyz)/3. |
b |
atomic radii values of length equal to length(xyz)/3. |
append |
logical, if TRUE output is appended to the bottom of an existing file (used primarly for writing multi-model files). |
verbose |
logical, if TRUE progress details are printed. |
chainter |
logical, if TRUE a TER line is inserted between chains. |
file |
the output file name. |
Details
PQR file format is basically the same as PDB format except for the fields of
o
and b
. In PDB, these two fields are filled with ‘Occupancy’
and ‘B-factor’ values, respectively, with each field 6-column long.
In PQR, they are atomic ‘partial charge’ and ‘radii’
values, respectively, with each field 8-column long.
Only the xyz
argument is strictly required. Other arguments
assume a default poly-ALA C-alpha structure with a blank chain id,
atomic charge values of 0.00 and atomic radii equal to 1.00.
If the input argument xyz
is a matrix then each row is assumed
to be a different structure/frame to be written to a
“multimodel” PDB file, with frames separated by “END”
records.
Value
Called for its effect.
Note
Check that:
(1) chain
is one character long e.g. “A”, and
(2) resno
and eleno
do not exceed “9999”.
Author(s)
Barry Grant with contributions from Joao Martins.
References
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
For a description of PDB format (version3.3) see:
http://www.wwpdb.org/documentation/format33/v3.3.html.
See Also
read.pqr
, read.pdb
,
write.pdb
, read.dcd
,
read.fasta.pdb
, read.fasta
Examples
# PDB server connection required - testing excluded
# Read a PDB file
pdb <- read.pdb( "1bg2" )
# Write out in PQR format
outfile = file.path(tempdir(), "eg.pqr")
write.pqr(pdb=pdb, file = outfile)
invisible( cat("\nSee the output file:", outfile, sep = "\n") )