Skip to content

Commit

Permalink
added sample sheet cycle_number validation
Browse files Browse the repository at this point in the history
  • Loading branch information
RobJY committed Dec 4, 2024
1 parent ea89f60 commit adbec63
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions subworkflows/local/utils_nfcore_mcmicro_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,19 @@ def validateInputSamplesheetMarkersheet ( samples, markers ) {
if (marker_cycles.unique(false) != sample_cycles.unique(false) ) {
error("cycle_number values must match between sample and marker sheets")
}

// TODO: should the following test be in a separate validateInputSamplesheet() function?

def channel_cycle_map = samples.collect{ meta, image_tiles, dfp, ffp -> [meta.id,meta.cycle_number] }.groupBy{ it[0] }
channel_cycle_map.each { entry ->
last_val = -1
entry.value.collect{ it[1] }.each{ curr_val ->
if (last_val != -1 && (curr_val > (last_val + 1) || curr_val <= last_val)) {
error("cycle_number values must be increasing with no gaps")
}
last_val = curr_val
}
}
}

def expandSampleRow( row ) {
Expand Down

0 comments on commit adbec63

Please sign in to comment.