Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
hic
Commits
0fb3c263
Commit
0fb3c263
authored
2 years ago
by
nf-core-bot
Browse files
Options
Downloads
Patches
Plain Diff
Template update for nf-core/tools version 2.5.1
parent
f56fe092
Branches
nf-core-template-merge-2.5.1
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/check_samplesheet.py
+6
-3
6 additions, 3 deletions
bin/check_samplesheet.py
pyproject.toml
+10
-0
10 additions, 0 deletions
pyproject.toml
with
16 additions
and
3 deletions
bin/check_samplesheet.py
+
6
−
3
View file @
0fb3c263
...
...
@@ -98,7 +98,9 @@ class RowChecker:
"""
Assert that read pairs have the same file extension. Report pair status.
"""
if
row
[
self
.
_first_col
]
and
row
[
self
.
_second_col
]:
row
[
self
.
_single_col
]
=
False
if
Path
(
row
[
self
.
_first_col
]).
suffixes
[
-
2
:]
!=
Path
(
row
[
self
.
_second_col
]).
suffixes
[
-
2
:]:
first_col_suffix
=
Path
(
row
[
self
.
_first_col
]).
suffixes
[
-
2
:]
second_col_suffix
=
Path
(
row
[
self
.
_second_col
]).
suffixes
[
-
2
:]
if
first_col_suffix
!=
second_col_suffix
:
raise
AssertionError
(
"
FASTQ pairs must have the same file extensions.
"
)
else
:
row
[
self
.
_single_col
]
=
True
...
...
@@ -157,7 +159,7 @@ def sniff_format(handle):
handle
.
seek
(
0
)
sniffer
=
csv
.
Sniffer
()
if
not
sniffer
.
has_header
(
peek
):
logger
.
critical
(
f
"
The given sample sheet does not appear to contain a header.
"
)
logger
.
critical
(
"
The given sample sheet does not appear to contain a header.
"
)
sys
.
exit
(
1
)
dialect
=
sniffer
.
sniff
(
peek
)
return
dialect
...
...
@@ -195,7 +197,8 @@ def check_samplesheet(file_in, file_out):
reader
=
csv
.
DictReader
(
in_handle
,
dialect
=
sniff_format
(
in_handle
))
# Validate the existence of the expected header columns.
if
not
required_columns
.
issubset
(
reader
.
fieldnames
):
logger
.
critical
(
f
"
The sample sheet **must** contain the column headers:
{
'
,
'
.
join
(
required_columns
)
}
.
"
)
req_cols
=
"
,
"
.
join
(
required_columns
)
logger
.
critical
(
f
"
The sample sheet **must** contain these column headers:
{
req_cols
}
.
"
)
sys
.
exit
(
1
)
# Validate each row.
checker
=
RowChecker
()
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
0 → 100644
+
10
−
0
View file @
0fb3c263
# Config file for Python. Mostly used to configure linting of bin/check_samplesheet.py with Black.
# Should be kept the same as nf-core/tools to avoid fighting with template synchronisation.
[tool.black]
line-length
=
120
target_version
=
[
"py37"
,
"py38"
,
"py39"
,
"py310"
]
[tool.isort]
profile
=
"black"
known_first_party
=
[
"nf_core"
]
multi_line_output
=
3
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment