Skip to content

Commit

Permalink
Updated main.nf.test to include tests for various sample_name scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
kylacochrane committed Aug 12, 2024
1 parent cc6a23d commit 5dd474e
Show file tree
Hide file tree
Showing 5 changed files with 338 additions and 72 deletions.
5 changes: 2 additions & 3 deletions assets/samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sample,sample_name,fastq_1,fastq_2
SAMPLE1,A1 sample,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R2.fastq.gz
SAMPLE1,A1,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R2.fastq.gz
SAMPLE2,B2,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R2.fastq.gz
SAMPLE3,B2,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
SAMPLE4,,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
SAMPLE3,C3,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
167 changes: 167 additions & 0 deletions tests/data/samplename.test_iridanext.output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"files": {
"global": [
{
"path": "failure/failures_report.csv"
}
],
"samples": {
"SAMPLE2": [
{
"path": "krona/B2_.krona.html"
},
{
"path": "adjust/B2__S_bracken_abundances.csv"
},
{
"path": "fastp/B2_.fastp.html"
}
],
"SAMPLE3": [
{
"path": "krona/B2__SAMPLE3.krona.html"
},
{
"path": "adjust/B2__SAMPLE3_S_bracken_abundances.csv"
},
{
"path": "fastp/B2__SAMPLE3.fastp.html"
}
],
"SAMPLE4": [
{
"path": "krona/SAMPLE4.krona.html"
},
{
"path": "adjust/SAMPLE4_S_bracken_abundances.csv"
},
{
"path": "fastp/SAMPLE4.fastp.html"
}
],
"SAMPLE1": [
{
"path": "krona/A1__sample1.krona.html"
},
{
"path": "adjust/A1__sample1_S_bracken_abundances.csv"
},
{
"path": "fastp/A1__sample1.fastp.html"
}
]
}
},
"metadata": {
"samples": {
"SAMPLE4": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
"abundance_1_ncbi_taxonomy_id": "817",
"abundance_1_num_assigned_reads": "28877",
"abundance_1_fraction_total_reads": "0.577702",
"abundance_2_name": "Escherichia coli",
"abundance_2_ncbi_taxonomy_id": "562",
"abundance_2_num_assigned_reads": "21065",
"abundance_2_fraction_total_reads": "0.421418",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
"abundance_3_fraction_total_reads": "",
"abundance_4_name": "",
"abundance_4_ncbi_taxonomy_id": "",
"abundance_4_num_assigned_reads": "",
"abundance_4_fraction_total_reads": "",
"abundance_5_name": "",
"abundance_5_ncbi_taxonomy_id": "",
"abundance_5_num_assigned_reads": "",
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "44",
"unclassified_fraction_total_reads": "0.00088"
},
"SAMPLE2": {
"taxonomy_level": "S",
"abundance_1_name": "Escherichia coli",
"abundance_1_ncbi_taxonomy_id": "562",
"abundance_1_num_assigned_reads": "631",
"abundance_1_fraction_total_reads": "0.025253",
"abundance_2_name": "Bacteroides fragilis",
"abundance_2_ncbi_taxonomy_id": "817",
"abundance_2_num_assigned_reads": "22",
"abundance_2_fraction_total_reads": "0.00088",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
"abundance_3_fraction_total_reads": "",
"abundance_4_name": "",
"abundance_4_ncbi_taxonomy_id": "",
"abundance_4_num_assigned_reads": "",
"abundance_4_fraction_total_reads": "",
"abundance_5_name": "",
"abundance_5_ncbi_taxonomy_id": "",
"abundance_5_num_assigned_reads": "",
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "24334",
"unclassified_fraction_total_reads": "0.973866"
},
"SAMPLE3": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
"abundance_1_ncbi_taxonomy_id": "817",
"abundance_1_num_assigned_reads": "28877",
"abundance_1_fraction_total_reads": "0.577702",
"abundance_2_name": "Escherichia coli",
"abundance_2_ncbi_taxonomy_id": "562",
"abundance_2_num_assigned_reads": "21065",
"abundance_2_fraction_total_reads": "0.421418",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
"abundance_3_fraction_total_reads": "",
"abundance_4_name": "",
"abundance_4_ncbi_taxonomy_id": "",
"abundance_4_num_assigned_reads": "",
"abundance_4_fraction_total_reads": "",
"abundance_5_name": "",
"abundance_5_ncbi_taxonomy_id": "",
"abundance_5_num_assigned_reads": "",
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "44",
"unclassified_fraction_total_reads": "0.00088"
},
"SAMPLE1": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
"abundance_1_ncbi_taxonomy_id": "817",
"abundance_1_num_assigned_reads": "28799",
"abundance_1_fraction_total_reads": "0.578328",
"abundance_2_name": "Escherichia coli",
"abundance_2_ncbi_taxonomy_id": "562",
"abundance_2_num_assigned_reads": "20997",
"abundance_2_fraction_total_reads": "0.421652",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
"abundance_3_fraction_total_reads": "",
"abundance_4_name": "",
"abundance_4_ncbi_taxonomy_id": "",
"abundance_4_num_assigned_reads": "",
"abundance_4_fraction_total_reads": "",
"abundance_5_name": "",
"abundance_5_ncbi_taxonomy_id": "",
"abundance_5_num_assigned_reads": "",
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "1",
"unclassified_fraction_total_reads": "2e-05"
}
}
}
}
5 changes: 5 additions & 0 deletions tests/data/samplename_samplesheet.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sample,sample_name,fastq_1,fastq_2
SAMPLE1,A1@ sample1,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R2.fastq.gz
SAMPLE2,B2@,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R1.fastq.gz,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_sample2_R2.fastq.gz
SAMPLE3,B2#,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
SAMPLE4,,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
78 changes: 20 additions & 58 deletions tests/data/test_iridanext.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@
}
],
"samples": {
"SAMPLE3": [
{
"path": "krona/B2_SAMPLE3.krona.html"
},
{
"path": "adjust/B2_SAMPLE3_S_bracken_abundances.csv"
},
{
"path": "fastp/B2_SAMPLE3.fastp.html"
}
],
"SAMPLE4": [
"SAMPLE1": [
{
"path": "krona/SAMPLE4.krona.html"
"path": "krona/A1.krona.html"
},
{
"path": "adjust/SAMPLE4_S_bracken_abundances.csv"
"path": "adjust/A1_S_bracken_abundances.csv"
},
{
"path": "fastp/SAMPLE4.fastp.html"
"path": "fastp/A1.fastp.html"
}
],
"SAMPLE2": [
Expand All @@ -39,31 +28,31 @@
"path": "fastp/B2.fastp.html"
}
],
"SAMPLE1": [
"SAMPLE3": [
{
"path": "krona/A1_sample.krona.html"
"path": "krona/C3.krona.html"
},
{
"path": "adjust/A1_sample_S_bracken_abundances.csv"
"path": "adjust/C3_S_bracken_abundances.csv"
},
{
"path": "fastp/A1_sample.fastp.html"
"path": "fastp/C3.fastp.html"
}
]
}
},
"metadata": {
"samples": {
"SAMPLE3": {
"SAMPLE2": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
"abundance_1_ncbi_taxonomy_id": "817",
"abundance_1_num_assigned_reads": "28877",
"abundance_1_fraction_total_reads": "0.577702",
"abundance_2_name": "Escherichia coli",
"abundance_2_ncbi_taxonomy_id": "562",
"abundance_2_num_assigned_reads": "21065",
"abundance_2_fraction_total_reads": "0.421418",
"abundance_1_name": "Escherichia coli",
"abundance_1_ncbi_taxonomy_id": "562",
"abundance_1_num_assigned_reads": "631",
"abundance_1_fraction_total_reads": "0.025253",
"abundance_2_name": "Bacteroides fragilis",
"abundance_2_ncbi_taxonomy_id": "817",
"abundance_2_num_assigned_reads": "22",
"abundance_2_fraction_total_reads": "0.00088",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
Expand All @@ -78,10 +67,10 @@
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "44",
"unclassified_fraction_total_reads": "0.00088"
"unclassified_num_assigned_reads": "24334",
"unclassified_fraction_total_reads": "0.973866"
},
"SAMPLE4": {
"SAMPLE3": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
"abundance_1_ncbi_taxonomy_id": "817",
Expand All @@ -108,33 +97,6 @@
"unclassified_num_assigned_reads": "44",
"unclassified_fraction_total_reads": "0.00088"
},
"SAMPLE2": {
"taxonomy_level": "S",
"abundance_1_name": "Escherichia coli",
"abundance_1_ncbi_taxonomy_id": "562",
"abundance_1_num_assigned_reads": "631",
"abundance_1_fraction_total_reads": "0.025253",
"abundance_2_name": "Bacteroides fragilis",
"abundance_2_ncbi_taxonomy_id": "817",
"abundance_2_num_assigned_reads": "22",
"abundance_2_fraction_total_reads": "0.00088",
"abundance_3_name": "",
"abundance_3_ncbi_taxonomy_id": "",
"abundance_3_num_assigned_reads": "",
"abundance_3_fraction_total_reads": "",
"abundance_4_name": "",
"abundance_4_ncbi_taxonomy_id": "",
"abundance_4_num_assigned_reads": "",
"abundance_4_fraction_total_reads": "",
"abundance_5_name": "",
"abundance_5_ncbi_taxonomy_id": "",
"abundance_5_num_assigned_reads": "",
"abundance_5_fraction_total_reads": "",
"unclassified_name": "unclassified",
"unclassified_ncbi_taxonomy_id": "0",
"unclassified_num_assigned_reads": "24334",
"unclassified_fraction_total_reads": "0.973866"
},
"SAMPLE1": {
"taxonomy_level": "S",
"abundance_1_name": "Bacteroides fragilis",
Expand Down
Loading

0 comments on commit 5dd474e

Please sign in to comment.