Skip to content

Commit

Permalink
Merge branch 'master' into update-panaroo/run
Browse files Browse the repository at this point in the history
* master:
  New module : Pilon (nf-core#3331)
  Islandpath (nf-core#3145)
  • Loading branch information
jvfe committed May 2, 2023
2 parents 0e077da + b37a64d commit 4a358f8
Show file tree
Hide file tree
Showing 12 changed files with 272 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ jobs:
tags: subworkflows/bcl_demultiplex
- profile: "conda"
tags: subworkflows/vcf_annotate_ensemblvep

- profile: "conda"
tags: islandpath
env:
NXF_ANSI_LOG: false
SENTIEON_LICENSE_BASE64: ${{ secrets.SENTIEON_LICENSE_BASE64 }}
Expand Down
37 changes: 37 additions & 0 deletions modules/nf-core/islandpath/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process ISLANDPATH {
tag "$meta.id"
label 'process_medium'

conda "bioconda::islandpath=1.0.6"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/islandpath:1.0.6--hdfd78af_0':
'quay.io/biocontainers/islandpath:1.0.6--hdfd78af_0' }"

input:
tuple val(meta), path(genome)

output:
tuple val(meta), path("*.gff") , emit: gff
path "Dimob.log" , emit: log
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def VERSION = '1.0.6'
"""
islandpath \\
$genome \\
${prefix}.gff \\
$args
cat <<-END_VERSIONS > versions.yml
"${task.process}":
islandpath: $VERSION
END_VERSIONS
"""
}
44 changes: 44 additions & 0 deletions modules/nf-core/islandpath/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: islandpath
description: Genomic island prediction in bacterial and archaeal genomes
keywords:
- genomes
- genomic islands
- prediction
tools:
- "islandpath":
description: "IslandPath-DIMOB is a standalone software to predict genomic islands (GIs - clusters of genes in prokaryotic genomes of probable horizontal origin) in bacterial and archaeal genomes based on the presence of dinucleotide biases and mobility genes."
homepage: https://github.com/brinkmanlab/islandpath
documentation: https://github.com/brinkmanlab/islandpath#readme
tool_dev_url: https://github.com/brinkmanlab/islandpath
doi: "10.1093/bioinformatics/bty095"
licence: "['GPL v3']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- genome:
type: file
description: |
Genome file in .gbk or .embl format.
pattern: "*.{gbk, embl, gbff}"
output:
- gff:
type: file
description: GFF file listing the predicted genomic islands and their coordinates
pattern: "*.gff"
- log:
type: file
description: Log file of the islandpath run
pattern: "*.log"

- versions:
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@jvfe"
43 changes: 43 additions & 0 deletions modules/nf-core/pilon/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
process PILON {
tag "$meta.id"
label 'process_medium'

conda "bioconda::pilon=1.24"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pilon:1.24--hdfd78af_0':
'quay.io/biocontainers/pilon:1.24--hdfd78af_0' }"

input:
tuple val(meta), path(fasta)
tuple val(meta_bam), path(bam), path(bai)
val pilon_mode

output:
tuple val(meta), path("*.fasta") , emit: improved_assembly
tuple val(meta), path("*.vcf") , emit: vcf , optional : true
tuple val(meta), path("*.change"), emit: change_record , optional : true
tuple val(meta), path("*.bed") , emit: tracks_bed , optional : true
tuple val(meta), path("*.wig") , emit: tracks_wig , optional : true
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def valid_mode = ["frags", "jumps", "unpaired", "bam"]
if ( !valid_mode.contains(pilon_mode) ) { error "Unrecognised mode to run Pilon. Options: ${valid_mode.join(', ')}" }
"""
pilon \\
--genome $fasta \\
--output ${meta.id} \\
--threads $task.cpus \\
$args \\
--$pilon_mode $bam
cat <<-END_VERSIONS > versions.yml
"${task.process}":
pilon: \$(echo \$(pilon --version) | sed 's/^.*version //; s/ .*\$//' )
"""
}
71 changes: 71 additions & 0 deletions modules/nf-core/pilon/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: "pilon"
description: Automatically improve draft assemblies and find variation among strains, including large event detection
keywords:
- polishing
- assembly
- variant calling
tools:
- "pilon":
description: "Pilon is an automated genome assembly improvement and variant detection tool."
homepage: "https://github.com/broadinstitute/pilon/wiki"
documentation: "https://github.com/broadinstitute/pilon/wiki/Requirements-&-Usage"
tool_dev_url: "https://github.com/broadinstitute/pilon"
doi: "https://doi.org/10.1371/journal.pone.0112963"
licence: "['GPL v2']"

input:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: FASTA of the input genome
pattern: "*.{fasta}"
- bam:
type: file
description: BAM file of reads aligned to the input genome
pattern: "*.{bam}"
- bai:
type: file
description: BAI file (BAM index) of BAM reads aligned to the input genome
pattern: "*.{bai}"
- pilon_mode:
type: value
description: Indicates the type of bam file used (frags for paired-end sequencing of DNA fragments, such as Illumina paired-end reads of fragment size <1000bp, jumps for paired sequencing data of larger insert size, such as Illumina mate pair libraries, typically of insert size >1000bp, unpaired for unpaired sequencing reads, bam will automatically classify the BAM as one of the three types above (version 1.17 and higher).
pattern: ["frags", "jumps", "unpaired", "bam"]

output:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
- improved_assembly:
type: file
description: fasta file, improved assembly
pattern: "*.{fasta}"
- change_record:
type: file
description: file containing a space-delimited record of every change made in the assembly as instructed by the --fix option
pattern: "*.{change}"
- vcf:
type: file
description: Pilon variant output
pattern: "*.{vcf}"
- tracks_bed:
type: file
description: files that may be viewed in genome browsers such as IGV, GenomeView, and other applications that support these formats
pattern: "*.{bed}"
- tracks_wig:
type: file
description: files that may be viewed in genome browsers such as IGV, GenomeView, and other applications that support these formats
pattern: "*.{wig}"

authors:
- "@scorreard"
8 changes: 8 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,10 @@ iqtree:
- modules/nf-core/iqtree/**
- tests/modules/nf-core/iqtree/**

islandpath:
- modules/nf-core/islandpath/**
- tests/modules/nf-core/islandpath/**

ismapper:
- modules/nf-core/ismapper/**
- tests/modules/nf-core/ismapper/**
Expand Down Expand Up @@ -2599,6 +2603,10 @@ picard/sortvcf:
- modules/nf-core/picard/sortvcf/**
- tests/modules/nf-core/picard/sortvcf/**

pilon:
- modules/nf-core/pilon/**
- tests/modules/nf-core/pilon/**

pindel/pindel:
- modules/nf-core/pindel/pindel/**
- tests/modules/nf-core/pindel/pindel/**
Expand Down
18 changes: 18 additions & 0 deletions tests/modules/nf-core/islandpath/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { GUNZIP } from '../../../../modules/nf-core/gunzip/main.nf'
include { ISLANDPATH } from '../../../../modules/nf-core/islandpath/main.nf'

workflow test_islandpath {

input = [
[ id:'test' ], // meta map
file(params.test_data['bacteroides_fragilis']['genome']['genome_gbff_gz'], checkIfExists: true)
]

GUNZIP ( input )

ISLANDPATH ( GUNZIP.out.gunzip )
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/islandpath/nextflow.config
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()}" }

}
11 changes: 11 additions & 0 deletions tests/modules/nf-core/islandpath/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- name: islandpath test_islandpath
command: nextflow run ./tests/modules/nf-core/islandpath -entry test_islandpath -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/islandpath/nextflow.config
tags:
- islandpath
files:
- path: output/islandpath/Dimob.log
contains:
- "Running IslandPath-DIMOB"
- path: output/islandpath/test.gff
md5sum: d4719f73e9af606346fade238aa191fa
- path: output/islandpath/versions.yml
20 changes: 20 additions & 0 deletions tests/modules/nf-core/pilon/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env nextflow

nextflow.enable.dsl = 2

include { PILON } from '../../../../modules/nf-core/pilon/main.nf'

workflow test_pilon {

input = [
[ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true)
]

bam_tuple_ch = Channel.of([ [ id:'test', single_end:false ], // meta map
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true),
file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam_bai'], checkIfExists: true),
])

PILON ( input, bam_tuple_ch, "bam" )
}
5 changes: 5 additions & 0 deletions tests/modules/nf-core/pilon/nextflow.config
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()}" }

}
8 changes: 8 additions & 0 deletions tests/modules/nf-core/pilon/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: pilon test_pilon
command: nextflow run ./tests/modules/nf-core/pilon -entry test_pilon -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/pilon/nextflow.config
tags:
- pilon
files:
- path: output/pilon/test.fasta
md5sum: 2e881994820a5a641da9ea594ab4958f
- path: output/pilon/versions.yml

0 comments on commit 4a358f8

Please sign in to comment.