Downloads a PDB file (if required) and splits it to provide a file by chain


pdb.chain(pdb, keepfiles = FALSE)


pdb the path to the PDB of interest or a 4-letter identifier.

keepfiles logical, if TRUE the function makes a ‘temp’ directory and save in it a pdb file for each chain present in the given structure.


The function returns a chr vector where each coordinate is a chain from the structure.


The ptm package contains a number of ancillary functions that deal with Protein Data Bank (PDB) files. These functions may be useful when structural 3D data need to be analyzed. The mentioned functions are:

Quaternary structure exists in proteins consisting of two or more identical or different polypeptide chains (subunits). These proteins are called oligomers because they have two or more subunits. The quaternary structure describes the manner in which subunits are arranged in the native protein. When dealing with a PDB file of a protein possessing quaternary structure, the function pdb.chain(), which returns an array with the chain identifiers, can be useful. For instance, we can explore, as an example, the human placental glyceraldehyde-3-phosphate dehydrogenase (1U8F):


Note: Accessing on-line PDB file
PDB has ALT records, taking A only, rm.alt=TRUE
[1] “O” “P” “Q” “R”

We can check that this structure is a tetramer and the chain IDs are O, P, Q and R. Furthermore, we have the option to keep a pdb file for each single monomer, which sometimes can be very helpful for further analyses. Thus, if we are interested in keeping this single monomer pdb files, just change the argument keepfiles to TRUE:

pdb.chain('1u8f', keepfiles = TRUE)

In addition to returns the chain IDs, the function makes a temporal directory (within the current one) containing the desired files.