cellink.tl.external.genescores_to_annotations#
- cellink.tl.external.genescores_to_annotations(genescores, roadmap_links, abc_links, gene_annotation, bim_prefix, out_dir, *, tissue='BLD', chromosomes=None, window_kb=100, save_bedgraphs=True, use_bedtools=True, **link_kwargs)#
Full Step 2: gene scores → bedgraphs → per-chromosome SNP annotations.
Produces TWO annotation strategies per program, matching the sc-linker paper: -
ABC_Road_{tissue}: Roadmap ∪ ABC enhancer-gene links (weighted) -100kb: gene body ± window_kb (unweighted)- Parameters:
genescores (
DataFrame) – DataFrame (genes X programs) with probabilistic scores in [0, 1].roadmap_links (
DataFrame) – Roadmap enhancer-gene links (fromload_roadmap_links).abc_links (
DataFrame) – ABC enhancer-gene links (fromload_abc_links).gene_annotation (
DataFrame) – Gene coordinate file (fromload_gene_annotation).bim_prefix (
str) – Prefix for per-chromosome BIM files. Example:"refs/1000G.EUR.QC."→ files...1.bim,...2.bim, …out_dir (
str|Path) – Root output directory. Creates sub-dirs per program and strategy.tissue (
str(default:'BLD')) – Tissue code (used only for naming the strategy folder).chromosomes (
list[int] |None(default:None)) – Chromosomes to process.window_kb (
int(default:100)) – Window for 100kb strategy.save_bedgraphs (
bool(default:True)) – Whether to save bedgraph files alongside annotation files.use_bedtools (
bool(default:True)) – Use bedtools binary for interval merging and annotation.
- Return type:
- Returns:
dict
{program_name: {"ABC_Road": annot_prefix, "100kb": annot_prefix}}where annot_prefix is a string like"out_dir/program/ABC_Road_BLD/program."(without the chromosome number, to be passed to LDSC).