read.pdcBD.Rd
Read a pdcBD PQR coordinate file.
read.pdcBD(file, maxlines = 50000, multi = FALSE, rm.insert = FALSE, rm.alt = TRUE, verbose = TRUE)
file | the name of the pdcBD PQR file to be read. |
---|---|
maxlines | the maximum number of lines to read before giving up with large files. Default is 50,000 lines. |
multi | logical, if TRUE multiple ATOM records are read for all models in multi-model files. |
rm.insert | logical, if TRUE PDB insert records are ignored. |
rm.alt | logical, if TRUE PDB alternate records are ignored. |
verbose | print details of the reading process. |
maxlines
may require increasing for some large multi-model files.
The preferred means of reading such data is via binary DCD format
trajectory files (see the read.dcd
function).
Returns a list of class "pdb"
with the following components:
a character matrix containing all atomic coordinate ATOM data, with a row per ATOM and a column per record type. See below for details of the record type naming convention (useful for accessing columns).
a character matrix containing atomic coordinate records
for atoms within “non-standard” HET groups (see atom
).
‘start’, ‘end’ and ‘length’ of H type sse, where start and end are residue numbers “resno”.
‘start’, ‘end’ and ‘length’ of E type sse, where start and end are residue numbers “resno”.
sequence from SEQRES field.
a numeric vector of ATOM coordinate data.
logical vector with length equal to nrow(atom)
with TRUE values indicating a C-alpha “elety”.
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
For both atom
and het
list components the column names can be
used as a convenient means of data access, namely:
Atom serial number “eleno” ,
Atom type “elety”,
Alternate location indicator “alt”,
Residue name “resid”,
Chain identifier “chain”,
Residue sequence number “resno”,
Code for insertion of residues “insert”,
Orthogonal coordinates “x”,
Orthogonal coordinates “y”,
Orthogonal coordinates “z”,
Occupancy “o”, and
Temperature factor “b”.
See examples for further details.
# \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//Rtmp9oBdbc/1bg2.pdb exists. Skipping download# Print data for the first atom pdb$atom[1,]#> type eleno elety alt resid chain resno insert x y z o b #> 1 ATOM 1 N <NA> ASP A 3 <NA> 43.743 -2.106 39.408 1 100 #> segid elesy charge #> 1 <NA> N <NA># Look at the first het atom pdb$het[1,]#> NULL#> x y z #> 1 43.743 -2.106 39.408 #> 2 45.053 -2.661 39.856 #> 3 45.305 -2.401 41.340 #> 4 46.119 -3.083 41.957 #> 5 46.204 -2.067 39.034 #> 6 45.912 -2.039 37.542 #> 7 45.455 -3.066 36.993 #> 8 46.136 -0.978 36.920 #> 9 44.627 -1.402 41.903 #> 10 44.791 -1.079 43.319 #> 11 44.313 -2.242 44.183 #> 12 45.079 -2.800 44.969 #> 13 44.015 0.191 43.679 #> 14 44.010 0.584 45.160 #> 15 45.430 0.779 45.663 #> 16 43.202 1.850 45.351 #> 17 43.039 -2.590 44.037 #> 18 42.451 -3.691 44.790 #> 19 41.508 -4.495 43.904 #> 20 41.084 -5.588 44.275# Print C-alpha coordinates (can also use 'atom.select') ##pdb$xyz[pdb$calpha, c("resid","x","y","z")] # Print SSE data (for helix and sheet) pdb$helix#> $start #> #> 20 58 67 91 107 176 197 256 277 281 306 #> #> $end #> #> 25 65 74 95 122 191 203 269 279 288 321 #> #> $chain #> [1] "A" "A" "A" "A" "A" "A" "A" "A" "A" "A" "A" #> #> $type #> [1] "1" "1" "1" "1" "1" "1" "1" "1" "5" "1" "5" #>pdb$sheet$start#> #> 50 8 295 79 222 205 126 171 32 38 44 135 141 155 163# Print SEQRES data pdb$seqres#> A A A A A A A A A A A A A #> "MET" "ALA" "ASP" "LEU" "ALA" "GLU" "CYS" "ASN" "ILE" "LYS" "VAL" "MET" "CYS" #> A A A A A A A A A A A A A #> "ARG" "PHE" "ARG" "PRO" "LEU" "ASN" "GLU" "SER" "GLU" "VAL" "ASN" "ARG" "GLY" #> A A A A A A A A A A A A A #> "ASP" "LYS" "TYR" "ILE" "ALA" "LYS" "PHE" "GLN" "GLY" "GLU" "ASP" "THR" "VAL" #> A A A A A A A A A A A A A #> "VAL" "ILE" "ALA" "SER" "LYS" "PRO" "TYR" "ALA" "PHE" "ASP" "ARG" "VAL" "PHE" #> A A A A A A A A A A A A A #> "GLN" "SER" "SER" "THR" "SER" "GLN" "GLU" "GLN" "VAL" "TYR" "ASN" "ASP" "CYS" #> A A A A A A A A A A A A A #> "ALA" "LYS" "LYS" "ILE" "VAL" "LYS" "ASP" "VAL" "LEU" "GLU" "GLY" "TYR" "ASN" #> A A A A A A A A A A A A A #> "GLY" "THR" "ILE" "PHE" "ALA" "TYR" "GLY" "GLN" "THR" "SER" "SER" "GLY" "LYS" #> A A A A A A A A A A A A A #> "THR" "HIS" "THR" "MET" "GLU" "GLY" "LYS" "LEU" "HIS" "ASP" "PRO" "GLU" "GLY" #> A A A A A A A A A A A A A #> "MET" "GLY" "ILE" "ILE" "PRO" "ARG" "ILE" "VAL" "GLN" "ASP" "ILE" "PHE" "ASN" #> A A A A A A A A A A A A A #> "TYR" "ILE" "TYR" "SER" "MET" "ASP" "GLU" "ASN" "LEU" "GLU" "PHE" "HIS" "ILE" #> A A A A A A A A A A A A A #> "LYS" "VAL" "SER" "TYR" "PHE" "GLU" "ILE" "TYR" "LEU" "ASP" "LYS" "ILE" "ARG" #> A A A A A A A A A A A A A #> "ASP" "LEU" "LEU" "ASP" "VAL" "SER" "LYS" "THR" "ASN" "LEU" "SER" "VAL" "HIS" #> A A A A A A A A A A A A A #> "GLU" "ASP" "LYS" "ASN" "ARG" "VAL" "PRO" "TYR" "VAL" "LYS" "GLY" "CYS" "THR" #> A A A A A A A A A A A A A #> "GLU" "ARG" "PHE" "VAL" "CYS" "SER" "PRO" "ASP" "GLU" "VAL" "MET" "ASP" "THR" #> A A A A A A A A A A A A A #> "ILE" "ASP" "GLU" "GLY" "LYS" "SER" "ASN" "ARG" "HIS" "VAL" "ALA" "VAL" "THR" #> A A A A A A A A A A A A A #> "ASN" "MET" "ASN" "GLU" "HIS" "SER" "SER" "ARG" "SER" "HIS" "SER" "ILE" "PHE" #> A A A A A A A A A A A A A #> "LEU" "ILE" "ASN" "VAL" "LYS" "GLN" "GLU" "ASN" "THR" "GLN" "THR" "GLU" "GLN" #> A A A A A A A A A A A A A #> "LYS" "LEU" "SER" "GLY" "LYS" "LEU" "TYR" "LEU" "VAL" "ASP" "LEU" "ALA" "GLY" #> A A A A A A A A A A A A A #> "SER" "GLU" "LYS" "VAL" "SER" "LYS" "THR" "GLY" "ALA" "GLU" "GLY" "ALA" "VAL" #> A A A A A A A A A A A A A #> "LEU" "ASP" "GLU" "ALA" "LYS" "ASN" "ILE" "ASN" "LYS" "SER" "LEU" "SER" "ALA" #> A A A A A A A A A A A A A #> "LEU" "GLY" "ASN" "VAL" "ILE" "SER" "ALA" "LEU" "ALA" "GLU" "GLY" "SER" "THR" #> A A A A A A A A A A A A A #> "TYR" "VAL" "PRO" "TYR" "ARG" "ASP" "SER" "LYS" "MET" "THR" "ARG" "ILE" "LEU" #> A A A A A A A A A A A A A #> "GLN" "ASP" "SER" "LEU" "GLY" "GLY" "ASN" "CYS" "ARG" "THR" "THR" "ILE" "VAL" #> A A A A A A A A A A A A A #> "ILE" "CYS" "CYS" "SER" "PRO" "SER" "SER" "TYR" "ASN" "GLU" "SER" "GLU" "THR" #> A A A A A A A A A A A A A #> "LYS" "SER" "THR" "LEU" "LEU" "PHE" "GLY" "GLN" "ARG" "ALA" "LYS" "THR" "ILE"# Renumber residues nums <- as.numeric(pdb$atom[,"resno"]) pdb$atom[,"resno"] <- nums - (nums[1] - 1) # Write out renumbered PDB file #write.pdb(pdb=pdb,file="eg.pdb") # }