snapatac2.tl.init_network_from_annotation#

snapatac2.tl.init_network_from_annotation(regions, anno_file, upstream=250000, downstream=250000, id_type='gene_name', coding_gene_only=True)[source]#

Build CRE-gene network from gene annotations.

Link CREs to genes if they are close to genes’ promoter regions.

Parameters:
  • regions (list[str]) – A list of peaks/regions, e.g., ["chr1:100-1000", "chr2:55-222"].

  • anno_file (Path | Genome) – The GFF file containing the transcript level annotations.

  • upstream (int) – Upstream extension to the transcription start site.

  • downstream (int) – Downstream extension to the transcription start site.

  • id_type (Literal['gene_name', 'gene_id', 'transcript_id']) – “gene_name”, “gene_id” or “transcript_id”.

  • coding_gene_only (bool) – Retain only coding genes in the network.

Returns:

A network where peaks/regions point towards genes if they are within genes’ regulatory domains.

Return type:

rx.PyDiGraph