From 2e7f26f380246ade93c56e50f5611fb8f0643b60 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Tue, 14 Jun 2022 20:09:48 +0000 Subject: [PATCH] Replace header tuple with sub-set list of only relevant columns for sample checking --- bin/check_samplesheet.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index d7ea5a9..4e80b46 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -99,9 +99,17 @@ def check_samplesheet(file_in, file_out): ) sys.exit(1) + ## Find locations of mandatory columns + header_locs = dict() + for i in HEADER: + header_locs[i] = header.index(i) + ## Check sample entries for line in fin: - lspl = [x.strip().strip('"') for x in line.strip().split(",")] + + ## Pull out only relevant columns for downstream checking + line_parsed = [x.strip().strip('"') for x in line.strip().split(",")] + lspl = [line_parsed[i] for i in header_locs.values()] # Check valid number of columns per row if len(lspl) < len(HEADER): @@ -121,6 +129,7 @@ def check_samplesheet(file_in, file_out): ) ## Check sample name entries + ( sample, run_accession,