Skip to content

Commit

Permalink
Merge branch 'main' into edge_v3
Browse files Browse the repository at this point in the history
  • Loading branch information
aw-watson authored Jan 6, 2025
2 parents d99f712 + 4957dc2 commit 25384ee
Show file tree
Hide file tree
Showing 16 changed files with 144 additions and 10 deletions.
4 changes: 2 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ include {READSTOCONTIGS} from './modules/runReadsToContig/runReadsToContig.nf'

workflow {

//input specification

//input specification
fastqFiles = channel.fromPath(params.shared.inputFastq, checkIfExists:true)
contigs = channel.empty()
if(params.r2c.useAssembledContigs) {
Expand All @@ -33,6 +32,7 @@ workflow {
unpaired = channel.empty()
if(params.modules.faqcs) {
FAQCS(params.faqcs.plus(params.shared), fastqFiles,avgLen)

paired = FAQCS.out.paired.ifEmpty(params.pairedFiles)
unpaired = FAQCS.out.unpaired.ifEmpty(params.unpairedFiles)
}
Expand Down
1 change: 0 additions & 1 deletion modules/runFaQCs/runFaQCs.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env nextflow


//double-checks that any provided adapter file is in FASTA format
process adapterFileCheck {
label "qc"
Expand Down
2 changes: 2 additions & 0 deletions modules/sra2fastq/sra2fastq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ process sraDownload {
publishDir "${settings["outDir"]}/SRA_Download", mode: 'copy'

//retries download in case of transient failure, then completes any downloads that didn't fail

maxRetries 3
errorStrategy { (task.attempt <= maxRetries) ? 'retry' : 'finish' }

Expand Down Expand Up @@ -49,4 +50,5 @@ workflow SRA2FASTQ {

emit:
fastq

}
6 changes: 4 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ params {

sra2fastq {
clean = false

accessions = []
}

Expand All @@ -39,6 +40,7 @@ params {
numN = 2
filtLC = 0.85
filtPhiX = false

}

hostRemoval {
Expand Down Expand Up @@ -139,6 +141,6 @@ executor {
submitRateLimit = '1/5sec'
}


//cleanup
cleanup = true
cleanup = false

7 changes: 7 additions & 0 deletions runAntiSmash/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# syntax=docker/dockerfile:1
FROM antismash/standalone-lite-nonfree:7.1.0

#we override the base image's entrypoint for appropriate interaction with Nextflow
ENTRYPOINT ["/usr/bin/env"]
SHELL ["/bin/bash", "-c"]
CMD /bin/bash
29 changes: 29 additions & 0 deletions runAntiSmash/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
params {
//defaults
input = null //either contig file or gbk from annotation
projName = "Project"
outDir = "."
numCPU=8
database = "$projectDir/../../database/antiSMASH" //path to downloaded database location (download-antismash-databases --database-dir <DBPATH>)
//defaults
taxon = 'bacteria'
clusterblast = false
subclusterblast = true
knownclusterblast = true
mibig = false
smcogs = false
pfam2go = false
asf = true
rre = true
fullhmm = false
tigrfam = false
cassis = false //only with fungi
}

process.container="apwat/sma:0.14"
singularity{
enabled=true
runOptions="--compat -H $PWD --bind $projectDir/../../database/antiSMASH:$projectDir/../../database/antiSMASH"
}

cleanup=true
55 changes: 55 additions & 0 deletions runAntiSmash/runAntiSmash.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

//runs ANTISMASH on provided .fa or .gbk input.
process antismash {
publishDir(
path: "$params.outDir/AssemblyBasedAnalysis/AntiSmash",
mode: 'copy'
)

input:
path input

output:
path "output/*"
path "antismashLog.txt"

script:
def taxon = params.taxon.equalsIgnoreCase("fungi") ? "--taxon fungi" : "--taxon bacteria"
def clusterblast = params.clusterblast == true ? "--cb-general" : ""
def subclusterblast = params.subclusterblast == true ? "--cb-subclusters" : ""
def knownclusterblast = params.knownclusterblast == true ? "--cb-knownclusters" : ""
def mibig = params.mibig == true ? "--cc-mibig" : ""
def smcogs = params.smcogs == true ? "--smcog-trees" : ""
def asf = params.asf == true ? "--asf" : ""
def rre = params.rre == true ? "--rre" : ""
def fullhmmer = params.fullhmm == true ? "--fullhmmer" : ""
def tigrfam = params.tigrfam == true ? "--tigrfam" : ""
def pfam2go = params.pfam2go == true ? "--pfam2go" : ""
def genefinding = params.taxon.equalsIgnoreCase("fungi") ? "--genefinding-tool glimmerhmm" : "--genefinding-tool prodigal-m"
def cassis = (params.taxon.equalsIgnoreCase("fungi") && params.cassis == true) ? "--cassis" : ""

"""
antismash -c $params.numCPU $taxon \
--logfile antismashLog.txt --output-dir ./output \
--html-title $params.projName --database $params.database \
$clusterblast \
$subclusterblast \
$knownclusterblast \
$mibig \
$smcogs \
$asf \
$rre \
$fullhmmer \
$tigrfam \
$pfam2go \
$cassis \
$genefinding \
$input
"""

}


workflow {
antismash(channel.fromPath(params.input,checkIfExists:true))
}
16 changes: 16 additions & 0 deletions runAntiSmash/test_files/parameters/antismash_all_opts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"numCPU": 4,
"input": "${projectDir}/../test_data/contigs.fa",
"projName": "BasicAntismashTest",
"database": "${projectDir}/../../database/antiSMASH",
"clusterblast": true,
"subclusterblast": true,
"knownclusterblast": true,
"mibig": true,
"smcogs": true,
"pfam2go": true,
"asf": true,
"rre": true,
"fullhmm": true,
"tigrfam": true
}
6 changes: 6 additions & 0 deletions runAntiSmash/test_files/parameters/antismash_basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"numCPU": 4,
"input": "${projectDir}/../test_data/contigs.fa",
"projName": "BasicAntismashTest",
"database": "${projectDir}/../../database/antiSMASH"
}
8 changes: 8 additions & 0 deletions runAntiSmash/test_files/parameters/antismash_fungi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"numCPU": 4,
"input": "${projectDir}/../test_data/contigs.fa",
"projName": "FungiAntismashTest",
"database": "${projectDir}/../../database/antiSMASH",
"taxon": "fungi",
"cassis": true
}
2 changes: 0 additions & 2 deletions tests/modules/countFastq/countFastq.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,4 @@ nextflow_workflow {
}

}


}
3 changes: 3 additions & 0 deletions tests/modules/countFastq/countFastq.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T13:53:45.128251613"

},
"1 Unpaired File": {
"content": [
Expand All @@ -35,12 +36,14 @@
"151"
],
"1": [

"all.se.fastq:md5,c9cd5b2586c75c7448674ff3ff5451de"
],
"avgReadLen": [
"151"
],
"fastqFiles": [

"all.se.fastq:md5,c9cd5b2586c75c7448674ff3ff5451de"
]
}
Expand Down
9 changes: 9 additions & 0 deletions tests/modules/runFaQCs/runFaQCs.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"QC.1.trimmed.fastq:md5,deb773f1726c6134a7d2fc069af7b21b",
"QC.2.trimmed.fastq:md5,a793e8ccfe60c0f9462a80d520eecd7a"
]

]
}
],
Expand All @@ -21,6 +22,7 @@
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T14:15:19.062459705"

},
"Basic SE": {
"content": [
Expand All @@ -30,6 +32,7 @@
],
"trimmed": [
"QC.unpaired.trimmed.fastq:md5,3a0138c06e9cd504e2cca8e5d93532f1"

]
}
],
Expand All @@ -38,6 +41,7 @@
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T14:14:24.933787665"

},
"SE with adapter removal": {
"content": [
Expand All @@ -47,6 +51,7 @@
],
"trimmed": [
"QC.unpaired.trimmed.fastq:md5,3e43d37648eea875f5583f5cfcbb16ca"

]
}
],
Expand All @@ -55,6 +60,7 @@
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T14:15:03.845678151"

},
"Basic PE": {
"content": [
Expand All @@ -70,6 +76,7 @@
"QC.1.trimmed.fastq:md5,deb773f1726c6134a7d2fc069af7b21b",
"QC.2.trimmed.fastq:md5,a793e8ccfe60c0f9462a80d520eecd7a"
]

]
}
],
Expand All @@ -78,6 +85,7 @@
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T14:14:13.196766924"

},
"PE with adapter removal": {
"content": [
Expand All @@ -93,6 +101,7 @@
"QC.1.trimmed.fastq:md5,1e70223f29baaced4509b62a5e84f074",
"QC.2.trimmed.fastq:md5,649bf376592b80e9ae1cee81d018a65f"
]

]
}
],
Expand Down
1 change: 0 additions & 1 deletion tests/modules/sra2fastq/sra2fastq.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,4 @@ nextflow_workflow {
}

}

}
2 changes: 1 addition & 1 deletion tests/modules/sra2fastq/sra2fastq.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"SRR29462562.fastq.gz:md5,31506ee0f339cb6398dd326d5cb23b77"
],
"fastq": [

"SRR29462562.fastq.gz:md5,31506ee0f339cb6398dd326d5cb23b77"
]
}
Expand All @@ -48,6 +49,5 @@
"nf-test": "0.9.2",
"nextflow": "24.10.3"
},
"timestamp": "2025-01-06T14:20:03.994730963"
}
}
3 changes: 2 additions & 1 deletion tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
========================================================================================
*/

cleanup = false //necessary to compare snapshotted files
cleanup = false //necessary to compare snapshotted files

0 comments on commit 25384ee

Please sign in to comment.