Lib PDB

Contain handlers of PDB information.

class idpconfgen.libs.libpdb.PDBID(name, chain=None, segment=None)[source]

PDB object identifier.

Identifies unique downloadable/stored units.

In the current implmentation each unit is one PDB chain, which is identified by the PDBID and its chain identifier.

Parameters:
  • name (obj:str) – The PDBID, for example: 1ABC

  • chain (obj:str) – The chain identifier. Defaults to None.

Variables:
  • name – The four character PDB identifier.

  • chain – The chain identifier.

class idpconfgen.libs.libpdb.PDBIDFactory(name)[source]

Parse input for PDBID instatiation.

Parameters:

name (str or Path) – The code name or ID that identified the PDB. Possible formats:

  • XXXX

  • XXXXC*

  • XXXX_C*

  • *.pdb

where XXXX is the PDBID code, C is the chain ID and * means any number of characters. PDB and chaind ID codes are any digits, lower and upper case letters.

Returns:

PDBID object.

class idpconfgen.libs.libpdb.PDBList(pdb_names)[source]

List of PDBID objects.

Parameters:

pdb_names (obj:iterator) – An iterator containing the PDB names. PDB names can be in the form accepted by PDBIDFactory or PDBID objects.

difference(other)[source]

Difference between self and other.

Returns:

PDBList

property name_chains_dict

Chains dictionary map.

Type:

Export PDBIDs

property pdbids

Generate the PDBID names.

to_tuple()[source]

Convert PDBList to sorted tuple.

write(filename='PDBIDs.list')[source]

Write to a file the PDBIDs in the PDBList.

Parameters:

filename (str, optional) – The output file name.

idpconfgen.libs.libpdb.delete_insertions(lines)[source]

Delete insertions.

Adapted from pdbtools and optimized for this context.

Visit pdb-tools at: https://github.com/haddocking/pdb-tools/blob/master/pdbtools/pdb_delinsertion.py

idpconfgen.libs.libpdb.format_atom_name(atom, element, AFD={1: {1: ' {:<3s}', 2: ' {:<3s}', 3: ' {:<3s}', 4: '{:<4s}'}, 2: {1: '{:<4s}', 2: '{:<4s}', 3: '{:<4s}', 4: '{:<4s}'}})[source]

Format PDB Record line Atom name.

Further Reading:

Parameters:
  • atom (str) – The atom name.

  • element (str) – The atom element code.

Returns:

str – Formatted atom name.

idpconfgen.libs.libpdb.format_chainid(chain)[source]

Format chain identifier to one letter.

This is required to receive chain IDs from mmCIF files, which may have more than one letter.

idpconfgen.libs.libpdb.get_fasta_from_PDB(pdbid)[source]

Extract FASTA from PDB.

idpconfgen.libs.libpdb.is_pdb(datastr)[source]

Detect if datastr if a PDB format v3 file.