Commit 05e328f6 authored by Chris Cheshire's avatar Chris Cheshire
Browse files

test

parent d197e3d3
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
@@ -29,27 +29,3 @@ process SAMPLESHEET_CHECK {
    check_samplesheet.py $samplesheet samplesheet.valid.csv $params.igg_control
    """
}

// Function to get list of [ meta, [ fastq_1, fastq_2 ] ]
def get_samplesheet_paths(LinkedHashMap row) {
    def meta = [:]
    meta.id            = row.id
    meta.group         = row.group
    meta.replicate     = row.replicate.toInteger()
    meta.control_group = row.control_group.toInteger()
    meta.single_end    = row.single_end.toBoolean()

    def array = []
    if (!file(row.fastq_1).exists()) {
        exit 1, "ERROR: Please check input samplesheet -> Read 1 FastQ file does not exist!\n${row.fastq_1}"
    }
    if (meta.single_end) {
        array = [ meta, [ file(row.fastq_1) ] ]
    } else {
        if (!file(row.fastq_2).exists()) {
            exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
        }
        array = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
    }
    return array
}
+2 −2
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@

params.options = [:]

include {get_samplesheet_paths  } from "./test"
include {SAMPLESHEET_CHECK  } from "../../modules/local/python/samplesheet_check" addParams( options: params.options )
include { get_samplesheet_paths } from "../../modules/local/python/samplesheet_check" addParams( options: params.options )

workflow INPUT_CHECK {
    take:
+23 −0
Original line number Diff line number Diff line
// Function to get list of [ meta, [ fastq_1, fastq_2 ] ]
def get_samplesheet_paths(LinkedHashMap row) {
    def meta = [:]
    meta.id            = row.id
    meta.group         = row.group
    meta.replicate     = row.replicate.toInteger()
    meta.control_group = row.control_group.toInteger()
    meta.single_end    = row.single_end.toBoolean()

    def array = []
    if (!file(row.fastq_1).exists()) {
        exit 1, "ERROR: Please check input samplesheet -> Read 1 FastQ file does not exist!\n${row.fastq_1}"
    }
    if (meta.single_end) {
        array = [ meta, [ file(row.fastq_1) ] ]
    } else {
        if (!file(row.fastq_2).exists()) {
            exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
        }
        array = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
    }
    return array
}
 No newline at end of file