cellink.tl.external.genescores_to_abc_road_bedgraph#
- cellink.tl.external.genescores_to_abc_road_bedgraph(genescores, roadmap_links, abc_links, *, roadmap_gene_col=None, roadmap_activity_col=None, abc_gene_col=None, abc_activity_col=None, chr_col='chr', start_col='start', end_col='end', use_bedtools_for_merge=True)#
Convert gene scores to ABC_Road bedgraphs (Roadmap ∪ ABC strategy).
This is the primary sc-linker S2G strategy. For each program (column in genescores), creates a bedgraph where each interval’s score is the weighted sum of gene scores linked to that interval:
score(interval) = gene_score C link_activity
The Roadmap and ABC bedgraphs are merged (union) with scores summed where they overlap.
- Parameters:
genescores (
DataFrame) – DataFrame (genes C programs) with probabilistic scores in [0, 1]. Index must be HGNC gene symbols.roadmap_links (
DataFrame) – Roadmap enhancer-gene links DataFrame (fromload_roadmap_links).abc_links (
DataFrame) – ABC model enhancer-gene links DataFrame (fromload_abc_links).roadmap_gene_col (
str|None(default:None)) – Column inroadmap_linkswith target gene names.roadmap_activity_col (
str|None(default:None)) – Activity/weight column inroadmap_links. If None, uses weight=1.abc_gene_col (
str|None(default:None)) – Column inabc_linkswith target gene names.abc_activity_col (
str|None(default:None)) – Activity/weight column inabc_links. If None, uses weight=1.chr_col (
str(default:'chr')) – Genomic coordinate columns in link DataFrames.start_col (
str(default:'start')) – Genomic coordinate columns in link DataFrames.end_col (
str(default:'end')) – Genomic coordinate columns in link DataFrames.use_bedtools_for_merge (
bool(default:True)) – If True and bedtools is available, usesbedtools mergeto merge overlapping intervals (matches original pipeline exactly). If False, uses a pure-Python merge (faster but may differ slightly).
- Return type:
- Returns:
dict Program name → bedgraph DataFrame (chr, start, end, score).