Skip to content

Commit

Permalink
Fixes on modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandra Escobar committed Apr 16, 2024
1 parent b784c15 commit 48f9c92
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 24 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,16 @@ Optional arguments include:
```

Use `--core_mode true` for large catalogues like the mouse-gut to avoid over-prediction due to an extremely large number of accessory genes in the pangenome.
Nextflow option `-profile` can be use to select a suitable config for your computational resources.
Nextflow option `-profile` can be use to select a suitable config for your computational resources. You can add profile files to the `config` directory.
Nextflow option `-resume` can be use to re-run the pipeline from the last successfully finished step.


## Test

To test the pipeline you can run...



## Credits

ebi-metagenomics/shallowmapping pipeline was originally written by @Ales-ibt.
Expand Down
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include { validateParameters; paramsHelp } from 'plugin/nf-validation'
if (params.help) {
def logo = NfcoreTemplate.logo(workflow, params.monochrome_logs)
def citation = '\n' + WorkflowMain.citation(workflow) + '\n'
def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --genome GRCh37 -profile docker"
def String command = "nextflow run ${workflow.manifest.name} --input samplesheet.csv --biome <BIOME> -profile docker"
log.info logo + paramsHelp(command) + citation + NfcoreTemplate.dashedLine(params.monochrome_logs)
System.exit(0)
}
Expand Down
10 changes: 4 additions & 6 deletions modules/local/align/bwamem2.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ process ALIGN_BWAMEM2 {
tag "$meta.id"
label 'process_high'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' :
'biocontainers/mulled-v2-e5d375990341c5aef3c9aff74f96f66f65375ef6:2d15960ccea84e249a150b7f5d4db3a42fc2d6c3-0' }"
Expand All @@ -13,25 +12,23 @@ process ALIGN_BWAMEM2 {

output:
tuple val(meta), path("*_sorted.bam"), path("*_sorted.bam.bai"), emit: bam
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = '-M'
def args2 = '-F256 -F4 -uS'
def prefix = task.ext.prefix ?: "${meta.id}"
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'`
bwa-mem2 \\
mem \\
$args \\
-M \\
-t $task.cpus \\
\$INDEX \\
$reads \\
| samtools view -@ ${task.cpus} $args2 - \\
| samtools view -@ ${task.cpus} -F256 -F4 -uS - \\
| samtools sort -@ ${task.cpus} -O bam - -o ${prefix}_sorted.bam
samtools index -@ ${task.cpus} ${prefix}_sorted.bam
Expand All @@ -46,6 +43,7 @@ process ALIGN_BWAMEM2 {
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //')
Expand Down
26 changes: 10 additions & 16 deletions modules/local/dram/distill.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process DRAM_DISTILL {
val(in_type) //species or community

output:
tuple val(meta), path("*_dram.*"), emit: destill_out
tuple val(meta), path("*_dram*"), emit: destill_out
path "versions.yml" , emit: versions

when:
Expand All @@ -27,23 +27,17 @@ process DRAM_DISTILL {

"""
if [[ "${in_type}" == "community" ]]; then
echo ",fasta,scaffold,gene_position,start_position,end_position,strandedness,rank,kegg_id,kegg_hit,pfam_hits,cazy_hits,bin_taxonomy" | sed 's/,/\t/g' > community_input.txt
cat $dram_summary >> community_input.txt
DRAM.py \\
distill \\
-i community_input.txt \\
-o dram_out
mv dram_out/product.html ${prefix}_${tool}_${in_type}_dram.html
mv dram_out/product.tsv ${prefix}_${tool}_${in_type}_dram.tsv
else
DRAM.py \\
distill \\
-i $dram_summary \\
-o dram_out
mv dram_out/product.html ${prefix}_${tool}_${in_type}_dram.html
mv dram_out/product.tsv ${prefix}_${tool}_${in_type}_dram.tsv
echo ",fasta,scaffold,gene_position,start_position,end_position,strandedness,rank,kegg_id,kegg_hit,pfam_hits,cazy_hits,bin_taxonomy" | sed 's/,/\t/g' > dram_input.txt
fi
cat $dram_summary >> dram_input.txt
DRAM.py \\
distill \\
-i dram_input.txt \\
-o dram_out
mv dram_out/product.html ${prefix}_${tool}_${in_type}_dram.html
mv dram_out/product.tsv ${prefix}_${tool}_${in_type}_dram.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
dram: $VERSION
Expand Down

0 comments on commit 48f9c92

Please sign in to comment.