sciduck.entropy_qc module — sciduck documentation

# sciduck.entropy_qc module

sciduck.entropy_qc.cell_entropy_qc_metric(adata: AnnData, annotation_columns: list, nearest_neighbors: int = 15, dim: str = 'X_scVI') → AnnData

  Compute entropy (mixing) of annotations within a cells local neighborhood.

  Parameters:

    - adata – AnnData object with annotations

    - annotations – Cell level annotations.

    - nearest_neighbors – Number of nearest neighbors.

    - dim – Dimensionality reduction

  Returns:

    Returns the updated AnnData object.

sciduck.entropy_qc.cluster_entropy_qc_metric(adata: AnnData, cluster_column: str, annotation_column: str) → list

  Compute entropy (mixing) of an annotation within a pre-defined cluster.

  Parameters:

    - adata – Anndata object.

    - cluster_column – Column name in obs containing cluster labels.

    - annotation_columns – Column name in obs containing annotations.

  Returns:

    A list of cluster entropy quality control metrics.

sciduck.entropy_qc.filter_on_cluster_entropy(adata: AnnData, cluster_column: str, annotation_columns: list, annotation_thresholds: dict) → AnnData | None

  Filter samples based on cluster entropy.

  Parameters:

    - adata – Anndata object.

    - cluster_column – Column name in adata.obs containing cluster labels.

    - entropy_columns – Column name in adata.obs to compute entropy on.

    - entropy_thresholds – Minimum entropy values for each annotation being considered.

  Returns:

    Returns either AnnData | None