mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-12-22 10:08:17 +00:00
Apply suggestions from code review
Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
This commit is contained in:
parent
11db981a88
commit
41063bc670
1 changed files with 5 additions and 4 deletions
|
@ -104,22 +104,23 @@ def check_samplesheet(file_in, file_out):
|
|||
|
||||
## 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):
|
||||
if len(line_parsed) < len(HEADER):
|
||||
print_error(
|
||||
"Invalid number of columns (minimum = {})!".format(len(HEADER)),
|
||||
"Line",
|
||||
line,
|
||||
)
|
||||
num_cols = len([x for x in lspl if x])
|
||||
num_cols = len([x for x in line_parsed if x])
|
||||
if num_cols < MIN_COLS:
|
||||
print_error(
|
||||
"Invalid number of populated columns (minimum = {})!".format(MIN_COLS),
|
||||
"Line",
|
||||
line,
|
||||
)
|
||||
|
||||
lspl = [line_parsed[i] for i in header_locs.values()]
|
||||
|
||||
## Check sample name entries
|
||||
|
||||
|
@ -169,7 +170,7 @@ def check_samplesheet(file_in, file_out):
|
|||
else:
|
||||
if instrument_platform not in INSTRUMENT_PLATFORMS:
|
||||
print_error(
|
||||
f"Instrument platform {instrument_platform} is not supported!",
|
||||
f"Instrument platform {instrument_platform} is not supported! "
|
||||
f"List of supported platforms {', '.join(INSTRUMENT_PLATFORMS)}",
|
||||
"Line",
|
||||
line,
|
||||
|
|
Loading…
Reference in a new issue