-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add nf-test skeleton code - Change Metator input to BAM files - Update conda-checking code in bin3c modules - Add paramters to choose minimum contig size and minimum map % identity when binning
- Loading branch information
Jim Downie
committed
Dec 20, 2024
1 parent
9693dd7
commit f6db65a
Showing
22 changed files
with
281 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ testing* | |
*.pyc | ||
null/ | ||
co2footprint* | ||
|
||
.nf-test/ | ||
.nf-test.log |
This file was deleted.
Oops, something went wrong.
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
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,7 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- bioconda::htslib=1.21 | ||
- bioconda::samtools=1.21 | ||
- bioconda::bioawk=1.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
process METATOR_PROCESS_INPUT_BAM { | ||
tag "${meta.id}" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'oras://community.wave.seqera.io/library/htslib_samtools_bioawk:3ff2c81f84424e4c' : | ||
'community.wave.seqera.io/library/htslib_samtools_bioawk:420f5543dfc64992' }" | ||
|
||
input: | ||
tuple val(meta), path(bam), val(direction) | ||
|
||
output: | ||
tuple val(meta), path("*.bam"), emit: filtered_bam | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
switch(direction) { | ||
case "fwd": flag = "0x40"; break | ||
case "rev": flag = "0x80" ; break | ||
default: | ||
error("ERROR: METATOR_PROCESS_INPUT_BAM direction was not 'fwd' or 'rev'!") | ||
break | ||
} | ||
""" | ||
samtools view --threads ${task.cpus-1} -f ${flag} -o temp.bam ${bam} | ||
samtools view -H --threads ${task.cpus-1} temp.bam > temp_header | ||
samtools view --threads ${task.cpus-1} temp.bam |\\ | ||
bioawk -c sam '{ \$flag = and(\$flag , 3860 ) ; print \$0 }' |\\ | ||
cat temp_header - |\\ | ||
samtools sort --threads ${task.cpus-1} -n -o ${prefix}.${direction}.bam | ||
rm temp.bam temp_header | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') | ||
bioawk: 1.0 | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
switch(direction) { | ||
case "fwd": flag = "0x40"; break | ||
case "rev": flag = "0x80" ; break | ||
default: | ||
error("ERROR: METATOR_PROCESS_INPUT_BAM direction was not 'fwd' or 'rev'!") | ||
break | ||
} | ||
""" | ||
touch ${prefix}.${direction}.bam | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') | ||
bioawk: 1.0 | ||
END_VERSIONS | ||
""" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,10 @@ | ||
config { | ||
testsDir "." | ||
workDir ".nf-test" | ||
configFile "tests/nextflow.config" | ||
profile "test" | ||
|
||
plugins { | ||
load "[email protected]" | ||
} | ||
} |
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
Oops, something went wrong.