mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-24 05:59:55 +00:00
Replace header tuple with sub-set list of only relevant columns for sample checking
This commit is contained in:
parent
c1a7d6335f
commit
2e7f26f380
1 changed files with 10 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue