muon.atac.tl.count_fragments_features

muon.atac.tl.count_fragments_features#

muon.atac.tl.count_fragments_features(data: AnnData | MuData, features: DataFrame | None = None, stranded: bool = False, extend_upstream: int = 2000.0, extend_downstream: int = 0, count_reads: bool = True) AnnData#

Count fragments overlapping given Features. Returns cells x features matrix.

data

AnnData object with peak counts or multimodal MuData object with ‘atac’ modality.

features

A DataFrame with feature annotation, e.g. genes. Annotation should contain columns (case-insensitive): chr/chrom/chromosome (longer takes precedence), start, end.

stranded

Use strand information for each feature. Has to be encoded as a “strand” (case-insensitive) column in features. When stranded=True, extend_upsteam and extend_downstream will be used according to each feature’s strand information.

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)

count_reads: bool (True by default)

NOTE: default will be changed to False from v0.2. If to count reads instead of fragments. If True, the number of reads (read support) per fragment will be used. This will also include duplicate read pairs. If False, 1 will be added for each fragment.