scoring_base
– Helper functions for scoring¶
- CleanHydrogens(ent, clib)¶
Scoring helper - Returns copy of ent without hydrogens
Non-standard hydrogen naming can cause trouble in residue property assignment which is done by the
ost.conop.RuleBasedProcessor
when loading. In fact, residue property assignment is not done for every residue that has unknown atoms according to the chemical component dictionary. This function therefore re-processes the entity after removing hydrogens.- Parameters:
ent (
ost.mol.EntityHandle
/ost.mol.EntityView
) – Entity to cleanclib (
ost.conop.CompoundLib
) – Compound library to perform re-processing after hydrogen removal.
- Returns:
Cleaned and re-processed ent
- MMCIFPrep(mmcif_path, biounit=None, extract_nonpoly=False, fault_tolerant=False, extract_seqres_mapping=False)¶
Scoring helper - Prepares input from mmCIF
Only performs gentle cleanup of hydrogen atoms. Further cleanup is delegated to scoring classes.
Depending on input flags, the following outputs can be retrieved:
poly_ent (
ost.mol.EntityHandle
): An OpenStructure entity with only polymer chains. This is based on _entity.type extracted from mmcif_path. If _entity.type is not defined for every chain, a warning is logged and the returned poly_ent is a selection for peptide and nucleotide residues as defined in the chemical component dictionary.non_poly_entities (
list
ofost.mol.EntityHandle
): OpenStructure entities representing all non-polymer (ligand) entities. This is based on _entity.type extracted from mmcif_path. If _entity.type is not defined for every chain, an error is raised.seqres (
ost.seq.SequenceList
): Seqres sequences with entity id as sequence names and the respective canonical seqres as sequence. Set to None and triggers a warning if information is missing in mmcif_path.trg_seqres_mapping (
dict
): Dictionary with chain names in poly_ent as keys and the respective entity ids as values. Set to None and triggers a warning if information is missing in mmcif_path.
- Parameters:
mmcif_path (
str
) – Path to mmCIF file that contains polymer and optionally non-polymer entitiesbiounit (
str
) – If given, construct specified biounit from mmCIF AUextract_nonpoly (
bool
) – Controls return valuefault_tolerant (
bool
) – Passed as parameter toost.io.LoadMMCIF()
extract_seqres_mapping (
bool
) – Controls return value
- Returns:
poly_ent if extract_nonpoly/extract_seqres_mapping are False. (poly_ent, non_poly_entities) if extract_nonpoly is True. (poly_ent, seqres, trg_seqres_mapping) if extract_seqres_mapping is True. (poly_ent, non_poly_entities, seqres, trg_seqres_mapping) if both flags are True.
- PDBPrep(pdb_path, fault_tolerant=False)¶
Scoring helper - Prepares scoring input from PDB
Only performs gentle cleanup of hydrogen atoms. Further cleanup is delegated to scoring classes. There is no logic to extract ligands from PDB files. Ligands must be provided separately as SDF files in these cases.
- Parameters:
pdb_path (
str
) – Path to PDB file that contains polymer entitiesfault_tolerant (
bool
) – Passed as parameter toost.io.LoadPDB()
- Returns:
EntityHandle
from loaded file.