@@ -98,7 +98,9 @@ def _validate_pair(self, row):
98
98
"""Assert that read pairs have the same file extension. Report pair status."""
99
99
if row [self ._first_col ] and row [self ._second_col ]:
100
100
row [self ._single_col ] = False
101
- if Path (row [self ._first_col ]).suffixes [- 2 :] != Path (row [self ._second_col ]).suffixes [- 2 :]:
101
+ first_col_suffix = Path (row [self ._first_col ]).suffixes [- 2 :]
102
+ second_col_suffix = Path (row [self ._second_col ]).suffixes [- 2 :]
103
+ if first_col_suffix != second_col_suffix :
102
104
raise AssertionError ("FASTQ pairs must have the same file extensions." )
103
105
else :
104
106
row [self ._single_col ] = True
@@ -157,7 +159,7 @@ def sniff_format(handle):
157
159
handle .seek (0 )
158
160
sniffer = csv .Sniffer ()
159
161
if not sniffer .has_header (peek ):
160
- logger .critical (f "The given sample sheet does not appear to contain a header." )
162
+ logger .critical ("The given sample sheet does not appear to contain a header." )
161
163
sys .exit (1 )
162
164
dialect = sniffer .sniff (peek )
163
165
return dialect
@@ -195,7 +197,8 @@ def check_samplesheet(file_in, file_out):
195
197
reader = csv .DictReader (in_handle , dialect = sniff_format (in_handle ))
196
198
# Validate the existence of the expected header columns.
197
199
if not required_columns .issubset (reader .fieldnames ):
198
- logger .critical (f"The sample sheet **must** contain the column headers: { ', ' .join (required_columns )} ." )
200
+ req_cols = ", " .join (required_columns )
201
+ logger .critical (f"The sample sheet **must** contain these column headers: { req_cols } ." )
199
202
sys .exit (1 )
200
203
# Validate each row.
201
204
checker = RowChecker ()
0 commit comments