1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-24 02:49:56 +00:00

Replace header tuple with sub-set list of only relevant columns for sample checking

This commit is contained in:
James A. Fellows Yates 2022-06-14 20:09:48 +00:00
parent c1a7d6335f
commit 2e7f26f380

View file

@ -99,9 +99,17 @@ def check_samplesheet(file_in, file_out):
) )
sys.exit(1) sys.exit(1)
## Find locations of mandatory columns
header_locs = dict()
for i in HEADER:
header_locs[i] = header.index(i)
## Check sample entries ## Check sample entries
for line in fin: 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 # Check valid number of columns per row
if len(lspl) < len(HEADER): if len(lspl) < len(HEADER):
@ -121,6 +129,7 @@ def check_samplesheet(file_in, file_out):
) )
## Check sample name entries ## Check sample name entries
( (
sample, sample,
run_accession, run_accession,