GRNEvaluator

GRNEvaluator#

class regdiffusion.GRNEvaluator(ground_truth, gene_names, metrics=['AUROC', 'AUPR', 'AUPRR', 'EP', 'EPR'])[source]#

A generalized evaluator for GRN inference.

Parameters:
  • ground_truth (np.ndarray or list) – Either a 2D numpy array or list of list holding the ground truth. Each row is an edge and includes names for the source and target nodes. For example, [[‘A’, ‘B’], [‘B’, ‘C’]].

  • gene_names (np.ndarray or list) – Either a 1D numpy array or list of gene names. Make sure the order of the gene names is the same as the order of gene names in the adjacency matrix.

  • metrics (list) – A list of supported evaluation metrics. Currently support ‘AUROC’, ‘AUPR’, ‘AUPRR’, ‘EP’, ‘EPR’.

evaluate(A)[source]#

Evaluate a predicted adjacency matrix against the ground truth.

Parameters:

A (np.ndarray) – Predicted adjacency matrix of shape (n_gene, n_gene) or (n_tf, n_gene).

Returns:

Dictionary of evaluation metrics (e.g. AUROC, AUPR).

Return type:

dict