Skip to content

Commit

Permalink
Pre 1.3.1 PR (#5)
Browse files Browse the repository at this point in the history
* Test conda changes

* Further conda test

* Update version in manifest
  • Loading branch information
BioWilko authored Sep 30, 2024
1 parent c45c041 commit 1085cf2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 76 deletions.
17 changes: 17 additions & 0 deletions environments/squirrel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: squirrel
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- biopython>=1.74
- minimap2>=2.16
- python=3.10
- snakemake-minimal=7.32
- matplotlib>=3.3.1
- gofasta
- iqtree>=2.1
- jclusterfunk>=0.0.25
- pip
- pip:
- git+https://github.com/aineniamh/squirrel.git@main
12 changes: 6 additions & 6 deletions lib/WorkflowMain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ class WorkflowMain {
// Explode on conda
// conda.enabled seems to be backward compatible but wrap this
// in a generic catch just in case
try {
if (workflow.session.config.conda.enabled) {
log.error "Sorry, this workflow is not compatible with Conda, please use -profile standard (Docker) or -profile singularity."
System.exit(1)
}
} catch(Exception e) {}
// try {
// if (workflow.session.config.conda.enabled) {
// log.error "Sorry, this workflow is not compatible with Conda, please use -profile standard (Docker) or -profile singularity."
// System.exit(1)
// }
// } catch(Exception e) {}

// Validate workflow parameters via the JSON schema
if (params.validate_params) {
Expand Down
8 changes: 4 additions & 4 deletions modules/illumina.nf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ process align_trim {

container 'community.wave.seqera.io/library/pysam_samtools_numpy_pandas:0ef969f9a905399f'

conda 'bioconda::pysam=0.22.1', 'bioconda::samtools=1.12', 'conda-forge::numpy=2.1.1', 'conda-forge::pandas=2.2.2'
conda 'bioconda::pysam=0.22.1 bioconda::samtools=1.12 conda-forge::numpy=2.1.1 conda-forge::pandas=2.2.2'

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.primertrimmed.rg.sorted.bam*", mode: 'copy'
publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.amplicon_depths.tsv", mode: 'copy'
Expand Down Expand Up @@ -94,7 +94,7 @@ process indexReference {

container 'community.wave.seqera.io/library/bwa:0.7.18--324359fbc6e00dba'

conda 'bioconda::bwa=0.7.17'
conda 'bioconda::bwa=0.7.18'

input:
path(ref)
Expand Down Expand Up @@ -122,7 +122,7 @@ process readMapping {

container 'community.wave.seqera.io/library/bwa_samtools:3938c84206f62975'

conda 'bioconda::bwa=0.7.18', 'bioconda::samtools=1.12'
conda 'bioconda::bwa=0.7.18 bioconda::samtools=1.12'

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.sorted{.bam,.bam.bai}", mode: 'copy'

Expand All @@ -149,7 +149,7 @@ process callConsensusFreebayes {

container 'community.wave.seqera.io/library/bcftools_freebayes_pysam_tabix:c16cddc9a1a28b82'

conda 'bioconda::freebayes=1.3.6', 'bioconda::bcftools=1.20', 'bioconda::pysam=0.22.1', 'bioconda::tabix=1.11'
conda 'bioconda::freebayes=1.3.6 bioconda::bcftools=1.20 bioconda::pysam=0.22.1 bioconda::tabix=1.11'

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.consensus.fa", mode: 'copy'
publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}.variants.norm.vcf", mode: 'copy'
Expand Down
2 changes: 1 addition & 1 deletion modules/qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process makeQCCSV {

container 'community.wave.seqera.io/library/samtools_biopython_matplotlib_pandas:2bb143fe29dc1ce9'

conda "conda-forge::matplotlib=3.9.2", "conda-forge::pandas=2.2.2", "conda-forge::biopython=1.84", "bioconda::samtools=1.20"
conda "conda-forge::matplotlib=3.9.2 conda-forge::pandas=2.2.2 conda-forge::biopython=1.84 bioconda::samtools=1.20"

publishDir "${params.outdir}/qc_plots", pattern: "${sampleName}.depth.png", mode: 'copy'

Expand Down
2 changes: 2 additions & 0 deletions modules/squirrel.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ process squirrelAlignmentAndQC {

container "docker.io/articnetworkorg/squirrel@sha256:78921da0c726dd525f5d72db331526975adb634478ee31047c46765bd3d5a64a"

conda "${projectDir}/environments/squirrel.yml"

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "squirrel/**", mode: 'copy', saveAs: { fn -> fn.replace("squirrel/", "")}

input:
Expand Down
64 changes: 0 additions & 64 deletions modules/utils.nf
Original file line number Diff line number Diff line change
@@ -1,67 +1,3 @@
process articDownloadScheme{
tag params.schemeRepoURL

label 'internet'

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "scheme", mode: "copy"

output:
path "scheme/**/${params.schemeVersion}/*.reference.fasta" , emit: reffasta
path "scheme/**/${params.schemeVersion}/${params.scheme}.bed" , emit: bed
path "scheme" , emit: scheme

script:
"""
git clone ${params.schemeRepoURL} scheme
"""
}

process get_bed_ref {

label 'process_single'

container 'nextflow/bash:latest'

input:
path scheme_dir
val scheme_name
val scheme_version
output:
path "primer.bed", emit: bed
path "reference.fasta", emit: ref
path "reference.gff3", emit: gff

"""
cp ${scheme_name}/${scheme_version}/primer.bed primer.bed
cp ${scheme_name}/${scheme_version}/reference.fasta reference.fasta
cp ${scheme_name}/${scheme_version}/reference.gff3 reference.gff3
"""
}

process performHostFilter {

tag { sampleName }

container 'community.wave.seqera.io/library/bwa_pysam_samtools_python:f3b7e3fe2ad2cadc'

conda 'bioconda::bwa=0.7.18', 'bioconda::samtools=1.20', 'bioconda::python=3.12.5', 'bioconda::pysam=0.22.1'

publishDir "${params.outdir}/${task.process.replaceAll(":","_")}", pattern: "${sampleName}_hostfiltered_R*.fastq.gz", mode: 'copy'

input:
tuple val(sampleName), path(forward), path(reverse)
output:
tuple val(sampleName), path("${sampleName}_hostfiltered_R1.fastq.gz"), path("${sampleName}_hostfiltered_R2.fastq.gz"), emit: fastqPairs

script:
"""
bwa mem -t ${task.cpus} ${params.composite_ref} ${forward} ${reverse} | \
filter_non_human_reads.py -c ${params.viral_contig_name} > ${sampleName}.viral_and_nonmapping_reads.bam
samtools sort -n ${sampleName}.viral_and_nonmapping_reads.bam | \
samtools fastq -1 ${sampleName}_hostfiltered_R1.fastq.gz -2 ${sampleName}_hostfiltered_R2.fastq.gz -s ${sampleName}_singletons.fastq.gz -
"""
}

process publish {
publishDir "${params.outdir}/", mode: 'copy'
container 'nextflow/bash:latest'
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ manifest {
description = 'Epi2me compatible Nextflow pipeline for processing ARTIC tiling amplicon Illumina sequencing reads from monkeypox virus (MPXV) samples.'
mainScript = 'main.nf'
nextflowVersion = '>=20.01.0'
version = '1.3.0'
version = '1.3.1'
defaultBranch = 'main'
}

Expand Down

0 comments on commit 1085cf2

Please sign in to comment.