Learn R Programming

bio3d (version 2.3-3)

read.pqr: Read PQR File

Description

Read a PQR coordinate file.

Usage

read.pqr(file, maxlines = -1, multi = FALSE, rm.insert = FALSE,
         rm.alt = TRUE, verbose = TRUE)

Arguments

file

the name of the PQR file to be read.

maxlines

the maximum number of lines to read before giving up with large files. By default if will read up to the end of input on the connection.

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.

Value

Returns a list of class "pdb" with the following components:

atom

a data.frame containing all atomic coordinate ATOM and HETATM data, with a row per ATOM/HETATM and a column per record type. See below for details of the record type naming convention (useful for accessing columns).

helix

‘start’, ‘end’ and ‘length’ of H type sse, where start and end are residue numbers “resno”.

sheet

‘start’, ‘end’ and ‘length’ of E type sse, where start and end are residue numbers “resno”.

seqres

sequence from SEQRES field.

xyz

a numeric matrix of class "xyz" containing the ATOM and HETATM coordinate data.

calpha

logical vector with length equal to nrow(atom) with TRUE values indicating a C-alpha “elety”.

call

the matched call.

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.

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).

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

atom.select, write.pqr, read.pdb, write.pdb, read.dcd, read.fasta.pdb, read.fasta

Examples

Run this code
# NOT RUN {
# PDB server connection required - testing excluded

# Read a PDB file and write it as a PQR file
pdb <- read.pdb( "4q21" )
outfile = file.path(tempdir(), "eg.pqr")
write.pqr(pdb=pdb, file = outfile)

# Read the PQR file
pqr <- read.pqr(outfile)

## Print a brief composition summary
pqr

## Examine the storage format (or internal *str*ucture)
str(pqr)

## Print data for the first four atom
pqr$atom[1:4,]

## Print some coordinate data
head(pqr$atom[, c("x","y","z")])

## Print C-alpha coordinates (can also use 'atom.select' function)
head(pqr$atom[pqr$calpha, c("resid","elety","x","y","z")])
inds <- atom.select(pqr, elety="CA")
head( pqr$atom[inds$atom, ] )

## The atom.select() function returns 'indices' (row numbers)
## that can be used for accessing subsets of PDB objects, e.g.
inds <- atom.select(pqr,"ligand")
pqr$atom[inds$atom,]
pqr$xyz[inds$xyz]

## See the help page for atom.select() function for more details.

# }

Run the code above in your browser using DataLab