deepfold.data package

Subpackages

Submodules

deepfold.data.errors module

General-purpose errors used throughout the data pipeline

exception deepfold.data.errors.Error

Bases: Exception

Base class for exceptions.

exception deepfold.data.errors.PDBxConstructionError

Bases: PDBxError

exception deepfold.data.errors.PDBxConstructionWarning

Bases: PDBxWarning

exception deepfold.data.errors.PDBxError

Bases: Error

PDBx parsing errors.

exception deepfold.data.errors.PDBxWarning

Bases: Warning

PDBx parsing warnings.

deepfold.data.monomer module

class deepfold.data.monomer.AtomMap(mapping: Dict[str, str], removed: Set[str])

Bases: object

mapping: Dict[str, str]
removed: Set[str]
class deepfold.data.monomer.Ligand(id: str = '', name: str = '', graph: networkx.classes.graph.Graph = <networkx.classes.graph.Graph object at 0x7f164232bc70>)

Bases: object

graph: Graph = <networkx.classes.graph.Graph object>
id: str = ''
name: str = ''
deepfold.data.monomer.build_atom_map(can: str, mod: str) AtomMap
deepfold.data.monomer.fetch_ligand(id: str) str
deepfold.data.monomer.get_ligand(ligand_id: str, noh: bool = False, monomer_path: PathLike | None = None) Ligand
deepfold.data.monomer.read_ligand(ligand_id: str, monomer_path: PathLike | None = None) str

deepfold.data.pdbio module

Output of PDB files.

class deepfold.data.pdbio.IO

Bases: object

Base class.

set_chains(*chains) None
set_structure(pdb_object) None

Set structures. Precedence Structures are overrideds.

class deepfold.data.pdbio.PDBIO(use_model_flag: int = 0)

Bases: IO

Write a Structure object as a PDB file.

save(file, write_end: bool = True, preserve_atom_numbering: bool = False, remarks: str | Iterable[str] = '')

Save structure to a file.

deepfold.data.pdbx_parsing module

Protein Data Bank.

class deepfold.data.pdbx_parsing.AssemblyGenerator(assembly_id: str, asym_id_list: List[str], oper_sequence: List[str])

Bases: object

assembly_id: str
asym_id_list: List[str]
oper_sequence: List[str]
class deepfold.data.pdbx_parsing.AtomSite(residue_name: str, author_chain_id: str, label_chain_id: str, author_seq_num: str, label_seq_num: int, insertion_code: str, hetatm_atom: str, model_num: int)

Bases: object

author_chain_id: str
author_seq_num: str
hetatm_atom: str
insertion_code: str
label_chain_id: str
label_seq_num: int
model_num: int
residue_name: str
exception deepfold.data.pdbx_parsing.CategoryNotFoundError

Bases: PDBxError

class deepfold.data.pdbx_parsing.ModResidue(label_asym_id: str, label_comp_id: str, label_seq_id: int, insertion_code: str, parent_comp_id: List[str] = <factory>)

Bases: object

insertion_code: str
label_asym_id: str
label_comp_id: str
label_seq_id: int
parent_comp_id: List[str]
class deepfold.data.pdbx_parsing.Monomer(entity_id: str, num: int, mon_id: str)

Bases: object

entity_id: str
mon_id: str
num: int
class deepfold.data.pdbx_parsing.Op(op_id: str, is_identity: bool = True, rot: ndarray = array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), trans: ndarray = array([0., 0., 0.]))

Bases: object

Op(op_id: str, is_identity: bool = True, rot: numpy.ndarray = array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]), trans: numpy.ndarray = array([0., 0., 0.]))

is_identity: bool = True
op_id: str
rot: ndarray = array([[1., 0., 0.],        [0., 1., 0.],        [0., 0., 1.]])
to_dict()
trans: ndarray = array([0., 0., 0.])
class deepfold.data.pdbx_parsing.PDBxHeader(entry_id: str, deposition_date: str, method: str, resolution: float | None = None)

Bases: object

deposition_date: str
entry_id: str
method: str
resolution: float | None = None
class deepfold.data.pdbx_parsing.PDBxObject(header: deepfold.data.pdbx_parsing.PDBxHeader, structure: Bio.PDB.Structure.Structure, chain_ids: List[str], modres: Dict[Tuple[str, str, str], deepfold.data.pdbx_parsing.ModResidue], label_to_auth: Dict[str, str], auth_to_label: Dict[str, str], chain_to_entity: Dict[str, str], chain_to_structure: Dict[str, Dict[int, deepfold.data.pdbx_parsing.ResidueAtPosition]], assemblies: Dict[int, List[deepfold.data.pdbx_parsing.AssemblyGenerator]], operations: Dict[int, deepfold.data.pdbx_parsing.Op])

Bases: object

assemblies: Dict[int, List[AssemblyGenerator]]
auth_to_label: Dict[str, str]
chain_ids: List[str]
chain_to_entity: Dict[str, str]
chain_to_structure: Dict[str, Dict[int, ResidueAtPosition]]
header: PDBxHeader
label_to_auth: Dict[str, str]
modres: Dict[Tuple[str, str, str], ModResidue]
operations: Dict[int, Op]
structure: Structure
class deepfold.data.pdbx_parsing.PDBxParser

Bases: object

Parse a PDBx/mmCIF record.

inject()
parse(mmcif_string: str, catch_all_errors: bool = False) ParsingResult
class deepfold.data.pdbx_parsing.ParsingResult(mmcif_object: deepfold.data.pdbx_parsing.PDBxObject | None = None, errors: List[deepfold.data.errors.PDBxError] = <factory>)

Bases: object

errors: List[PDBxError]
mmcif_object: PDBxObject | None = None
class deepfold.data.pdbx_parsing.ResidueAtPosition(position: deepfold.data.pdbx_parsing.ResiduePosition | None, name: str, is_missing: bool, hetflag: str, residue_index: int, ordinal: int = 0)

Bases: object

hetflag: str
is_missing: bool
name: str
ordinal: int = 0
position: ResiduePosition | None
residue_index: int
class deepfold.data.pdbx_parsing.ResiduePosition(label_asym_id: str, auth_asym_id: str, label_seq_id: int, auth_seq_id: int, insertion_code: str)

Bases: object

auth_asym_id: str
auth_seq_id: int
insertion_code: str
label_asym_id: str
label_seq_id: int
deepfold.data.pdbx_parsing.fetch_mmcif(rcsb_id: str) str

Fetch mmCIF from RCSB.

deepfold.data.pdbx_parsing.get_assemblies(mmcif_object: PDBxObject)
deepfold.data.pdbx_parsing.get_chain_features(mmcif_object: PDBxObject, model_num: int, chain_id: str, out_chain_id: str | None = None) Tuple[Dict[str, ndarray], Structure]

Get atom positions and mask from a list of Biopython Residues.

deepfold.data.pdbx_parsing.get_fasta(mmcif_object: PDBxObject) str
deepfold.data.pdbx_parsing.loop_to_dict(prefix: str, index: str, dic: Mapping[str, Sequence[str]]) Mapping[str, Mapping[str, str]]
deepfold.data.pdbx_parsing.loop_to_list(prefix: str, dic: Mapping[str, Sequence[str]]) Sequence[Mapping[str, str]]
deepfold.data.pdbx_parsing.print_amap(mmcif_object: ~deepfold.data.pdbx_parsing.PDBxObject, auth_asym_id: str, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)
deepfold.data.pdbx_parsing.print_chain_features(feats, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)
deepfold.data.pdbx_parsing.read_mmcif(rcsb_id: str, mmcif_path: PathLike | None = None) str

Fetch a mmCIF file from local directory or from the web.

Module contents