write.pdb(pdb = NULL, file = "R.pdb", xyz = pdb$xyz, 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, append = FALSE, verbose = FALSE, chainter = FALSE, end = TRUE, sse = FALSE, print.segid = FALSE)
read.pdb
. Write a Protein Data Bank (PDB) file for a given xyz Cartesian coordinate vector or matrix.
Only the xyz
argument is strictly required. Other arguments
assume a default poly-ALA C-alpha structure with a blank chain id,
occupancy values of 1.00 and B-factors equal to 0.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.
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.
Check that:
(1) chain
is one character long e.g. A, and
(2) resno
and eleno
do not exceed 9999.
# PDB server connection required - testing excluded # Read a PDB file pdb <- read.pdb( "1bg2" )Note: Accessing on-line PDB file# Renumber residues nums <- as.numeric(pdb$atom[,"resno"]) nums <- nums - (nums[1] - 1) # Write out renumbered PDB file outfile = file.path(tempdir(), "eg.pdb") write.pdb(pdb=pdb, resno = nums, file = outfile) invisible( cat("\nSee the output file:", outfile, sep = "\n") )See the output file: /tmp/RtmpTDihxb/eg.pdb
read.pdb
, read.dcd
,
read.fasta.pdb
, read.fasta