Skip to content

Commit

Permalink
Add rule trim adapters from reads
Browse files Browse the repository at this point in the history
  • Loading branch information
kbseah committed Aug 6, 2023
1 parent 58b05c0 commit 08213a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,25 @@ rule map_pe:

rule merge_reads:
input:
fwd=lambda wildcards: config['reads'][wildcards.sample]['fwd'],
rev=lambda wildcards: config['reads'][wildcards.sample]['rev']
fwd='reads/{sample}.trim.fwd.fastq.gz',
rev='reads/{sample}.trim.rev.fastq.gz'
output:
# merged="reads/{sample}.merged.fastq.gz",
# unmerged="reads/{sample}.unmerged.fastq.gz",
ihist="reads/{sample}.ihist.txt"
log: "merge_reads.{sample}.log"
log: "logs/merge_reads.{sample}.log"
conda: "envs/mappers.yml"
threads: 16
shell:
# "bbmerge.sh threads={threads} in={input.fwd} in2={input.rev} out={output.merged} outu={output.unmerged} ihist={output.ihist} &> {log}"
"bbmerge.sh threads={threads} in={input.fwd} in2={input.rev} ihist={output.ihist} &> {log}"

rule trim_reads:
input:
fwd=lambda wildcards: config['reads'][wildcards.sample]['fwd'],
rev=lambda wildcards: config['reads'][wildcards.sample]['rev']
output:
fwd='reads/{sample}.trim.fwd.fastq.gz',
rev='reads/{sample}.trim.rev.fastq.gz'
log: "logs/trim_reads.{sample}.log"
conda: "envs/mappers.yml"
threads: 16
shell:
"bbduk.sh threads={threads} in={input.fwd} in2={input.rev} ktrim=r out={output.fwd} out2={output.rev} ref=adapters,workflow/adapters.fasta &> {log}"
4 changes: 4 additions & 0 deletions adapters.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>NEBNext_fwd
AGATCGGAAGAGCACACGTCTGAACTCCAGTCA
>NEBNext_rev
AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT

0 comments on commit 08213a1

Please sign in to comment.