-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Important! Template update for nf-core/tools v2.5 #718
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use `nf-core tools` in your work, please cite the `nf-core` publication" | ||
authors: | ||
- family-names: Ewels | ||
given-names: Philip | ||
- family-names: Peltzer | ||
given-names: Alexander | ||
- family-names: Fillinger | ||
given-names: Sven | ||
- family-names: Patel | ||
given-names: Harshil | ||
- family-names: Alneberg | ||
given-names: Johannes | ||
- family-names: Wilm | ||
given-names: Andreas | ||
- family-names: Ulysse Garcia | ||
given-names: Maxime | ||
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, that's not my family name... |
||
- family-names: Di Tommaso | ||
given-names: Paolo | ||
- family-names: Nahnsen | ||
given-names: Sven | ||
title: "The nf-core framework for community-curated bioinformatics pipelines." | ||
version: 2.4.1 | ||
doi: 10.1038/s41587-020-0439-x | ||
date-released: 2022-05-16 | ||
url: https://github.com/nf-core/tools | ||
prefered-citation: | ||
type: article | ||
authors: | ||
- family-names: Ewels | ||
given-names: Philip | ||
- family-names: Peltzer | ||
given-names: Alexander | ||
- family-names: Fillinger | ||
given-names: Sven | ||
- family-names: Patel | ||
given-names: Harshil | ||
- family-names: Alneberg | ||
given-names: Johannes | ||
- family-names: Wilm | ||
given-names: Andreas | ||
- family-names: Ulysse Garcia | ||
given-names: Maxime | ||
- family-names: Di Tommaso | ||
given-names: Paolo | ||
- family-names: Nahnsen | ||
given-names: Sven | ||
doi: 10.1038/s41587-020-0439-x | ||
journal: nature biotechnology | ||
start: 276 | ||
end: 278 | ||
title: "The nf-core framework for community-curated bioinformatics pipelines." | ||
issue: 3 | ||
volume: 38 | ||
year: 2020 | ||
url: https://dx.doi.org/10.1038/s41587-020-0439-x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
from collections import Counter | ||
from pathlib import Path | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I though we deleted this file already |
||
logger = logging.getLogger() | ||
|
||
|
||
|
@@ -79,13 +78,15 @@ def validate_and_transform(self, row): | |
|
||
def _validate_sample(self, row): | ||
"""Assert that the sample name exists and convert spaces to underscores.""" | ||
assert len(row[self._sample_col]) > 0, "Sample input is required." | ||
if len(row[self._sample_col]) <= 0: | ||
raise AssertionError("Sample input is required.") | ||
# Sanitize samples slightly. | ||
row[self._sample_col] = row[self._sample_col].replace(" ", "_") | ||
|
||
def _validate_first(self, row): | ||
"""Assert that the first FASTQ entry is non-empty and has the right format.""" | ||
assert len(row[self._first_col]) > 0, "At least the first FASTQ file is required." | ||
if len(row[self._first_col]) <= 0: | ||
raise AssertionError("At least the first FASTQ file is required.") | ||
self._validate_fastq_format(row[self._first_col]) | ||
|
||
def _validate_second(self, row): | ||
|
@@ -97,36 +98,34 @@ def _validate_pair(self, row): | |
"""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 | ||
assert ( | ||
Path(row[self._first_col]).suffixes[-2:] == Path(row[self._second_col]).suffixes[-2:] | ||
), "FASTQ pairs must have the same file extensions." | ||
if Path(row[self._first_col]).suffixes[-2:] != Path(row[self._second_col]).suffixes[-2:]: | ||
raise AssertionError("FASTQ pairs must have the same file extensions.") | ||
else: | ||
row[self._single_col] = True | ||
|
||
def _validate_fastq_format(self, filename): | ||
"""Assert that a given filename has one of the expected FASTQ extensions.""" | ||
assert any(filename.endswith(extension) for extension in self.VALID_FORMATS), ( | ||
f"The FASTQ file has an unrecognized extension: {filename}\n" | ||
f"It should be one of: {', '.join(self.VALID_FORMATS)}" | ||
) | ||
if not any(filename.endswith(extension) for extension in self.VALID_FORMATS): | ||
raise AssertionError( | ||
f"The FASTQ file has an unrecognized extension: {filename}\n" | ||
f"It should be one of: {', '.join(self.VALID_FORMATS)}" | ||
) | ||
|
||
def validate_unique_samples(self): | ||
""" | ||
Assert that the combination of sample name and FASTQ filename is unique. | ||
|
||
In addition to the validation, also rename the sample if more than one sample, | ||
FASTQ file combination exists. | ||
In addition to the validation, also rename all samples to have a suffix of _T{n}, where n is the | ||
number of times the same sample exist, but with different FASTQ files, e.g., multiple runs per experiment. | ||
|
||
""" | ||
assert len(self._seen) == len(self.modified), "The pair of sample name and FASTQ must be unique." | ||
if len({pair[0] for pair in self._seen}) < len(self._seen): | ||
counts = Counter(pair[0] for pair in self._seen) | ||
seen = Counter() | ||
for row in self.modified: | ||
sample = row[self._sample_col] | ||
seen[sample] += 1 | ||
if counts[sample] > 1: | ||
row[self._sample_col] = f"{sample}_T{seen[sample]}" | ||
if len(self._seen) != len(self.modified): | ||
raise AssertionError("The pair of sample name and FASTQ must be unique.") | ||
seen = Counter() | ||
for row in self.modified: | ||
sample = row[self._sample_col] | ||
seen[sample] += 1 | ||
row[self._sample_col] = f"{sample}_T{seen[sample]}" | ||
|
||
|
||
def read_head(handle, num_lines=10): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an issue here