-
Notifications
You must be signed in to change notification settings - Fork 5
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 #12 from hoelzer/diamond-switch
finalize blast-diamond switch
- Loading branch information
Showing
12 changed files
with
49 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
process { | ||
withLabel: prokka { conda = "$baseDir/envs/prokka.yaml" } | ||
withLabel: blast { conda = "$baseDir/envs/blast.yaml" } | ||
withLabel: pocp { conda = "$baseDir/envs/blast.yaml" } | ||
withLabel: diamond { conda = "$baseDir/envs/diamond.yaml" } | ||
withLabel: pocp { conda = "$baseDir/envs/diamond.yaml" } | ||
withLabel: ruby { conda = "$baseDir/envs/ruby.yaml" } | ||
} |
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,6 +1,6 @@ | ||
process { | ||
withLabel: prokka { container = 'nanozoo/prokka:1.14.6--773a90d' } | ||
withLabel: blast { container = 'nanozoo/blast:2.9.0--ded80ad' } | ||
withLabel: pocp { container = 'nanozoo/blast:2.9.0--ded80ad' } | ||
withLabel: diamond { container = 'nanozoo/diamond:2.1.8--b6f1f11' } | ||
withLabel: pocp { container = 'nanozoo/diamond:2.1.8--b6f1f11' } | ||
withLabel: ruby { container = 'nanozoo/ruby:3.2.2--fdadcb3' } | ||
} |
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,6 +1,6 @@ | ||
process { | ||
withLabel: prokka { cpus = params.cores; memory = params.memory } | ||
withLabel: blast { cpus = params.cores; memory = params.memory } | ||
withLabel: pocp { cpus = 1; memory = '1 GB' } | ||
withLabel: ruby { cpus = 1; memory = '1 GB' } | ||
withLabel: prokka { cpus = params.cores; memory = params.memory } | ||
withLabel: diamond { cpus = params.cores; memory = params.memory } | ||
withLabel: pocp { cpus = 1; memory = '1 GB' } | ||
withLabel: ruby { cpus = 1; memory = '1 GB' } | ||
} |
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,6 +1,6 @@ | ||
process { | ||
withLabel: prokka { cpus = 8 ; memory = '2 GB' } | ||
withLabel: blast { cpus = 8 ; memory = '2 GB' } | ||
withLabel: pocp { cpus = 1 ; memory = '1 GB' } | ||
withLabel: ruby { cpus = 1 ; memory = '1 GB' } | ||
withLabel: prokka { cpus = 8 ; memory = '2 GB' } | ||
withLabel: diamond { cpus = 8 ; memory = '2 GB' } | ||
withLabel: pocp { cpus = 1 ; memory = '1 GB' } | ||
withLabel: ruby { cpus = 1 ; memory = '1 GB' } | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
name: diamond | ||
channels: | ||
- bioconda | ||
dependencies: | ||
- diamond=2.1.8 | ||
- python=3.11.4 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,31 +1,31 @@ | ||
/* | ||
Run blastp and format output for downstream POCP calculations. | ||
Run diamond and format output for downstream POCP calculations. | ||
https://www.nature.com/articles/s41592-021-01101-x | ||
*/ | ||
process blast { | ||
label 'blast' | ||
publishDir "${params.output}/blast", mode: 'copy', pattern: "${name}-query-${name2}-db.blast*" | ||
process diamond { | ||
label 'diamond' | ||
publishDir "${params.output}/diamond", mode: 'copy', pattern: "${name}-query-${name2}-db.diamond*" | ||
|
||
input: | ||
tuple val(name), path(fasta), val(name2), path(fasta2) | ||
|
||
output: | ||
tuple env(genome_ids_sorted), path(fasta), file("${name}-query-${name2}-db.blast"), emit: blast | ||
tuple env(genome_ids_sorted), path(fasta), file("${name}-query-${name2}-db.blast.hits"), emit: hits | ||
tuple env(genome_ids_sorted), path(fasta), file("${name}-query-${name2}-db.diamond"), emit: diamond | ||
tuple env(genome_ids_sorted), path(fasta), file("${name}-query-${name2}-db.diamond.hits"), emit: hits | ||
|
||
script: | ||
""" | ||
diamond makedb --in ${fasta2} -d ${fasta2}.dmnd | ||
diamond blastp --ultra-sensitive -p ${task.cpus} -q ${fasta} -d ${fasta2}.dmnd -e ${params.evalue} --outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend qlen sstart send evalue bitscore slen | awk '{if(\$3>${params.seqidentity*100} && \$4>(\$9*${params.alnlength})){print \$0}}' > ${name}-query-${name2}-db.blast | ||
awk '{print \$1}' ${name}-query-${name2}-db.blast | sort | uniq | wc -l | awk '{print \$1}' > ${name}-query-${name2}-db.blast.hits | ||
echo "\t${name}:\tFound \$(cat ${name}-query-${name2}-db.blast.hits) matches with an E value of less than ${params.evalue}, a sequence identity of more than ${params.seqidentity*100}%, and an alignable region of the query protein sequence of more than ${params.alnlength*100}%." | ||
diamond blastp --ultra-sensitive -p ${task.cpus} -q ${fasta} -d ${fasta2}.dmnd -e ${params.evalue} --outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend qlen sstart send evalue bitscore slen | awk '{if(\$3>${params.seqidentity*100} && \$4>(\$9*${params.alnlength})){print \$0}}' > ${name}-query-${name2}-db.diamond | ||
awk '{print \$1}' ${name}-query-${name2}-db.diamond | sort | uniq | wc -l | awk '{print \$1}' > ${name}-query-${name2}-db.diamond.hits | ||
echo "\t${name}:\tFound \$(cat ${name}-query-${name2}-db.diamond.hits) matches with an E value of less than ${params.evalue}, a sequence identity of more than ${params.seqidentity*100}%, and an alignable region of the query protein sequence of more than ${params.alnlength*100}%." | ||
genome_ids_sorted='${name} ${name2}' | ||
genome_ids_sorted=\$(echo \$genome_ids_sorted | xargs -n1 | sort | xargs | sed 's/ /-vs-/g') | ||
#ruby pocp.rb ${fasta} ${fasta2} ${params.evalue} ${params.seqidentity} ${params.alnlength} ./ ${task.cpus} | ||
""" | ||
} | ||
|
||
/* Comments: | ||
When blast was used: | ||
I removed the -parse_seqids parameter from the makeblastdb command because of an error with fasta IDs that are longer than 50 chars. strange. | ||
*/ |
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