-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mitohifi/mitohifi module (#3573)
* Add mitohifi module * Lint and add a note in pytest_modules * Fix prettier checks * Fix spelling * Fix data references * Make a note not to use conda * Change md5 values * Remove extra file * Fix code according to code review * ECLint check fix * Extend description of the output * Fix md5 hash for output * Fix prettier * Fix conda checks * Undo changes before merge * Skip conda test on gihub * Update md5sums --------- Co-authored-by: Ksenia Krasheninnikova <kk16@sanger.ac.uk> Co-authored-by: Priyanka Surana <ps22@sanger.ac.uk>
- Loading branch information
1 parent
c825b14
commit 1c389fd
Showing
8 changed files
with
222 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
process MITOHIFI_MITOHIFI { | ||
tag "$meta.id" | ||
label 'process_high' | ||
|
||
|
||
// Docker image available at the project github repository | ||
container 'ghcr.io/marcelauliano/mitohifi:master' | ||
|
||
input: | ||
tuple val(meta), path(reads), path(contigs) | ||
path ref_fa | ||
path ref_gb | ||
val mito_code | ||
|
||
output: | ||
tuple val(meta), path("*fasta") , emit: fasta | ||
tuple val(meta), path("*contigs_stats.tsv") , emit: stats | ||
tuple val(meta), path("*gb") , emit: gb, optional: true | ||
tuple val(meta), path("*gff") , emit: gff, optional: true | ||
tuple val(meta), path("*all_potential_contigs.fa") , emit: all_potential_contigs, optional: true | ||
tuple val(meta), path("*contigs_annotations.png") , emit: contigs_annotations, optional: true | ||
tuple val(meta), path("*contigs_circularization") , emit: contigs_circularization, optional: true | ||
tuple val(meta), path("*contigs_filtering") , emit: contigs_filtering, optional: true | ||
tuple val(meta), path("*coverage_mapping") , emit: coverage_mapping, optional: true | ||
tuple val(meta), path("*coverage_plot.png") , emit: coverage_plot, optional: true | ||
tuple val(meta), path("*final_mitogenome.annotation.png"), emit: final_mitogenome_annotation, optional: true | ||
tuple val(meta), path("*final_mitogenome_choice") , emit: final_mitogenome_choice, optional: true | ||
tuple val(meta), path("*final_mitogenome.coverage.png") , emit: final_mitogenome_coverage, optional: true | ||
tuple val(meta), path("*potential_contigs") , emit: potential_contigs, optional: true | ||
tuple val(meta), path("*reads_mapping_and_assembly") , emit: reads_mapping_and_assembly, optional: true | ||
tuple val(meta), path("*shared_genes.tsv") , emit: shared_genes, optional: true | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
// Exit if running this module with -profile conda / -profile mamba | ||
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { | ||
exit 1, "MitoHiFi module does not support Conda. Please use Docker / Singularity instead." | ||
} | ||
|
||
def args = task.ext.args ?: '' | ||
def run_type = reads ? "-r ${reads}" : | ||
contigs ? "-c ${contigs}" : | ||
exit("Reads or contigs must be specified") | ||
""" | ||
mitohifi.py ${run_type} -f ${ref_fa} -g ${ref_gb} -o ${mito_code} -t $task.cpus ${args} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
mitohifi: \$( mitohifi.py --version 2>&1 | head -n1 | sed 's/^.*MitoHiFi //; s/ .*\$//' ) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
""" | ||
touch final_mitogenome.fasta | ||
touch final_mitogenome.fasta | ||
touch contigs_stats.tsv | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
mitohifi: \$( mitohifi.py --version 2>&1 | head -n1 | sed 's/^.*MitoHiFi //; s/ .*\$//') | ||
END_VERSIONS | ||
""" | ||
} |
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,109 @@ | ||
name: "MITOHIFI_MITOHIFI" | ||
description: A python workflow that assembles mitogenomes from Pacbio HiFi reads | ||
keywords: | ||
- mitochondrion | ||
- chloroplast | ||
- PacBio | ||
tools: | ||
- "mitohifi.py": | ||
description: A python workflow that assembles mitogenomes from Pacbio HiFi reads | ||
homepage: https://github.com/marcelauliano/MitoHiFi | ||
documentation: https://github.com/marcelauliano/MitoHiFi | ||
tool_dev_url: https://github.com/marcelauliano/MitoHiFi | ||
doi: "10.1101/2022.12.23.521667" | ||
licence: ["MIT"] | ||
|
||
input: | ||
- reads: | ||
type: file | ||
description: Path to PacBio HiFi reads | ||
pattern: "*.{fa,fa.gz,fasta,fasta.gz}" | ||
- contigs: | ||
type: file | ||
description: Path to genome assembly | ||
pattern: "*.{fa,fasta}" | ||
- ref_fa: | ||
type: file | ||
description: Reference sequence | ||
pattern: "*.{fa,fasta}" | ||
- ref_gb: | ||
type: file | ||
description: Reference annotation | ||
pattern: "*.{gb}" | ||
- code: | ||
type: integer | ||
description: Mitochndrial code for annotation | ||
pattern: "[0-9]*" | ||
|
||
output: | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- fasta: | ||
type: file | ||
description: Mitochondrial sequence | ||
pattern: "*.{fasta,fa}" | ||
- gb: | ||
type: file | ||
description: Genome annotation in case mitofinder was used | ||
pattern: "*.gb" | ||
- gff: | ||
type: file | ||
description: Genome annotation in case mitos was used | ||
pattern: "*.gff" | ||
- all_potential_contigs: | ||
type: file | ||
description: Contains sequences of all potential contigs | ||
pattern: "*all_potential_contigs.fa" | ||
- contigs_annotations: | ||
type: file | ||
description: Graphical representation of annotated genes and tRNAs | ||
pattern: "*contigs_annotations.png" | ||
- contigs_circularization: | ||
type: directory | ||
description: Contains circularization reports | ||
pattern: "*contigs_circularization" | ||
- contigs_filtering: | ||
type: directory | ||
description: Contains files with initial blast matches | ||
pattern: "*contigs_filtering" | ||
- coverage_mapping: | ||
type: directory | ||
description: Contains statistics on coverage mapping | ||
pattern: "*coverage_mapping" | ||
- coverage_plot: | ||
type: file | ||
description: Read coverage plot for mitochondrial contigs | ||
pattern: "*coverage_plot.png" | ||
- final_mitogenome_annotation: | ||
type: file | ||
description: Graphical representation of annotated genes for the final mito contig | ||
pattern: "*final_mitogenome.annotation.png" | ||
- final_mitogenome_choice: | ||
type: directory | ||
description: Files with potential contigs clusterings and alignments | ||
pattern: "*final_mitogenome_choice" | ||
- final_mitogenome_coverage: | ||
type: file | ||
description: Graphical representation of reads coverage plot for the final mito contig | ||
pattern: "*final_mitogenome.coverage.png" | ||
- potential_contigs: | ||
type: directory | ||
description: Files with sequences and annotations of the potential contigs | ||
pattern: "*potential_contigs" | ||
- reads_mapping_and_assembly: | ||
type: directory | ||
description: Read mapping files for run from the raw reads | ||
pattern: "*reads_mapping_and_assembly" | ||
- shared_genes: | ||
type: directory | ||
description: Report on genes shared with the reference genome | ||
pattern: "*shared_genes.tsv" | ||
- versions: | ||
type: file | ||
description: Software versions used in the run | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@ksenia-krasheninnikova" |
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,16 @@ | ||
#!/usr/bin/env nextflow | ||
|
||
nextflow.enable.dsl = 2 | ||
|
||
include { MITOHIFI_MITOHIFI as MITOHIFI_MITOHIFI } from '../../../../../modules/nf-core/mitohifi/mitohifi/main.nf' | ||
|
||
workflow test_mitohifi_mitohifi { | ||
|
||
species = "'Deilephila porcellus'" | ||
|
||
data_contigs = Channel.of([[id:"ilDeiPorc1"],[],file(params.test_data['deilephila_porcellus']['mito']['contigs'], checkIfExists: true)]) | ||
ref_gb = file(params.test_data['deilephila_porcellus']['mito']['ref_gb'], checkIfExists: true) | ||
ref_fa = file(params.test_data['deilephila_porcellus']['mito']['ref_fa'], checkIfExists: true) | ||
code = 5 | ||
MITOHIFI_MITOHIFI ( data_contigs, ref_fa, ref_gb, code ) | ||
} |
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,5 @@ | ||
process { | ||
|
||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
} |
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,12 @@ | ||
- name: mitohifi mitohifi test_mitohifi_mitohifi | ||
command: nextflow run ./tests/modules/nf-core/mitohifi/mitohifi -entry test_mitohifi_mitohifi -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/mitohifi/mitohifi/nextflow.config | ||
tags: | ||
- mitohifi | ||
- mitohifi/mitohifi | ||
files: | ||
- path: output/mitohifi/final_mitogenome.fasta | ||
md5sum: 5654c418bbf991483d9e618dd849af03 | ||
- path: output/mitohifi/final_mitogenome.gb | ||
md5sum: 3b4659a0d7f27fd89510a25c0588909d | ||
- path: output/mitohifi/versions.yml | ||
md5sum: 2a4db1ea8ac4b9b11ea47e1c3963f591 |