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

Enhanced pipeline logic to support user-defined sample_name input #24

Merged
merged 15 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
19 changes: 9 additions & 10 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Set up Python 3.11
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
- name: Set up Python 3.12
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: 3.11
cache: "pip"
python-version: "3.12"

- name: Install pre-commit
run: pip install pre-commit
Expand All @@ -32,14 +31,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
uses: nf-core/setup-nextflow@v2

- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: "3.11"
python-version: "3.12"
architecture: "x64"

- name: Install dependencies
Expand All @@ -60,7 +59,7 @@ jobs:

- name: Upload linting log file artifact
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
name: linting-logs
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download lint results
uses: dawidd6/action-download-artifact@f6b0bace624032e30a85a8fd9c1a7f8f611f5737 # v3
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3
with:
workflow: linting.yml
workflow_conclusion: completed
Expand Down
8 changes: 4 additions & 4 deletions assets/samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sample,fastq_1,fastq_2
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,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,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
sample,sample_name,fastq_1,fastq_2
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,C3,https://github.com/nf-core/test-datasets/raw/mag/test_data/test_minigut_R1.fastq.gz,
7 changes: 6 additions & 1 deletion assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
"sample": {
"type": "string",
"pattern": "^\\S+$",
"meta": ["id"],
"meta": ["irida_id"],
"unique": true,
"errorMessage": "Sample name must be provided and cannot contain spaces"
},
"sample_name": {
"type": "string",
"meta": ["id"],
"errorMessage": "Sample name must be provided"
},
emarinier marked this conversation as resolved.
Show resolved Hide resolved
"fastq_1": {
"type": "string",
"pattern": "^\\S+\\.f(ast)?q(\\.gz)?$",
Expand Down
1 change: 1 addition & 0 deletions conf/iridanext.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ iridanext {
path = "${params.outdir}/iridanext.output.json.gz"
overwrite = true
files {
idkey = "irida_id"
global = [
"**/failure/failures_report.csv"
]
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ params {
max_time = '1.h'

// Input data
input = 'https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/assets/samplesheet.csv'
input = "${projectDir}/assets/samplesheet.csv"
database = "${projectDir}/tests/data/minidb"
}
2 changes: 1 addition & 1 deletion modules/local/topN/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ process TOP_N {
${abundances} \\
${args} \\
-n ${top_n} \\
-s ${meta.id} \\
-s ${meta.irida_id} \\
apetkau marked this conversation as resolved.
Show resolved Hide resolved
> ${meta.id}_${taxonomic_level}_top_${top_n}.csv

cat <<-END_VERSIONS > versions.yml
Expand Down
10 changes: 5 additions & 5 deletions tests/data/error_samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sample,fastq_1,fastq_2
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_sample2_R2.fastq.gz
SAMPLE2,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-kraken_R1_001.fastq.gz,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-kraken_R2_001.fastq.gz
SAMPLE3,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-bracken_R1_001.fastq.gz,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-bracken_R2_001.fastq.gz
SAMPLE4,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
sample,sample_name,fastq_1,fastq_2
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_sample2_R2.fastq.gz
SAMPLE2,B2,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-kraken_R1_001.fastq.gz,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-kraken_R2_001.fastq.gz
SAMPLE3,C3,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-bracken_R1_001.fastq.gz,https://raw.githubusercontent.com/phac-nml/speciesabundance/dev/tests/data/fastq/test-bracken_R2_001.fastq.gz
SAMPLE4,D4,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
4 changes: 2 additions & 2 deletions tests/data/fail_samplesheet.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sample,fastq_1,fastq_2
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_sample2_R2.fastq.gz
sample,sample_name,fastq_1,fastq_2
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_sample2_R2.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,
Loading
Loading