-
Notifications
You must be signed in to change notification settings - Fork 7
fix: Add more FASTA extensions #49
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant get_format
User->>get_format: Call with file path
get_format->>get_format: Check file extension against updated FASTA extensions list and compression types
get_format-->>User: Return "fasta" if match, else other format or error
Assessment against linked issues
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
🪛 Ruff (0.11.9)snakemake_wrapper_utils/snakemake.py38-41: Use ternary operator Replace (SIM108) 🔇 Additional comments (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
snakemake_wrapper_utils/snakemake.py (1)
45-47
: Improve maintainability with constants and case-insensitive matching
To simplify updates and avoid missing uppercase variants (e.g..FA
), normalizeext
to lowercase and extract FASTA/FASTQ extension sets to module‐level constants. For example:@@ get_format(path) - if exts[-1] in (".gz", ".bgz", ".bz2"): + if exts[-1] in (".gz", ".bgz", ".bz2"): ext = exts[-2] else: ext = exts[-1] + ext = ext.lower() - if ext in (".fq", ".fastq"): + if ext in FASTQ_EXTS: return "fastq" - elif ext in (".fa", ".fas", ".fna", ".ffn", ".faa", ".fasta", ".mpfa", ".frn"): - # https://en.wikipedia.org/wiki/FASTA_format - return "fasta" + elif ext in FASTA_EXTS: + return "fasta"And at the top of the file:
# Supported file extensions for FASTA/FASTQ formats: FASTA_EXTS = {".fa", ".fas", ".fna", ".ffn", ".faa", ".fasta", ".mpfa", ".frn"} # https://en.wikipedia.org/wiki/FASTA_format FASTQ_EXTS = {".fq", ".fastq"}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_wrapper_utils/snakemake.py
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest type annotations for functions that are defined inside of functions or methods. Do not suggest type annotation of the `s...
**/*.py
: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theself
argument of methods.
Do not suggest type annotation of thecls
argument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturn
statement.
snakemake_wrapper_utils/snakemake.py
🔇 Additional comments (1)
snakemake_wrapper_utils/snakemake.py (1)
45-47
: Extended FASTA extensions added
The new extensions.ffn
,.faa
,.mpfa
, and.frn
accurately reflect the FASTA variants, and the Wikipedia URL comment provides valuable context for future maintainers.
Fixes #48
Summary by CodeRabbit
New Features
.ffn
,.faa
,.mpfa
, and.frn
..xz
compression extension alongside existing ones.Documentation