Skip to content

Commit

Permalink
add stub for local/deseq2_qc
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Jun 21, 2024
1 parent c5b4fee commit 858cd5d
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 7 deletions.
27 changes: 27 additions & 0 deletions modules/local/deseq2_qc/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,31 @@ process DESEQ2_QC {
bioconductor-deseq2: \$(Rscript -e "library(DESeq2); cat(as.character(packageVersion('DESeq2')))")
END_VERSIONS
"""

stub:
def args2 = task.ext.args2 ?: ''
def label_lower = args2.toLowerCase()
prefix = task.ext.prefix ?: "deseq2"
"""
mkdir size_factors
touch ${label_lower}.pca.vals_mqc.tsv
touch ${label_lower}.sample.dists_mqc.tsv
touch ${prefix}.plots.pdf
touch ${prefix}.dds.RData
touch ${prefix}.pca.vals.txt
touch ${prefix}.sample.dists.txt
touch R_sessionInfo.log
touch size_factors/${prefix}.size_factors.RData
for i in `head $counts -n 1 | cut -f3-`;
do
touch size_factors/\${i}.size_factors.RData
done
cat <<-END_VERSIONS > versions.yml
"${task.process}":
r-base: \$(echo \$(R --version 2>&1) | sed 's/^.*R version //; s/ .*\$//')
bioconductor-deseq2: \$(Rscript -e "library(DESeq2); cat(as.character(packageVersion('DESeq2')))")
END_VERSIONS
"""
}
25 changes: 23 additions & 2 deletions modules/local/deseq2_qc/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,32 @@ nextflow_process {
process.out.pca_multiqc,
process.out.pca_txt,
process.out.rdata,
process.out.size_factors
process.out.size_factors,
process.out.versions
).match() }
)
}

}

test("parse count data correctly - stub") {

options "-stub"

when {
process {
"""
input[0] = file(params.pipelines_testdata_base_path + "deseq2qc/countFile.tsv", checkIfExists: true)
input[1] = file(params.pipelines_testdata_base_path + "deseq2qc/deseq2_pca_header.txt", checkIfExists: true)
input[2] = file(params.pipelines_testdata_base_path + "deseq2qc/deseq2_clustering_header.txt", checkIfExists: true)
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
92 changes: 87 additions & 5 deletions modules/local/deseq2_qc/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,87 @@
{
"parse count data correctly - stub": {
"content": [
{
"0": [
"deseq2.plots.pdf:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"1": [
"deseq2.dds.RData:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"2": [
"deseq2.pca.vals.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"3": [

],
"4": [
"deseq2.sample.dists.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"5": [

],
"6": [
"R_sessionInfo.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"7": [
[
"RAP1_IAA_30M_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"RAP1_UNINDUCED_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"RAP1_UNINDUCED_REP2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"WT_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"WT_REP2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"deseq2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"8": [
"versions.yml:md5,60f8e4f473397a4b5d1a3dc490c93ec5"
],
"dists_multiqc": [

],
"dists_txt": [
"deseq2.sample.dists.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"log": [
"R_sessionInfo.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"pca_multiqc": [

],
"pca_txt": [
"deseq2.pca.vals.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"pdf": [
"deseq2.plots.pdf:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"rdata": [
"deseq2.dds.RData:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"size_factors": [
[
"RAP1_IAA_30M_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"RAP1_UNINDUCED_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"RAP1_UNINDUCED_REP2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"WT_REP1.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"WT_REP2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e",
"deseq2.size_factors.RData:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,60f8e4f473397a4b5d1a3dc490c93ec5"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.2"
},
"timestamp": "2024-06-21T11:38:08.92794"
},
"parse count data correctly": {
"content": [
[

],
[
"deseq2.sample.dists.txt:md5,1616ce40eb58ee75640efed219c6bbec"
Expand All @@ -11,7 +90,7 @@
"R_sessionInfo.log:md5,fb0da0d7ad6994ed66a8e68348b19676"
],
[

],
[
"deseq2.pca.vals.txt:md5,4cda8e32ec39326c1350e77b4b607aad"
Expand All @@ -28,12 +107,15 @@
"WT_REP2.txt:md5,2ce093f2c2e92c1bde1cd3da91ac884c",
"deseq2.size_factors.RData:md5,51c6643a0f8a9edabbff8df0165451f2"
]
],
[
"versions.yml:md5,60f8e4f473397a4b5d1a3dc490c93ec5"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nextflow": "24.04.2"
},
"timestamp": "2024-03-07T12:34:51.582179"
"timestamp": "2024-06-21T11:21:20.349616"
}
}
}

0 comments on commit 858cd5d

Please sign in to comment.