netmap.masking.external.get_regulators

netmap.masking.external.get_regulators(crm_df, genes, window)[source]

Identify TF regulators of each gene by proximity to the TSS.

Searches a window of ±window bp around each gene’s TSS in the CRM (cis-regulatory motif) BED data and returns all TF→gene pairs found.

Parameters:
  • crm_df (pd.DataFrame) – Preprocessed BED data from preprocess_bed_file(), with columns chr, start, end, and TF_list_list.

  • genes (pd.DataFrame) – Gene annotation table with columns chr, start, and gene_name (e.g. from get_genome_annotation_from_gtf()).

  • window (int) – Search window in base pairs upstream and downstream of the TSS.

Returns:

Table with columns gene, TFs, nTFs,

edge (TF_gene string), regulator (always True).

Return type:

pd.DataFrame