write.pqr.RdWrite a PQR file for a given ‘xyz’ Cartesian coordinate vector or matrix.
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")
| pdb | a PDB structure object obtained from
|
|---|---|
| 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. |
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.
Called for its effect.
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.
Barry Grant with contributions from Joao Martins.
Check that:
(1) chain is one character long e.g. “A”, and
(2) resno and eleno do not exceed “9999”.
read.pqr, read.pdb,
write.pdb, read.dcd,
read.fasta.pdb, read.fasta
# \donttest{ # PDB server connection required - testing excluded # Read a PDB file pdb <- read.pdb( "1bg2" )#> Note: Accessing on-line PDB file#> Warning: /var/folders/xf/qznxnpf91vb1wm4xwgnbt0xr0000gn/T//Rtmp4WslmZ/1bg2.pdb exists. Skipping download# 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") )#> #> See the output file: #> /var/folders/xf/qznxnpf91vb1wm4xwgnbt0xr0000gn/T//Rtmp4WslmZ/eg.pqr# }