mmtbx.wwpdb package

Submodules

mmtbx.wwpdb.rcsb_web_services module

Module for querying the RCSB web server using the REST API, as described here: https://search.rcsb.org/index.html#search-api

There is some overlap with iotbx.pdb.fetch, which really should have gone here instead, but this module is intended to be used in higher-level automation pipelines.

mmtbx.wwpdb.rcsb_web_services.add_nodes_to_query_if_needed_in_place(query_json)

Find all entry IDs with the specified chemical ID.

Parameters:
  • resname (str)

  • kwds (dict) – Keyword arguments passed to post_query.

Examples

>>> from mmtbx.wwpdb.rcsb_web_services import chemical_id_search
>>> len(chemical_id_search("ZN", data_only=True))
2874
mmtbx.wwpdb.rcsb_web_services.get_high_resolution_and_residue_count_for_structures(pdb_ids)
mmtbx.wwpdb.rcsb_web_services.get_high_resolution_for_structures(pdb_ids)
mmtbx.wwpdb.rcsb_web_services.get_ligand_info_for_structures(pdb_ids)

Return a list of ligands in the specified structure(s), including the SMILES strings.

Returns list of lists with [PDB ID, chain id, lig id, lig MW, lig Formula, lig name, lig SMILES] If the same ligand is present in different chains, it will produce several entries which will be different in chain ids.

[[u’1MRU’, u’A’, u’MG’, u’24.31’, u’Mg 2’, u’MAGNESIUM ION’, u’[Mg+2]’],

[u’1MRU’, u’B’, u’MG’, u’24.31’, u’Mg 2’, u’MAGNESIUM ION’, u’[Mg+2]’]]

mmtbx.wwpdb.rcsb_web_services.get_r_work_rfree_for_structures(pdb_ids)

Get Rwork and Rfree for list of pdb ids :param pdb_ids: pdb ids :type pdb_ids: list

Returns:

[[pdb_id, rwork, rfree], [pdb_id, rwork, rfree], …]

Return type:

list

mmtbx.wwpdb.rcsb_web_services.polymeric_type_filter(value='Protein (only)')
mmtbx.wwpdb.rcsb_web_services.post_query(query_json=None, xray_only=True, d_max=None, d_min=None, protein_only=False, data_only=False, log=None, sort_by_resolution=False)

Make request to RCSB search API and return list of PDB ids, optionally with chain IDs. If query_json is not supplied, generic one will be used which searches for everything in PDB. It will be enhanced according to other parameters.

Parameters:
  • query_json (dict, optional) – _description_. Defaults to None.

  • xray_only (bool, optional) – Return only xray structures. Defaults to True.

  • d_max (_type_, optional) – Max resolution. Defaults to None.

  • d_min (_type_, optional) – Min resolution. Defaults to None.

  • protein_only (bool, optional) – Return only protein entries. Defaults to False.

  • data_only (bool, optional) – Return only entries with experimental data. Defaults to False.

  • log (_type_, optional) – Handler for log. Defaults to None.

  • sort_by_resolution (bool, optional) – Sort by entry resolution. Defaults to False.

Returns:

PDB ids

Return type:

list

mmtbx.wwpdb.rcsb_web_services.post_report_query_with_pdb_list(query, pdb_ids)
mmtbx.wwpdb.rcsb_web_services.resolution_filter(operator, value)

Homology search for an amino acid sequence. The advantage of using this service over the NCBI/EBI BLAST servers (in iotbx.pdb.fetch) is the ability to exclude non-Xray structures.

identity_cutoffint, optional

Apply sequence filtering to remove structures with greater than this percentage sequence identity.

e_value_cutofffloat, optional

Hits with an E-Value above the cutoff value are filtered out

mmtbx.wwpdb.standard_geometry_cif module

Parser for Kim Henrick’s standard_geometry.cif file: http://www.ebi.ac.uk/~henrick/newpdb/standard_geometry.cif

class mmtbx.wwpdb.standard_geometry_cif.chem_comp_atom

Bases: object

alt_atom_id
atom_id
ccp4_partial_charge
ccp4_type_energy
charge
descriptor
pdbx_align
pdbx_aromatic_flag
pdbx_leaving_atom_flag
pdbx_model_cartn_x_ideal
pdbx_model_cartn_y_ideal
pdbx_model_cartn_z_ideal
pdbx_ordinal
pdbx_stereo_config
ref_radii_asa_probe
site_ideal()
type_symbol
mmtbx.wwpdb.standard_geometry_cif.get_cif_float(s)
mmtbx.wwpdb.standard_geometry_cif.get_cif_int(s)
mmtbx.wwpdb.standard_geometry_cif.get_cif_number(type, s)
class mmtbx.wwpdb.standard_geometry_cif.process_chem_comp_atom_buffer(buffer)

Bases: object

atoms
comp_id
count_non_hydrogen_atoms()
mmtbx.wwpdb.standard_geometry_cif.process_chem_comps(file_name)

mmtbx.wwpdb.utils module

Utilities for re-refining (or otherwise working with) structures downloaded directly from the PDB.

mmtbx.wwpdb.utils.combine_split_structure(pdb_file, pdb_id, base_dir=None, log=None)

Assembles complete structures from split PDB files (e.g. ribosomes), preserving the original file name. Return value is a list of IDs which were added to the current model (or None).

mmtbx.wwpdb.utils.fetch_pdb_data(pdb_id, pdb_dir=None, sf_dir=None, log=None, verbose=False)

Copy data from local repository if defined and available, or download it from the PDB, and run cif_as_mtz.

class mmtbx.wwpdb.utils.filter_pdb_file(pdb_file, output_file=None, log=None, quiet=False, set_se_occ=True, remove_atoms_with_zero_occupancy=False)

Bases: object

Processing of PDB files to remove common pathologies and enable automatic refinement behavior. In particular, delete unknown atoms and ligands, reduce the occupancy of Se atoms from 1 to trigger occupancy refinement, and optionally remove zero-occupancy atoms.

mmtbx.wwpdb.utils.find_data_arrays(mtz_file, log=None, merge_anomalous=False, preferred_labels=None, crystal_symmetry=None)

Guess an appropriate data array to use for refinement, plus optional Hendrickson-Lattman coefficients and R-free flags if present.

mmtbx.wwpdb.utils.get_program(pdb_file)

Module contents