Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nschcolnicov committed Oct 15, 2024
1 parent 31b03e1 commit 8c80296
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 36 deletions.
17 changes: 4 additions & 13 deletions modules/nf-core/samshee/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ process SAMSHEE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'docker://community.wave.seqera.io/library/pip_samshee:733e11f3377fc2e3' :
'community.wave.seqera.io/library/pip_samshee:733e11f3377fc2e3' }"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/65/659cdc3068a6fbce17ccb199bb3afc8600c65940743c1a0214b3bf0eed4df1a3/data' :
'community.wave.seqera.io/library/pip_samshee:9b655e3c18eee356' }"

input:
tuple val(meta), path(samplesheet)
val(json_schema_validator) // optional
val(name_schema_validator) // optional
path(file_schema_validator) // optional
path(file_schema_validator)

output:
tuple val(meta), path("*_formatted.csv"), emit: samplesheet
Expand All @@ -21,18 +19,11 @@ process SAMSHEE {
task.ext.when == null || task.ext.when

script:
def arg_json_schema_validator = json_schema_validator ? "--schema '${json_schema_validator}'" : ""
def arg_name_schema_validator = name_schema_validator ? "--schema '${name_schema_validator}'" : ""
def arg_file_schema_validator = file_schema_validator ? "--schema '{\"\$ref\": \"file:${file_schema_validator}\"}'" : ""
def arg_v1_schema = params.v1_schema ? "--output-format sectioned" : ""
def arg_file_schema_validator = file_schema_validator ? "--schema '{\"\$ref\": \"file:${file_schema_validator}\"}'" : ""
def args = task.ext.args ?: ""
"""
# Run validation command and capture output
python -m samshee $samplesheet \
$arg_json_schema_validator \
$arg_name_schema_validator \
$arg_file_schema_validator \
$arg_v1_schema \
$args \
> ${samplesheet.baseName}_formatted.csv
Expand Down
8 changes: 1 addition & 7 deletions modules/nf-core/samshee/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@ input:
type: file
description: "illumina v2 samplesheet"
pattern: "*.{csv}"
- - json_schema_validator:
type: string
description: "String in JSON format used additional samplesheet validation settings"
- - name_schema_validator:
type: string
description: "Schema name used additional samplesheet validation settings"
- - file_schema_validator:
type: string
description: "JSON file used additional samplesheet validation settings"
description: "Optional JSON file used additional samplesheet validation settings"
output:
- samplesheet:
- meta:
Expand Down
9 changes: 2 additions & 7 deletions modules/nf-core/samshee/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nextflow_process {
name "Test Process samshee"
script "../main.nf"
process "SAMSHEE"
config "./nextflow.config"
tag "modules"
tag "modules_nfcore"
tag "samshee"
Expand All @@ -16,9 +17,7 @@ nextflow_process {
process {
"""
input[0] = [ [ id: 'test', lane:1 ], file("https://raw.githubusercontent.com/nf-core/test-datasets/demultiplex/testdata/miseq_35147139/miseq_35147139_samplesheet.csv", checkIfExists: true) ]
input[1] = '{"required": ["Data"]}'
input[2] = []
input[3] = []
input[1] = []
"""
}
}
Expand All @@ -36,8 +35,6 @@ nextflow_process {
"""
input[0] = [ [ id: 'test', lane:1 ], file("https://raw.githubusercontent.com/nf-core/test-datasets/demultiplex/testdata/NextSeq2000/SampleSheet.csv", checkIfExists: true) ]
input[1] = []
input[2] = '{"\$ref": "urn:samshee:illuminav2/v1"}'
input[3] = []
"""
}
}
Expand All @@ -58,8 +55,6 @@ nextflow_process {
"""
input[0] = [ [ id: 'test', lane:1 ], file("https://raw.githubusercontent.com/nf-core/test-datasets/demultiplex/testdata/NextSeq2000/SampleSheet.csv", checkIfExists: true), [] ]
input[1] = []
input[2] = []
input[3] = []
"""
}
}
Expand Down
18 changes: 9 additions & 9 deletions modules/nf-core/samshee/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]
],
"1": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
],
"samplesheet": [
[
Expand All @@ -24,15 +24,15 @@
]
],
"versions": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-10T19:18:20.176809754"
"timestamp": "2024-10-15T12:33:58.766224702"
},
"test samplesheet_v1": {
"content": [
Expand All @@ -47,7 +47,7 @@
]
],
"1": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
],
"samplesheet": [
[
Expand All @@ -59,15 +59,15 @@
]
],
"versions": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-10T19:17:58.422458873"
"timestamp": "2024-10-15T12:30:57.470221349"
},
"test samplesheet_v2": {
"content": [
Expand All @@ -82,7 +82,7 @@
]
],
"1": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
],
"samplesheet": [
[
Expand All @@ -94,14 +94,14 @@
]
],
"versions": [
"versions.yml:md5,8fbb7f500f23ab9ecff6ad5b9f15f14a"
"versions.yml:md5,77af0194d386117bf52aaabdf350a976"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-10-10T19:18:08.736465443"
"timestamp": "2024-10-15T12:31:16.99133356"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/samshee/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: SAMSHEE {
ext.args = { params.v1_schema ? "--output-format sectioned" : "" }
}
}

0 comments on commit 8c80296

Please sign in to comment.