pinder.eval.dockq package#

Submodules#

pinder.eval.dockq.biotite_dockq module#

pinder.eval.dockq.biotite_dockq.get_irmsd_interface(native: Path, chain1: list[str], chain2: list[str], backbone_only: bool = False, heavy_only: bool = False, interface_cutoff: float = 10.0) dict[str, list[int]][source][source]#

Get the residues part of the interface by chain, using a more permissive contact distance cutofff definition of 10A.

class pinder.eval.dockq.biotite_dockq.DecoyDockQ(native: AtomArray, decoy: AtomArray | AtomArrayStack, chain_config: ChainConfig, backbone_definition: BackboneDefinition, native_contacts: set[tuple[str, str, int, int]], native_interface: dict[str, list[int]])[source][source]#

Bases: object

get_metrics() DataFrame | dict[str, float | str | int][source]#
get_lrmsd() ndarray[Any, dtype[float64]] | float[source]#
get_irmsd() ndarray[Any, dtype[float64]] | float[source]#
get_decoy_contacts() list[set[tuple[str, str, int, int]]][source]#
class pinder.eval.dockq.biotite_dockq.BiotiteDockQ(native: Path, decoys: list[Path] | Path, native_receptor_chain: list[str] | None = None, native_ligand_chain: list[str] | None = None, decoy_receptor_chain: list[str] | None = None, decoy_ligand_chain: list[str] | None = None, pdb_engine: str = 'fastpdb', backbone_definition: BackboneDefinition = 'dockq', parallel_io: bool = True, max_workers: int | None = None)[source][source]#

Bases: object

Biotite interface for fast calculation of DockQ and CAPRI metrics.

Takes as input one native and all it’s decoys from arbitrary number of methods to compare.

calculate() DataFrame[source]#
get_native_contacts() None[source]#
prepare_inputs() None[source]#
static read_decoys(decoys: list[Path], pdb_engine: str, parallel: bool = True, max_workers: int | None = None) tuple[list[AtomArray], list[Path]][source]#
static create_decoy_stack(arr_list: list[AtomArray], native: AtomArray, R_chain: list[str], L_chain: list[str]) tuple[AtomArrayStack, AtomArray][source]#
set_common() None[source]#

pinder.eval.dockq.method module#

exception pinder.eval.dockq.method.InvalidChainsError(pdb_file: Path, chains: list[str])[source][source]#

Bases: Exception

exception pinder.eval.dockq.method.TooFewChainsError(pdb_file: Path, chains: list[str])[source][source]#

Bases: InvalidChainsError

exception pinder.eval.dockq.method.ExpectedChainsNotFoundError(pdb_file: Path, chains: list[str])[source][source]#

Bases: InvalidChainsError

pinder.eval.dockq.method.validate_system_id(system: Path, pinder_ids: set[str]) None[source][source]#
pinder.eval.dockq.method.get_valid_eval_systems(eval_dir: Path) list[dict[str, Path | str]][source][source]#
class pinder.eval.dockq.method.SubsetIds[source][source]#

Bases: TypedDict

count: int#
ids: set[str]#
pinder.eval.dockq.method.get_expected_counts(pindex: DataFrame, subsets: list[str]) dict[tuple[str, str], SubsetIds][source][source]#
pinder.eval.dockq.method.summarize_valid_systems(eval_dir: Path, confirm: bool = True, custom_index: str = '') None[source][source]#
pinder.eval.dockq.method.download_entry(entry: IndexEntry) None[source][source]#
pinder.eval.dockq.method.get_eval_metrics(eval_system: dict[str, Path | str], parallel_io: bool = False, custom_index: str = '') DataFrame[source][source]#
pinder.eval.dockq.method.safe_get_eval_metrics(system: dict[str, Path | str], parallel_io: bool = False, custom_index: str = '') DataFrame | None[source][source]#
pinder.eval.dockq.method.get_eval_metrics_all_methods(eval_dir: Path, parallel: bool = True, custom_index: str = '', max_workers: int | None = None) DataFrame[source][source]#
pinder.eval.dockq.method.get_method_eval_metrics(run_dirs: list[Path], dataset_name: DatasetName, monomer_name: MonomerName, method_name: str | None = None, parallel: bool = True, custom_index: str = '', max_workers: int | None = None) DataFrame[source][source]#
pinder.eval.dockq.method.add_pinder_set(metrics: DataFrame, allow_missing: bool = False, custom_index: str = '') DataFrame | None[source][source]#
pinder.eval.dockq.method.get_missing_system_penalty_metrics(id: str, monomer_name: str, method_name: str, pinder_set: str, penalty_rmsd: float = 100.0) DataFrame[source][source]#
class pinder.eval.dockq.method.CapriClass[source][source]#

Bases: object

class pinder.eval.dockq.method.MethodMetrics(eval_dir: Path, parallel: bool = True, allow_missing_systems: bool = False, custom_index: str = '', max_workers: int | None = None)[source][source]#

Bases: object

property metrics: DataFrame#

The metrics table for the evaluation. If not yet computed, it is computed and cached.

Type:

pd.Dataframe

static add_rank_column(metrics: DataFrame, rank_regex: str) DataFrame[source]#
get_metrics() DataFrame[source]#
oracle_median_summary() DataFrame[source]#
get_leaderboard_entry() DataFrame[source]#
median_oracle(df: DataFrame) DataFrame[source]#
get_hit_rates(sys_data: DataFrame, pose_set: str) DataFrame[source]#
top_k(k: int) DataFrame[source]#
top_k_oracle(df: DataFrame) DataFrame[source]#
top_percentile(q: float) DataFrame[source]#
system_oracle() DataFrame[source]#
system_median() DataFrame[source]#
method_median() DataFrame[source]#
method_oracle() DataFrame[source]#
system_capri_hit_rate() DataFrame[source]#
median_capri_hit_rate() DataFrame[source]#
histogram_plot(metric_df: DataFrame, metric: str | None = None) None[source]#

pinder.eval.dockq.metrics module#

pinder.eval.dockq.metrics.get_interface_mask(structure: AtomArray | AtomArrayStack, interface: dict[str, list[int]], chains: ChainConfig, subject: str) ndarray[Any, dtype[bool_]][source][source]#
pinder.eval.dockq.metrics.calc_irmsd(decoy_stack: AtomArrayStack, native: AtomArray, decoy_interface: dict[str, list[int]], native_interface: dict[str, list[int]], decoy2native_res: dict[str, dict[int, int]], chains: ChainConfig, backbone_only: bool = True, calpha_only: bool = False, backbone_definition: BackboneDefinition = 'default') ndarray[Any, dtype[float64]] | float[source][source]#

Get interface RMSD after superposition of interface backbone atoms.

pinder.eval.dockq.metrics.get_receptor_masks(native: AtomArray, decoy_stack: AtomArrayStack, chains: ChainConfig) tuple[ndarray[Any, dtype[bool_]], ndarray[Any, dtype[bool_]]][source][source]#
pinder.eval.dockq.metrics.calc_lrmsd(decoy_stack: AtomArrayStack | AtomArray, native: AtomArray, decoy2native_res: dict[str, dict[int, int]], chains: ChainConfig, backbone_only: bool = True, calpha_only: bool = False, backbone_definition: BackboneDefinition = 'dockq') ndarray[Any, dtype[float64]] | float[source][source]#

Get ligand body Calpha or backbone RMSD.

pinder.eval.dockq.metrics.calc_fnat(decoy_contacts: set[tuple[str, str, int, int]], native_contacts: set[tuple[str, str, int, int]], chains: ChainConfig) ndarray[Any, dtype[float64]][source][source]#

Get fraction of native contacts.

Parameters:
decoy_stackAtomArrayStack

Stack of AtomArray containing decoys (models)

native_contactsset[tuple[str, str, int, int]]

Residue contact pairs in native. See dockq.contacts.pairwise_contacts

chainsChainConfig

Chain config object defining receptor and ligand chain pairings.

Returns:
ndarray

Numpy array of fnat values for each decoy in the stack.

pinder.eval.dockq.metrics.get_dockq_score(i_rmsd: ndarray[Any, dtype[float64]] | float, l_rmsd: ndarray[Any, dtype[float64]] | float, fnat: ndarray[Any, dtype[float64]] | float) ndarray[Any, dtype[float64]] | float[source][source]#

Get DockQ scores.

Parameters:
i_rmsdndarray | float

interface rmsd

l_rmsdndarray | float

ligand rmsd

fnatndarray | float

fraction of native contact

Returns:
ndarray | float

DockQ score

pinder.eval.dockq.metrics.capri_class(fnat: float, iRMS: float, LRMS: float, capri_peptide: bool = False) str[source][source]#

pinder.eval.dockq.unbound module#

Assess difficulty of unbound monomer or dimer with respect to bound holo.

pinder.eval.dockq.unbound.get_db4_difficulty(irmsd: float, fnonnat: float) str[source][source]#
pinder.eval.dockq.unbound.fnat_unbound_summary(bound_contacts: set[tuple[str, str, int, int]], unbound_contacts: set[tuple[str, str, int, int]]) dict[str, float | int | str][source][source]#
pinder.eval.dockq.unbound.get_corresponding_residues(res_list: list[int], chain: str, mapping: dict[str, dict[int, int]]) tuple[list[int], list[int]][source][source]#

Get corresponding residues with default mapping.

pinder.eval.dockq.unbound.filter_interface_intersect(holo_interface: AtomArray, apo_interface: AtomArray, holo2apo_seq: dict[str, dict[int, int]], apo2holo_seq: dict[str, dict[int, int]], R_chain: str = 'R', L_chain: str = 'L') tuple[AtomArray, AtomArray][source][source]#
pinder.eval.dockq.unbound.get_unbound_interface_metrics(holo_complex: Structure, apo_RL: Structure, R_chain: str, L_chain: str, holo2apo_seq: dict[str, dict[int, int]], apo2holo_seq: dict[str, dict[int, int]]) dict[str, float | int | str][source][source]#
pinder.eval.dockq.unbound.get_unbound_difficulty(holo_R: Structure, holo_L: Structure, apo_R: Structure, apo_L: Structure) dict[str, float | int | str][source][source]#
pinder.eval.dockq.unbound.get_apo_monomer_difficulty(holo_R: Structure, holo_L: Structure, apo_mono: Structure, apo_body: str) dict[str, float | int | str][source][source]#

Module contents#