-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #844 from maxplanck-ie/bwa_mem2_and_misc
Bwa mem2 and misc
- Loading branch information
Showing
35 changed files
with
225 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '2.5.4' | ||
__version__ = '2.6.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
if pairedEnd: | ||
rule bwamem2: | ||
input: | ||
r1 = fastq_dir+"/{sample}"+reads[0]+".fastq.gz", | ||
r2 = fastq_dir+"/{sample}"+reads[1]+".fastq.gz" | ||
output: | ||
align_summary = "bwa-mem2/{sample}.bwa-mem2_summary.txt", #samtools flagstat | ||
bam = temp("bwa-mem2/{sample}.sorted.bam") | ||
log: "bwa-mem2/logs/{sample}.sort.log" | ||
params: | ||
bwa_index = bwa_mem2_index, | ||
alignerOpts = str(alignerOpts or ''), | ||
tempDir = tempDir | ||
threads: lambda wildcards: 8 if 8<max_thread else max_thread | ||
conda: CONDA_DNA_MAPPING_ENV | ||
shell:""" | ||
TMPDIR={params.tempDir} | ||
MYTEMP=$(mktemp -d ${{TMPDIR:-/tmp}}/snakepipes.XXXXXXXXXX); | ||
bwa-mem2 mem \ | ||
-t 6 \ | ||
-R '@RG\\tID:{wildcards.sample}\\tDS:{wildcards.sample}\\tPL:ILLUMINA\\tSM:{wildcards.sample}' {params.alignerOpts} \ | ||
{params.bwa_index} {input.r1} {input.r2} | \ | ||
samtools view -Sb - | \ | ||
samtools sort -m 2G -@ 2 -O bam - > {output.bam} 2> {log}; | ||
rm -rf $MYTEMP | ||
samtools flagstat {output.bam} > {output.align_summary} | ||
""" | ||
else: | ||
rule bwamem2: | ||
input: | ||
fastq_dir+"/{sample}"+reads[0]+".fastq.gz" | ||
output: | ||
align_summary = "bwa-mem2/{sample}.bwa-mem2_summary.txt", #samtools flagstat | ||
bam = temp("bwa-mem2/{sample}.sorted.bam") | ||
log: "bwa-mem2/logs/{sample}.sort.log" | ||
params: | ||
bwa_index = bwa_mem2_index, | ||
alignerOpts = str(alignerOpts or ''), | ||
tempDir = tempDir | ||
threads : lambda wildcards: 12 if 12<max_thread else max_thread | ||
conda: CONDA_DNA_MAPPING_ENV | ||
shell: """ | ||
TMPDIR={params.tempDir} | ||
MYTEMP=$(mktemp -d ${{TMPDIR:-/tmp}}/snakepipes.XXXXXXXXXX); | ||
bwa-mem2 mem \ | ||
-t {threads} \ | ||
-R '@RG\\tID:{wildcards.sample}\\tDS:{wildcards.sample}\\tPL:ILLUMINA\\tSM:{wildcards.sample}' {params.alignerOpts}\ | ||
{params.bwa_index} {input} | \ | ||
samtools view -Sbu - | \ | ||
samtools sort -m 2G -T $MYTEMP/{wildcards.sample} -@ 2 -O bam - > {output.bam} 2> {log}; | ||
rm -rf $MYTEMP | ||
samtools flagstat {output.bam} > {output.align_summary} | ||
""" |
Oops, something went wrong.