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, allow_heuristic_conn=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.non_poly_entities (
list
ofost.mol.EntityHandle
): OpenStructure entities representing all non-polymer (ligand) entities.seqres (
ost.seq.SequenceList
): Seqres sequences with entity id as sequence names and the respective canonical seqres as sequence.trg_seqres_mapping (
dict
): Dictionary with chain names in poly_ent as keys and the respective entity ids as values.
- 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()
allow_heuristic_conn (
bool
) – Only relevant if extract_nonpoly is True. The chemical component dictionary is relevant for connectivity information. By default, we enforce the presence of each non-polymer in the dictionary to ensure correct connectity. If you enable this flag, you allow the use of a distance based heuristic as fallback. With all its consequences in ligand matching.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.