File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,19 @@ rule format_vcf_fields_longer:
181181 "../scripts/format_vcf_fields_longer.R"
182182
183183
184+ rule compile_vcf_fields_longer :
185+ threads : 1
186+ conda : "../envs/renv.yaml"
187+ input :
188+ tsv = OUTDIR / "vaf" / "{sample}.vcf_fields.longer.tsv"
189+ output :
190+ tsv = OUTDIR / f"{ OUTPUT_NAME } .vcf_fields.longer.tsv"
191+ log :
192+ LOGDIR / "compile_vcf_fields_longer" / "log.txt"
193+ script :
194+ "../scripts/compile_vcf_fields_longer.R"
195+
196+
184197rule vcf_to_tsv :
185198 threads : 1
186199 conda : "../envs/renv.yaml"
Original file line number Diff line number Diff line change 1+ # !/usr/bin/env Rscript
2+
3+ # Write stdout and stderr to log file
4+ log <- file(snakemake @ log [[1 ]], open = " wt" )
5+ sink(log , type = " message" )
6+ sink(log , type = " output" )
7+
8+ library(tidyverse )
9+ library(logger )
10+ log_threshold(INFO )
11+
12+ log_info(" Reading input partial tables with VCF extracted fields and adding sample column" )
13+ tables <- lapply(
14+ snakemake @ input ,
15+ function (path ) {
16+ read_tsv(path ) %> %
17+ mutate(SAMPLE = sub(' \\ .vcf_fields.longer.tsv$' , ' ' , basename(path )))
18+ }
19+ )
20+
21+ log_info(" Binding and writing table" )
22+ bind_rows(tables ) %> %
23+ write_tsv(snakemake @ output $ tsv )
You can’t perform that action at this time.
0 commit comments