PDB2SQL

This module is based on sqlite3.

class pdb2sql.pdb2sqlcore.pdb2sql(pdbfile, tablename='atom', **kwargs)[source]

Create a SQL database with PDB data.

Notes

Only “ATOM” data of PDB is parsed, other items e.g. HETATM are not ignored.

Parameters

pdbfile (str, list, ndarray) – pdb file or data

Examples

>>> db = pdb2sql.pdb2sql('3CRO.pdb')

Process PDB

read_pdb(pdbfile)

Read pdb file or data to a list.

exportpdb(fname[, append, tablename])

Export a PDB file.

sql2pdb([tablename])

Convert SQL data to PDB formatted lines.

Get SQL Data

get(columns[, tablename])

Exectute simple SQL query to extract values.

get_colnames()

Get SQL column names.

get_chains([tablename])

Get the chain IDs.

get_residues([tablename])

Get the residue sequence.

get_xyz([tablename])

Shortcut to get the xyz coordinates.

Set SQL data

update(columns, values[, tablename])

Update the database with given values.

add_column(colname[, coltype, value, tablename])

Add an new column to the ATOM table with same value for each row.

update_column(colname, values[, index, ...])

Update a single column.

update_xyz(xyz[, tablename])

Update the xyz coordinates.