1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 03:59:55 +00:00

Apply suggestions from code review

Co-authored-by: Moritz E. Beber <midnighter@posteo.net>
This commit is contained in:
James A. Fellows Yates 2022-12-20 13:56:01 +01:00 committed by GitHub
parent 11db981a88
commit 41063bc670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,16 +104,15 @@ def check_samplesheet(file_in, file_out):
## Pull out only relevant columns for downstream checking ## Pull out only relevant columns for downstream checking
line_parsed = [x.strip().strip('"') for x in line.strip().split(",")] 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(line_parsed) < len(HEADER):
print_error( print_error(
"Invalid number of columns (minimum = {})!".format(len(HEADER)), "Invalid number of columns (minimum = {})!".format(len(HEADER)),
"Line", "Line",
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: if num_cols < MIN_COLS:
print_error( print_error(
"Invalid number of populated columns (minimum = {})!".format(MIN_COLS), "Invalid number of populated columns (minimum = {})!".format(MIN_COLS),
@ -121,6 +120,8 @@ def check_samplesheet(file_in, file_out):
line, line,
) )
lspl = [line_parsed[i] for i in header_locs.values()]
## Check sample name entries ## Check sample name entries
( (
@ -169,7 +170,7 @@ def check_samplesheet(file_in, file_out):
else: else:
if instrument_platform not in INSTRUMENT_PLATFORMS: if instrument_platform not in INSTRUMENT_PLATFORMS:
print_error( 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)}", f"List of supported platforms {', '.join(INSTRUMENT_PLATFORMS)}",
"Line", "Line",
line, line,