Skip to content

Commit

Permalink
deseq2_qc: Move test data into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrtalbot committed Mar 7, 2024
1 parent 7b74143 commit ff2ddbc
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 134 deletions.
18 changes: 18 additions & 0 deletions modules/local/deseq2_qc/tests/data/countFile.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
gene_id gene_name RAP1_IAA_30M_REP1 RAP1_UNINDUCED_REP1 RAP1_UNINDUCED_REP2 WT_REP1 WT_REP2
Gfp_transgene_gene Gfp_transgene_gene 0 0 0 0 0
HRA1 HRA1 3.01943228500291 9.80701185810843 9.53274413980081 5.72894534769954 5.9648842559222
snR18 snR18 2.15518528497702 20.2706605484032 10.1398196728994 5.78313737408605 5.79976683844901
YAL001C TFC3 56.5487189493641 70.7846010387686 113.108816589334 60.5178622417112 30.2958040068545
YAL002W VPS8 36.3862437592078 32.3965311942571 80.536128672497 63.6031126291227 25.2702744059695
YAL003W EFB1 598.396699649099 887.339579289614 1856.66699260635 1049.93553354283 665.403243069765
YAL004W YAL004W 388.410667489585 383.296795393227 203.744142706403 202.691892385957 251.440658667147
YAL005C SSA1 5647.27979655766 5715.94369645599 12575.108029018 7775.42737695585 3903.66710060582
YAL007C ERP2 44.6930487868818 60.9301400694571 143.68466075721 56.9486461946981 41.7805866183878
YAL008W FUN14 13.1986081960994 18.7996646072737 26.552459043029 9.4087625308538 2.82245410144267
YAL009W SPO7 13.5217762310537 15.8719804576371 20.113413795 8.67724034815225 4.82436501953514
YAL010C MDM10 10.9410758413598 12.0839661783069 36.2679562039924 29.7986383847897 9.94377960724503
YAL011W SWC3 12.0055027348268 24.9403272396788 35.9299792122994 19.9834911886444 18.0057148106317
YAL012W CYS3 242.877787996136 236.466395413312 547.58060621785 378.571834233094 226.984289418222
YAL013W DEP1 7.90662508175251 18.3153373366285 35.6289306191157 20.7248252538103 10.8672258295774
YAL014C SYN8 15.4361922388434 21.2042068878003 44.5485583043788 26.9652946879967 16.3840947562552
YAL015C NTG1 12.841137836752 12.2213888342821 28.5292052419374 7.89073247427083 5.92421903162791
12 changes: 12 additions & 0 deletions modules/local/deseq2_qc/tests/data/deseq2_clustering_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#id: 'deseq2_clustering'
#section_name: 'DESeq2 sample similarity'
#description: "is generated from clustering by Euclidean distances between
# <a href='https://bioconductor.org/packages/release/bioc/html/DESeq2.html' target='_blank'>DESeq2</a>
# rlog values for each sample
# in the <a href='https://github.com/nf-core/rnaseq/blob/master/bin/deseq2_qc.r'><code>deseq2_qc.r</code></a> script."
#plot_type: 'heatmap'
#anchor: 'deseq2_clustering'
#pconfig:
# title: 'DESeq2: Heatmap of the sample-to-sample distances'
# xlab: True
# reverseColors: True
11 changes: 11 additions & 0 deletions modules/local/deseq2_qc/tests/data/deseq2_pca_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#id: 'deseq2_pca'
#section_name: 'DESeq2 PCA plot'
#description: "PCA plot between samples in the experiment.
# These values are calculated using <a href='https://bioconductor.org/packages/release/bioc/html/DESeq2.html'>DESeq2</a>
# in the <a href='https://github.com/nf-core/rnaseq/blob/master/bin/deseq2_qc.r'><code>deseq2_qc.r</code></a> script."
#plot_type: 'scatter'
#anchor: 'deseq2_pca'
#pconfig:
# title: 'DESeq2: Principal component plot'
# xlab: PC1
# ylab: PC2
77 changes: 13 additions & 64 deletions modules/local/deseq2_qc/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,76 +9,25 @@ nextflow_process {
when {
process {
"""
// Taken from example salmon merged data from -profile test
def fileContents = [
'gene_id gene_name RAP1_IAA_30M_REP1 RAP1_UNINDUCED_REP1 RAP1_UNINDUCED_REP2 WT_REP1 WT_REP2',
'Gfp_transgene_gene Gfp_transgene_gene 0 0 0 0 0',
'HRA1 HRA1 3.01943228500291 9.80701185810843 9.53274413980081 5.72894534769954 5.9648842559222',
'snR18 snR18 2.15518528497702 20.2706605484032 10.1398196728994 5.78313737408605 5.79976683844901',
'YAL001C TFC3 56.5487189493641 70.7846010387686 113.108816589334 60.5178622417112 30.2958040068545',
'YAL002W VPS8 36.3862437592078 32.3965311942571 80.536128672497 63.6031126291227 25.2702744059695',
'YAL003W EFB1 598.396699649099 887.339579289614 1856.66699260635 1049.93553354283 665.403243069765',
'YAL004W YAL004W 388.410667489585 383.296795393227 203.744142706403 202.691892385957 251.440658667147',
'YAL005C SSA1 5647.27979655766 5715.94369645599 12575.108029018 7775.42737695585 3903.66710060582',
'YAL007C ERP2 44.6930487868818 60.9301400694571 143.68466075721 56.9486461946981 41.7805866183878',
'YAL008W FUN14 13.1986081960994 18.7996646072737 26.552459043029 9.4087625308538 2.82245410144267',
'YAL009W SPO7 13.5217762310537 15.8719804576371 20.113413795 8.67724034815225 4.82436501953514',
'YAL010C MDM10 10.9410758413598 12.0839661783069 36.2679562039924 29.7986383847897 9.94377960724503',
'YAL011W SWC3 12.0055027348268 24.9403272396788 35.9299792122994 19.9834911886444 18.0057148106317',
'YAL012W CYS3 242.877787996136 236.466395413312 547.58060621785 378.571834233094 226.984289418222',
'YAL013W DEP1 7.90662508175251 18.3153373366285 35.6289306191157 20.7248252538103 10.8672258295774',
'YAL014C SYN8 15.4361922388434 21.2042068878003 44.5485583043788 26.9652946879967 16.3840947562552',
'YAL015C NTG1 12.841137836752 12.2213888342821 28.5292052419374 7.89073247427083 5.92421903162791',
]
def countFile = file("${workDir}/countFile.tsv")
countFile.withWriter{ out ->
fileContents.each {out.println it}
}
def pcaHeaderFile = file("${workDir}/deseq2_pca_header.txt")
def pcaHeaderContents = '''
#id: 'deseq2_pca'
#section_name: 'DESeq2 PCA plot'
#description: "PCA plot between samples in the experiment.
# These values are calculated using <a href='https://bioconductor.org/packages/release/bioc/html/DESeq2.html'>DESeq2</a>
# in the <a href='https://github.com/nf-core/rnaseq/blob/master/bin/deseq2_qc.r'><code>deseq2_qc.r</code></a> script."
#plot_type: 'scatter'
#anchor: 'deseq2_pca'
#pconfig:
# title: 'DESeq2: Principal component plot'
# xlab: PC1
# ylab: PC2
'''.stripIndent().trim()
pcaHeaderFile.write(pcaHeaderContents)
def clusteringHeaderFile = file("${workDir}/deseq2_clustering_header.txt")
def clusteringHeaderContents = '''
#id: 'deseq2_clustering'
#section_name: 'DESeq2 sample similarity'
#description: "is generated from clustering by Euclidean distances between
# <a href='https://bioconductor.org/packages/release/bioc/html/DESeq2.html' target='_blank'>DESeq2</a>
# rlog values for each sample
# in the <a href='https://github.com/nf-core/rnaseq/blob/master/bin/deseq2_qc.r'><code>deseq2_qc.r</code></a> script."
#plot_type: 'heatmap'
#anchor: 'deseq2_clustering'
#pconfig:
# title: 'DESeq2: Heatmap of the sample-to-sample distances'
# xlab: True
# reverseColors: True
'''.stripIndent().trim()
clusteringHeaderFile.write(clusteringHeaderContents)
input[0] = countFile
input[1] = pcaHeaderFile
input[2] = clusteringHeaderFile
"""
input[0] = file("${moduleTestDir}/data/countFile.tsv")
input[1] = file("${moduleTestDir}/data/deseq2_pca_header.txt")
input[2] = file("${moduleTestDir}/data/deseq2_clustering_header.txt")
""".stripIndent().trim()
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(
process.out.dists_multiqc,
process.out.dists_txt,
process.out.log,
process.out.pca_multiqc,
process.out.pca_txt,
process.out.rdata,
process.out.size_factors
).match() }
)
}

Expand Down
98 changes: 28 additions & 70 deletions modules/local/deseq2_qc/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,81 +1,39 @@
{
"parse count data correctly": {
"content": [
{
"0": [
"deseq2.plots.pdf:md5,066dd6e447a41b6a361b9c9776013b17"
],
"1": [
"deseq2.dds.RData:md5,c7c1872e7566321d0c3f7ca56c463088"
],
"2": [
"deseq2.pca.vals.txt:md5,4cda8e32ec39326c1350e77b4b607aad"
],
"3": [

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

],
"6": [
"R_sessionInfo.log:md5,fb0da0d7ad6994ed66a8e68348b19676"
],
"7": [
[
"RAP1_IAA_30M_REP1.txt:md5,ce4ff0b74aeedc3dc12a764c3504c9df",
"RAP1_UNINDUCED_REP1.txt:md5,51c9b23be5e82670aceb14f7e58dd867",
"RAP1_UNINDUCED_REP2.txt:md5,2c56106abcd9d31980f672b6e2862ee8",
"WT_REP1.txt:md5,5e3fe5f7e9b7f300be43649a8b496352",
"WT_REP2.txt:md5,2ce093f2c2e92c1bde1cd3da91ac884c",
"deseq2.size_factors.RData:md5,51c6643a0f8a9edabbff8df0165451f2"
]
],
"8": [
"versions.yml:md5,60f8e4f473397a4b5d1a3dc490c93ec5"
],
"dists_multiqc": [

],
"dists_txt": [
"deseq2.sample.dists.txt:md5,1616ce40eb58ee75640efed219c6bbec"
],
"log": [
"R_sessionInfo.log:md5,fb0da0d7ad6994ed66a8e68348b19676"
],
"pca_multiqc": [

],
"pca_txt": [
"deseq2.pca.vals.txt:md5,4cda8e32ec39326c1350e77b4b607aad"
],
"pdf": [
"deseq2.plots.pdf:md5,066dd6e447a41b6a361b9c9776013b17"
],
"rdata": [
"deseq2.dds.RData:md5,c7c1872e7566321d0c3f7ca56c463088"
],
"size_factors": [
[
"RAP1_IAA_30M_REP1.txt:md5,ce4ff0b74aeedc3dc12a764c3504c9df",
"RAP1_UNINDUCED_REP1.txt:md5,51c9b23be5e82670aceb14f7e58dd867",
"RAP1_UNINDUCED_REP2.txt:md5,2c56106abcd9d31980f672b6e2862ee8",
"WT_REP1.txt:md5,5e3fe5f7e9b7f300be43649a8b496352",
"WT_REP2.txt:md5,2ce093f2c2e92c1bde1cd3da91ac884c",
"deseq2.size_factors.RData:md5,51c6643a0f8a9edabbff8df0165451f2"
]
],
"versions": [
"versions.yml:md5,60f8e4f473397a4b5d1a3dc490c93ec5"
[

],
[
"deseq2.sample.dists.txt:md5,1616ce40eb58ee75640efed219c6bbec"
],
[
"R_sessionInfo.log:md5,fb0da0d7ad6994ed66a8e68348b19676"
],
[

],
[
"deseq2.pca.vals.txt:md5,4cda8e32ec39326c1350e77b4b607aad"
],
[
"deseq2.dds.RData:md5,c7c1872e7566321d0c3f7ca56c463088"
],
[
[
"RAP1_IAA_30M_REP1.txt:md5,ce4ff0b74aeedc3dc12a764c3504c9df",
"RAP1_UNINDUCED_REP1.txt:md5,51c9b23be5e82670aceb14f7e58dd867",
"RAP1_UNINDUCED_REP2.txt:md5,2c56106abcd9d31980f672b6e2862ee8",
"WT_REP1.txt:md5,5e3fe5f7e9b7f300be43649a8b496352",
"WT_REP2.txt:md5,2ce093f2c2e92c1bde1cd3da91ac884c",
"deseq2.size_factors.RData:md5,51c6643a0f8a9edabbff8df0165451f2"
]
}
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-03-07T11:47:31.43621"
"timestamp": "2024-03-07T12:34:51.582179"
}
}

0 comments on commit ff2ddbc

Please sign in to comment.