Skip to content

Commit

Permalink
Support input read-sets being paired-end
Browse files Browse the repository at this point in the history
  • Loading branch information
muffato committed Jan 12, 2024
1 parent 363d796 commit 74b60dd
Show file tree
Hide file tree
Showing 11 changed files with 457 additions and 3 deletions.
8 changes: 7 additions & 1 deletion bin/check_fetchngs_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(
platform_col="instrument_platform",
library_col="library_strategy",
file1_col="fastq_1",
file2_col="fastq_2",
**kwargs,
):
"""
Expand All @@ -49,13 +50,16 @@ def __init__(
of the instrument (default "instrument_platform").
library_col (str): The name of the column that contains the strategy of the
preparation of the library (default "library_strategy").
file2_col (str): The name of the column that contains the second file path
for the paired-end read data (default "fastq_2").
"""
super().__init__(**kwargs)
self._accession_col = accession_col
self._model_col = model_col
self._platform_col = platform_col
self._library_col = library_col
self._file1_col = file1_col
self._file2_col = file2_col
self._seen = set()
self.modified = []

Expand Down Expand Up @@ -83,6 +87,8 @@ def _validate_file(self, row):
if len(row[self._file1_col]) <= 0:
raise AssertionError("Data file is required.")
self._validate_data_format(row[self._file1_col])
if row[self._file2_col]:
self._validate_data_format(row[self._file2_col])

def _validate_data_format(self, filename):
"""Assert that a given filename has one of the expected FASTQ extensions."""
Expand Down Expand Up @@ -165,7 +171,7 @@ def check_samplesheet(file_in, file_out):
https://raw.githubusercontent.com/sanger-tol/blobtoolkit/main/assets/test/samplesheet.csv
"""
required_columns = {"run_accession", "instrument_model", "instrument_platform", "library_strategy", "fastq_1"}
required_columns = {"run_accession", "instrument_model", "instrument_platform", "library_strategy", "fastq_1", "fastq_2"}
# See https://docs.python.org/3.9/library/csv.html#id3 to read up on `newline=""`.
with file_in.open(newline="") as in_handle:
reader = csv.DictReader(in_handle, dialect=sniff_format(in_handle))
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"installed_by": ["modules"],
"patch": "modules/nf-core/busco/busco.diff"
},
"cat/cat": {
"branch": "master",
"git_sha": "d593e8f6b7d1bbbb2acf43a4b9efeeac8d6720f2",
"installed_by": ["modules"]
},
"custom/dumpsoftwareversions": {
"branch": "master",
"git_sha": "bba7e362e4afead70653f84d8700588ea28d0f9e",
Expand Down
7 changes: 7 additions & 0 deletions modules/nf-core/cat/cat/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions modules/nf-core/cat/cat/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions modules/nf-core/cat/cat/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

179 changes: 179 additions & 0 deletions modules/nf-core/cat/cat/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74b60dd

Please sign in to comment.