Skip to content

Commit

Permalink
added nf-validation to check for most file existence
Browse files Browse the repository at this point in the history
  • Loading branch information
RobJY committed May 7, 2024
1 parent 111414b commit d441175
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion assets/schema_input_cycle.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@
},
"image_tiles": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+$",
"errorMessage": "Need to provide a path to a directory containing image files"
"exists": true,
"errorMessage": "Need to provide a path to image file(s)"
},
"dfp": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+$",
"exists": true,
"errorMessage": "provide path to dfp illumination correction file(s) if illumination parameter is manual"
},
"ffp": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+$",
"exists": true,
"errorMessage": "provide path to ffp illumination correction file(s) if illumination parameter is manual"
}
},
Expand Down
4 changes: 4 additions & 0 deletions assets/schema_input_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
},
"dfp": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+$",
"exists": true,
"errorMessage": "provide path to dfp illumination correction file(s) if illumination parameter is manual"
},
"ffp": {
"type": "string",
"format": "file-path",
"pattern": "^\\S+$",
"exists": true,
"errorMessage": "provide path to ffp illumination correction file(s) if illumination parameter is manual"
}
},
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def validateInputSamplesheetRow ( row, mode ) {
if (row.size() >= 3 && row[2] != []) {
def file_list = row[2].split(" ")
file_list.each { curr_file ->
def curr_path = new File(row[1].toString() + "/" + curr_file)
def curr_path = file(row[1].toString() + "/" + curr_file)
if (!curr_path.exists()) {
error("Error: file in samplesheet not found: $curr_path")
}
Expand Down Expand Up @@ -317,7 +317,7 @@ def make_ashlar_input_sample( samplesheet_row ) {
}
cycle_images = samplesheet_row[index_sample_cycle_images].split(' ').collect{ "${tmp_path}${it}" }
cycle_images.each{ file_path ->
def file_test = new File(file_path)
def file_test = file(file_path)
if (!file_test.exists()) {
Nextflow.error("Error: ${file_path} does not exist!")
}
Expand Down

0 comments on commit d441175

Please sign in to comment.