snapatac2.tl.merge_peaks#

snapatac2.tl.merge_peaks(peaks, chrom_sizes, half_width=250)[source]#

Merge peaks from different groups.

Merge peaks from different groups. It is typically used to merge results from macs3.

This function initially expands the summits of identified peaks by half_width on both sides. Following this expansion, it addresses the issue of overlapping peaks through an iterative process. The procedure begins by prioritizing the most significant peak, determined by the smallest p-value. This peak is retained, and any peak that overlaps with it is excluded. Subsequently, the same method is applied to the next most significant peak. This iteration continues until all peaks have been evaluated, resulting in a final list of non-overlapping peaks, each with a fixed width determined by the initial extension.

Parameters:
  • peaks (dict[str, ‘polars.DataFrame’]) – Peak information from different groups.

  • chrom_sizes (dict[str, int] | Genome) – Chromosome sizes. If a Genome is provided, chromosome sizes will be obtained from the genome.

  • half_width (int) – Half width of the merged peaks.

Returns:

A dataframe with merged peaks.

Return type:

‘polars.DataFrame’

See also

macs3