Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sam Nooij
Jovian screener
Commits
d9795808
Commit
d9795808
authored
Aug 07, 2020
by
Sam Nooij
Browse files
Add mapped read depuplication
parent
4e50c7a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Snakefile
View file @
d9795808
...
...
@@ -108,10 +108,18 @@ rule all:
sample = SAMPLES, ref = REFERENCE_NAMES),
#Paired reads mapped to reference
expand("data/tmp/Deduplicated-metrics_{sample}_to_{ref}-paired.txt",
sample = SAMPLES, ref = REFERENCE_NAMES),
#Paired deduplicated mapped reads
expand("data/tmp/Mapped-only_{sample}_to_{ref}-unpaired.bam",
sample = SAMPLES, ref = REFERENCE_NAMES),
#Unpaired reads mapped to reference
expand("data/tmp/Deduplicated-metrics_{sample}_to_{ref}-unpaired.txt",
sample = SAMPLES, ref = REFERENCE_NAMES),
#Unpaired deduplicated mapped reads
expand("data/tmp/counts/Mapped_read_counts-{sample}_to_{ref}-paired.tsv",
sample = SAMPLES, ref = REFERENCE_NAMES),
#Counts of mapped paired reads
...
...
@@ -442,6 +450,25 @@ rule filter_unaligned_paired_reads:
samtools view -b -F 4 -F 256 -F 2048 {input} > {output} 2> {log}
"""
rule deduplicate_paired_reads:
input:
"data/tmp/Mapped-only_{sample}_to_{ref}-paired.bam"
output:
bam="data/tmp/Deduplicated-mapped_{sample}_to_{ref}-paired.bam",
metrics="data/tmp/Deduplicated-metrics_{sample}_to_{ref}-paired.txt",
conda:
"envs/picard.yaml"
threads: 1
log:
"log/deduplicate_paired_reads-{sample}_to_{ref}.txt"
benchmark:
"log/benchmark/deduplicate_paired_reads-{sample}_to_{ref}.txt"
shell:
"""
picard MarkDuplicates --REMOVE_DUPLICATES -I {input} -O {output.bam} -M {output.metrics}
"""
rule map_unpaired_trimmed_reads:
input:
unpaired="data/raw/trimmed_reads/{sample}_unpaired.fq",
...
...
@@ -486,6 +513,24 @@ rule filter_unaligned_unpaired_reads:
samtools view -b -F 4 -F 256 -F 2048 {input} > {output} 2> {log}
"""
rule deduplicate_unpaired_reads:
input:
"data/tmp/Mapped-only_{sample}_to_{ref}-unpaired.bam"
output:
bam="data/tmp/Deduplicated-mapped_{sample}_to_{ref}-unpaired.bam",
metrics="data/tmp/Deduplicated-metrics_{sample}_to_{ref}-unpaired.txt",
conda:
"envs/picard.yaml"
threads: 1
log:
"log/deduplicate_unpaired_reads-{sample}_to_{ref}.txt"
benchmark:
"log/benchmark/deduplicate_unpaired_reads-{sample}_to_{ref}.txt"
shell:
"""
picard MarkDuplicates --REMOVE_DUPLICATES -I {input} -O {output.bam} -M {output.metrics}
"""
rule count_mapped_paired_reads:
input:
"data/tmp/Mapped-only_{sample}_to_{ref}-paired.bam",
...
...
envs/picard.yaml
0 → 100644
View file @
d9795808
name
:
picard
channels
:
-
default
-
bioconda
-
conda-forge
dependencies
:
-
picard=2.23.3
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment