-
Notifications
You must be signed in to change notification settings - Fork 1
fixed filtering SE reads #52
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
Conversation
WalkthroughThis pull request introduces a new function for retrieving single-end MHC Class II filter reads and adjusts the existing paired-end function for formatting consistency. The workflow for HLA genotyping has been updated to use this new function, along with changing a script path and adding a new rule to count reads. Additionally, an obsolete finalization script has been removed. These changes streamline the process of managing MHC-II reads and improve logging within the workflow. Changes
Sequence Diagram(s)sequenceDiagram
participant Rule as filter_reads_mhcII_SE Rule
participant Func as get_input_filter_reads_mhcII_SE
participant Config as Configuration
Rule->>Func: Call with wildcards
Func->>Config: Check if preprocessing is active
alt Preprocessing Active
Config-->>Func: Return preprocessed read path (using expand)
else Not Active
Config-->>Func: Return raw read path
end
Func-->>Rule: Return file path
sequenceDiagram
participant Rule as readcounts_mhcII Rule
participant Script as countreads.py
participant Log as Log File
Rule->>Script: Execute Python script for read counting
Script-->>Rule: Process and return count file
Rule->>Log: Log stdout and stderr
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
workflow/rules/hlatyping_mhcII.smk (1)
81-96
: New rule to count reads adds useful metrics.This rule adds functionality to count reads that have passed filtering, providing valuable metrics for quality control and workflow monitoring.
Consider removing the
| exit 0
portion in the shell command as it will cause the rule to succeed even if the script encounters errors, potentially hiding issues:- python workflow/scripts/countreads.py \ - {input.fwd} {output} > {log} 2>&1 | exit 0 + python workflow/scripts/countreads.py \ + {input.fwd} {output} > {log} 2>&1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
workflow/rules/common.smk
(2 hunks)workflow/rules/hlatyping_mhcII.smk
(3 hunks)workflow/scripts/finalize_mhcII_input.py
(0 hunks)
💤 Files with no reviewable changes (1)
- workflow/scripts/finalize_mhcII_input.py
🔇 Additional comments (5)
workflow/rules/common.smk (2)
258-267
: New function to retrieve single-end MHC Class II filter reads.The newly added function
get_input_filter_reads_mhcII_SE
enables proper handling of single-end read formats for MHC Class II filtering. It correctly evaluates the preprocessing configuration and returns the appropriate file paths based on the sequence type.
283-283
: Minor formatting improvement for consistency.This small change adds a space before the assignment operator in the variable declaration, ensuring consistent formatting with the newly added function.
workflow/rules/hlatyping_mhcII.smk (3)
4-4
: Enhanced modularity by using the new filter reads function.The rule now uses the dedicated
get_input_filter_reads_mhcII_SE
function instead of hardcoded inputs, improving code maintainability and consistency.
75-75
: Updated script path to structured directory.The script path has been updated to reflect a better organization of scripts in subdirectories by category.
124-124
: Improved logging capability.Adding output redirection to the log file captures both standard output and error messages, enhancing the observability of the workflow.
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)
CHANGELOG.md (1)
20-23
: Clarify the Fix Description for SE Filtering
The bullet point
- Added wrong input file to filtering of mhcII reads on SE
appears ambiguous. If the intent is to indicate that the rule was previously using an incorrect input file and this has now been corrected, consider rephrasing it for clarity. For example:
- Corrected input file for filtering MHCII reads on SE
This phrasing will ensure that users and future developers clearly understand that the issue has been resolved.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
CHANGELOG.md
(1 hunks)
🔇 Additional comments (1)
CHANGELOG.md (1)
16-19
: Document Version Header and Section Heading Clearly
The new changelog entry for version 0.3.4 (dated 2025-04-04) is clearly marked, and the "### Fix" heading reliably signals that the following bullet points describe bug fixes. This consistency aids future maintainers in quickly understanding the release notes.
Summary by CodeRabbit