Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mirtop collapse nftest #382

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [[#369]](https://github.com/nf-core/smrnaseq/issues/369) - Fix [Linting](https://github.com/nf-core/smrnaseq/pull/377) - Fixed linting warnings and updated modules & subworkflows.
- [[#374]](https://github.com/nf-core/smrnaseq/pull/374) - Fix [default tests](https://github.com/nf-core/smrnaseq/issues/375) so that they do not require additional profiles in CI. Change GitHub CI fail-fast strategy to false.
- [[#371]](https://github.com/nf-core/smrnaseq/issues/371) - Fix [Plain test profile](https://github.com/nf-core/smrnaseq/pull/372) - Updated default protocol value to "custom".
- [[#187]](https://github.com/nf-core/smrnaseq/issues/187) - Fix checking number of samples which causes error in plotMDS.
- [[#380]](https://github.com/nf-core/smrnaseq/pull/380) - Fix checking number of samples which causes error in plotMDS. Add nf-tests for local modules using custom R scripts: [edgeR_mirBase.R](https://github.com/nf-core/smrnaseq/issues/187).
- [[#378]](https://github.com/nf-core/smrnaseq/pull/378) - Fix [`--mirtrace_species` bug](<(https://github.com/nf-core/smrnaseq/issues/348)>). Make `MIRTRACE` process conditional. Add mirgenedb test.
- [[#375]](https://github.com/nf-core/smrnaseq/pull/375) - Test merging of [technical repeats](https://github.com/nf-core/smrnaseq/issues/212).
- [[#382]](https://github.com/nf-core/smrnaseq/pull/382) - Add nf-tests for local modules using custom R scripts: [collapse_mirtop.R](https://github.com/nf-core/smrnaseq/issues/174).

## v2.3.1 - 2024-04-18 - Gray Zinc Dalmation Patch

Expand Down
71 changes: 71 additions & 0 deletions modules/local/datatable_merge/tests/datatable_merge.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
nextflow_process {

name "Test Process TABLE_MERGE"
script "../datatable_merge.nf"
process "TABLE_MERGE"
tag "modules"
tag "modules_local"
tag "table_merge"

test("Contains hsa-miR-365b-3p, hsa-miR-7-5p, hsa-miR-103a-3p") {

when {
params {
outdir = "${outputDir}"
}
process {
"""
input[0] = [file("https://github.com/nf-core/test-datasets/raw/smrnaseq/nf-test_data/datatable_merge/small_mirtop_dataset.txt", checkIfExists: true)]
"""
}
}

then {
assert process.success
assert snapshot(process.out).match()

with(process.out.mirna_tsv) {
with(get(0)) {
assert get(0).endsWith(".tsv")

// Check for specific miRNAs
def lines = path(get(0)).readLines()
assert lines.any { it.contains("hsa-miR-365b-3p") }
assert lines.any { it.contains("hsa-miR-7-5p") }
assert lines.any { it.contains("hsa-miR-103a-3p") }
}
}
}
}

test("Does not contain hsa-miR-107, hsa-miR-365a-3p") {

when {
params {
outdir = "${outputDir}"
}
process {
"""
input[0] = [file("https://github.com/nf-core/test-datasets/raw/smrnaseq/nf-test_data/datatable_merge/small_mirtop_dataset.txt", checkIfExists: true)]
"""
}
}

then {
assert process.success
assert snapshot(process.out).match()

with(process.out.mirna_tsv) {
with(get(0)) {
assert get(0).endsWith(".tsv")

// Check for the absence of specific miRNAs
def lines = path(get(0)).readLines()
assert !lines.any { it.contains("hsa-miR-107") }
assert !lines.any { it.contains("hsa-miR-365a-3p") }
}
}
}
}

}
48 changes: 48 additions & 0 deletions modules/local/datatable_merge/tests/datatable_merge.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"Contains hsa-miR-365b-3p, hsa-miR-7-5p, hsa-miR-103a-3p": {
"content": [
{
"0": [
"mirna.tsv:md5,f59a6aeb15588c43c2977950a1b0a080"
],
"1": [
"versions.yml:md5,3a8ba7faff9d6dadf80e1a1b026acbe1"
],
"mirna_tsv": [
"mirna.tsv:md5,f59a6aeb15588c43c2977950a1b0a080"
],
"versions": [
"versions.yml:md5,3a8ba7faff9d6dadf80e1a1b026acbe1"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-21T14:27:11.151441241"
},
"Does not contain hsa-miR-107, hsa-miR-365a-3p": {
"content": [
{
"0": [
"mirna.tsv:md5,f59a6aeb15588c43c2977950a1b0a080"
],
"1": [
"versions.yml:md5,3a8ba7faff9d6dadf80e1a1b026acbe1"
],
"mirna_tsv": [
"mirna.tsv:md5,f59a6aeb15588c43c2977950a1b0a080"
],
"versions": [
"versions.yml:md5,3a8ba7faff9d6dadf80e1a1b026acbe1"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-21T14:27:39.584509005"
}
}
2 changes: 1 addition & 1 deletion subworkflows/local/mirna_quant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include { BAM_SORT_STATS_SAMTOOLS as BAM_STATS_MATURE

include { SEQCLUSTER_SEQUENCES } from '../../modules/local/seqcluster_collapse.nf'
include { MIRTOP_QUANT } from '../../modules/local/mirtop_quant.nf'
include { TABLE_MERGE } from '../../modules/local/datatable_merge.nf'
include { TABLE_MERGE } from '../../modules/local/datatable_merge/datatable_merge.nf'
include { EDGER_QC } from '../../modules/local/edger_qc/edger_qc.nf'

workflow MIRNA_QUANT {
Expand Down