muon.atac.tl.tss_enrichment

Contents

muon.atac.tl.tss_enrichment#

muon.atac.tl.tss_enrichment(data: AnnData | MuData, features: DataFrame | None = None, extend_upstream: int = 1000, extend_downstream: int = 1000, n_tss: int = 2000, return_tss: bool = True, random_state=None, barcodes: str | None = None)#

Calculate TSS enrichment according to ENCODE guidelines. Adds a column tss_score to the .obs DataFrame and optionally returns a tss score object.

Parameters:
  • data – AnnData object with peak counts or multimodal MuData object with ‘atac’ modality.

  • features – A DataFrame with feature annotation, e.g. genes. Annotation has to contain columns: Chromosome, Start, End.

  • extend_upsteam – Number of nucleotides to extend every gene upstream (2000 by default to extend gene coordinates to promoter regions)

  • extend_downstream – Number of nucleotides to extend every gene downstream (0 by default)

  • n_tss – How many randomly chosen TSS sites to pile up. The fewer the faster. Default: 2000.

  • return_tss – Whether to return the TSS pileup matrix. Needed for enrichment plots.

  • random_state (int, array-like, BitGenerator, np.random.RandomState, optional) – Argument passed to pandas.DataFrame.sample() for sampling features.

  • barcodes – Column name in the .obs of the AnnData with barcodes corresponding to the ones in the fragments file.

Returns:

AnnData object with a ‘tss_score’ column in the .obs slot.

Return type:

AnnData