File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,10 @@ rule mask_tsv:
109109rule filter_tsv :
110110 threads : 1
111111 conda : "../envs/renv.yaml"
112+ params :
113+ min_depth = 20 ,
114+ min_alt_rv = 2 ,
115+ min_alt_dp = 2 ,
112116 input :
113117 tsv = OUTDIR / f"{ OUTPUT_NAME } .masked.tsv" ,
114118 annotation = OUTDIR / "annotation.csv"
Original file line number Diff line number Diff line change @@ -12,24 +12,22 @@ log_threshold(INFO)
1212# Read inputs
1313data <- read_tsv(snakemake @ input [[" tsv" ]])
1414
15- # Filtering criteria:
16- # - P-value < 0.05
17- # - Depth >= 20
18- # - For SNP more than 2 reads in each strand
15+ # Filtering
1916is.deletion <- str_detect(
2017 data $ ALT ,
2118 " ^[A-Z]" ,
2219 negate = TRUE
2320)
24- inBothStrands <- data $ ALT_RV > 2 & data $ ALT_DP > 2
25- Depth <- (data $ ALT_RV + data $ ALT_DP ) > = 20
21+ strand.mask <- data $ ALT_RV > snakemake @ params $ min_alt_rv &
22+ data $ ALT_DP > snakemake @ params $ min_alt_dp
23+ depth.mask <- (data $ ALT_RV + data $ ALT_DP ) > = snakemake @ params $ min_depth
2624
2725log_info(" Filtering variants" )
2826data <- filter(
2927 data ,
3028 as.logical(PASS ),
31- Depth ,
32- inBothStrands | is.deletion
29+ depth.mask ,
30+ strand.mask | is.deletion
3331)
3432
3533log_info(" Finding synonymous and non synonymous variants" )
You can’t perform that action at this time.
0 commit comments