get_pdb_file {rPDBapi}R Documentation

Download PDB Files from RCSB Database

Description

This function downloads PDB files from the RCSB database, supporting different file types and optional compression. It warns to consider compression for CIF files for faster download.

Usage

get_pdb_file(
  pdb_id,
  filetype = "cif",
  rm.insert = FALSE,
  rm.alt = TRUE,
  compression = TRUE,
  save = FALSE,
  path = NULL
)

Arguments

pdb_id

A 4-character string specifying a PDB entry of interest.

filetype

The file type: 'pdb', 'cif', 'xml', or 'structfact'. Default is 'pdb'.pdb is the older file format and cif is the newer replacement. xlm is also can be obtained and parsed. structfact retrieves structure factors (only available for certain PDB entries).

rm.insert

Logical, if TRUE PDB insert records are ignored.

rm.alt

Logical, if TRUE PDB alternate records are ignored.

compression

Logical indicating whether to request the data as a compressed version. Default is TRUE

save

Logical, if TRUE saves PDB file to the desired path.

path

The path where the file should be saved. If NULL, the file is saved in a temporary directory.

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.

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.

Examples

pdb_file <-  get_pdb_file(pdb_id = "4HHB", filetype = "cif")

[Package rPDBapi version 1.1 Index]