diff --git a/workflow/Snakefile b/workflow/Snakefile index 9dbbdba..2ba551d 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -26,4 +26,4 @@ rule all: ws_path("break/collected_loci_excluding_mhc.csv"), ws_path("cojo/collected_credible_sets.csv"), expand(ws_path("coloc/{seqid}_master_file.sentinel"), seqid=analytes.seqid), - expand(ws_path("coloc/chr{chr_cs}.sentinel"), chr_cs = range(19, 20)) + expand(ws_path("coloc/chr{chr_cs}_colocalization.table.all.tsv"), chr_cs = range(19,20)), diff --git a/workflow/rules/coloc.smk b/workflow/rules/coloc.smk index 0fde297..6b0ceaa 100644 --- a/workflow/rules/coloc.smk +++ b/workflow/rules/coloc.smk @@ -40,3 +40,24 @@ rule merry_go_round: touch {output.sentinel} """ + + +rule run_coloc: + input: + sentinel = ws_path("coloc/chr{chr_cs}.sentinel"), + output: + ofile = ws_path("coloc/chr{chr_cs}_colocalization.table.all.tsv"), + conda: + "../envs/fine_mapping.yml" + params: + codes = config.get("path_code"), + pairs = ws_path("coloc/chr{chr_cs}_coloc_pairwise_guide_table.tsv"), + chr = "{chr_cs}", + shell: + """ + Rscript workflow/scripts/s06_coloc.R \ + --pipeline_path {params.codes} \ + --coloc_guide_table {params.pairs} \ + --chr_cs {params.chr} \ + --ofile {output.ofile} + """