Skip to content
Snippets Groups Projects
Commit 77964609 authored by mariabernard's avatar mariabernard
Browse files

Snakemake 1000RNASeq ASE: add quality trimming threshold in Trimgalore rules

parent 81f12447
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,8 @@ data_dir : data ...@@ -39,6 +39,8 @@ data_dir : data
# Filter on variant type if not already done (True or False) # Filter on variant type if not already done (True or False)
SNP_filter : True SNP_filter : True
# quality trimming threshold used in trimgalore to remove low quality bases.
trimming_quality : 15
# minimum calling depth # minimum calling depth
depth : 10 depth : 10
# minimum percentage (between 0 and 1) of sample with known genotype # minimum percentage (between 0 and 1) of sample with known genotype
......
...@@ -45,12 +45,13 @@ rule trim_se: ...@@ -45,12 +45,13 @@ rule trim_se:
output: output:
out=temp("Results_ASE/TrimGalore/{prefix}_trim.fastq.gz") out=temp("Results_ASE/TrimGalore/{prefix}_trim.fastq.gz")
params: params:
min_trim=lambda wildcards : str(int([ int(table[table["forward_read"] == f]["read_length"].tolist()[0]) for f in table["forward_read"] if f.startswith(wildcards.prefix)][0] / 3 )) min_trim=lambda wildcards : str(int([ int(table[table["forward_read"] == f]["read_length"].tolist()[0]) for f in table["forward_read"] if f.startswith(wildcards.prefix)][0] / 3 )),
qual=config["trimming_quality"]
log: log:
"Results_ASE/TrimGalore/{prefix}_trimSe.log" "Results_ASE/TrimGalore/{prefix}_trimSe.log"
shell: shell:
""" """
trim_galore --no_report_file --length {params.min_trim} --quality 0 -o `dirname {output.out}` {input} 2> {log} trim_galore --no_report_file --length {params.min_trim} --quality {params.qual} -o `dirname {output.out}` {input} 2> {log}
mv `dirname {output.out}`/{wildcards.prefix}*trimmed.fq.gz {output.out} mv `dirname {output.out}`/{wildcards.prefix}*trimmed.fq.gz {output.out}
""" """
...@@ -64,10 +65,11 @@ rule trim_pe: ...@@ -64,10 +65,11 @@ rule trim_pe:
log: log:
"Results_ASE/TrimGalore/{prefix}_trimPe.log" "Results_ASE/TrimGalore/{prefix}_trimPe.log"
params: params:
min_trim=lambda wildcards : str(int([ int(table[table["forward_read"] == f]["read_length"].tolist()[0]) for f in table["forward_read"] if f.startswith(wildcards.prefix)][0] / 3 )) min_trim=lambda wildcards : str(int([ int(table[table["forward_read"] == f]["read_length"].tolist()[0]) for f in table["forward_read"] if f.startswith(wildcards.prefix)][0] / 3 )),
qual=config["trimming_quality"]
shell: shell:
""" """
trim_galore --paired --no_report_file --length {params.min_trim} --quality 0 -o `dirname {output.out1}` {input} 2> {log} trim_galore --paired --no_report_file --length {params.min_trim} --quality {params.qual} -o `dirname {output.out1}` {input} 2> {log}
mv `dirname {output.out1}`/{wildcards.prefix}*_val_1.fq.gz {output.out1} mv `dirname {output.out1}`/{wildcards.prefix}*_val_1.fq.gz {output.out1}
mv `dirname {output.out1}`/{wildcards.prefix}*_val_2.fq.gz {output.out2} mv `dirname {output.out1}`/{wildcards.prefix}*_val_2.fq.gz {output.out2}
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment