Skip to content

Commit ee6b104

Browse files
authored
Merge pull request nf-core#1788 from fabianegli/black-default-compliant
be compliant with black defaults in the pipeline template
2 parents b48be11 + 9d30b2b commit ee6b104

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

nf_core/pipeline-template/bin/check_samplesheet.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def _validate_pair(self, row):
9898
"""Assert that read pairs have the same file extension. Report pair status."""
9999
if row[self._first_col] and row[self._second_col]:
100100
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:
102104
raise AssertionError("FASTQ pairs must have the same file extensions.")
103105
else:
104106
row[self._single_col] = True
@@ -157,7 +159,7 @@ def sniff_format(handle):
157159
handle.seek(0)
158160
sniffer = csv.Sniffer()
159161
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.")
161163
sys.exit(1)
162164
dialect = sniffer.sniff(peek)
163165
return dialect
@@ -195,7 +197,8 @@ def check_samplesheet(file_in, file_out):
195197
reader = csv.DictReader(in_handle, dialect=sniff_format(in_handle))
196198
# Validate the existence of the expected header columns.
197199
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}.")
199202
sys.exit(1)
200203
# Validate each row.
201204
checker = RowChecker()

0 commit comments

Comments
 (0)