Skip to content
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

tweaks to the alignstats reports and lumen theme #203

Merged
merged 5 commits into from
Feb 13, 2025
Merged

Conversation

pdimens
Copy link
Owner

@pdimens pdimens commented Feb 13, 2025

TODO

There needs to be a followup PR where the _quarto.yml and harpy.scss files are pulled from github in the rules. This design would make the report styles consistent with the latest design, regardless of what harpy version you're on.

Summary by CodeRabbit

  • Style

    • Updated report branding with new SVG logos, dual-theme support, and refreshed header icons.
    • Enhanced visual styling with updated navigation colors and typography for a more modern look.
  • Refactor

    • Streamlined data processing for statistical reports, ensuring consistent metric calculations even for empty inputs.
    • Refined aggregation logic for read counts and simplified parameter handling to improve reliability.

Copy link

coderabbitai bot commented Feb 13, 2025

📝 Walkthrough

Walkthrough

This pull request updates various components across reporting configuration, document processing, styling, and a Python demultiplexing script. In the Quarto configuration file, the logo is changed from PNG to SVG, themes are updated, and a header section with favicon links is added. Two QMD report files have been streamlined by removing redundant checks and commented-out code while standardizing parameter usage and output handling. The SCSS file now defines new styling variables, and the demultiplexing script has refined its control flow by eliminating an unused dictionary and updating read-count logic.

Changes

File(s) Change Summary
harpy/reports/_quarto.yml Updated logo URL from PNG to SVG; changed theme from materia to a list including lumen and harpy.scss; added an include-in-header section containing favicon and icon links.
harpy/reports/align_bxstats.qmd, harpy/reports/align_stats.qmd Removed redundant empty data checks and commented-out code; streamlined variable assignments by directly using parameters; ensured output data frames handle missing values by replacing NA with zeros.
harpy/reports/harpy.scss Added SCSS variables for navbar background ($navbar-bg) and foreground ($navbar-fg), font family, font size, and font weight; introduced a web font path with conditional Google Fonts import.
harpy/scripts/demultiplex_gen1.py Removed the unclear_read_map and its associated logic; refined control flow by skipping unclear reads and correctly updating counts for clear/adjusted read statuses, with simplified logging output.

Sequence Diagram(s)

sequenceDiagram
    participant Input
    participant process_input as "process_input()"
    participant Calculator as "Metrics Calculator"
    participant DataFrame as "datarow DataFrame"

    Input->>process_input: Provide input table (tb)
    process_input->>Calculator: Calculate metrics (reads, barcodes, stats)
    Calculator-->>process_input: Return computed values
    process_input->>process_input: Replace NA values with zeros
    process_input->>DataFrame: Construct result datarow
    DataFrame-->>process_input: Return datarow
Loading
sequenceDiagram
    participant Reads as "Read Stream"
    participant Demux as "demultiplex_gen1.py"
    participant Map as "clear_read_map"
    participant Logger as "Logger"

    Reads->>Demux: Iterate over each read
    alt Read status is "unclear"
        Demux->>Demux: Skip processing for unclear read
    else Read status is "corrected" or "found"
        Demux->>Map: Update or initialize count in clear_read_map
    end
    Demux->>Logger: Log updated clear read counts
Loading

Possibly related PRs

Suggested labels

enhancement

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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 (4)
harpy/reports/align_bxstats.qmd (1)

76-77: Consider removing commented-out code.

These commented lines are no longer needed as the NA/NaN handling has been moved to line 86.

-  #datarow[is.na(datarow)] <- 0
-  #datarow[is.nan(datarow)] <- 0
harpy/reports/_quarto.yml (3)

5-5: Fix indentation for execute section.

The execute section should be indented with 2 spaces to match YAML structure.

-    echo: false
+  echo: false
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 5-5: wrong indentation: expected 2 but found 4

(indentation)


10-12: Remove trailing space in theme section.

Remove the trailing space after 'theme:' to maintain consistent formatting.

-    theme: 
+    theme:
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 10-10: trailing spaces

(trailing-spaces)


23-26: Add newline at end of file.

Add a newline character at the end of the file to follow YAML best practices.

         <link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/pdimens/harpy/docs/static/favicon_report.svg">
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 26-26: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94b395e and 4fcf3be.

📒 Files selected for processing (5)
  • harpy/reports/_quarto.yml (1 hunks)
  • harpy/reports/align_bxstats.qmd (1 hunks)
  • harpy/reports/align_stats.qmd (0 hunks)
  • harpy/reports/harpy.scss (1 hunks)
  • harpy/scripts/demultiplex_gen1.py (1 hunks)
💤 Files with no reviewable changes (1)
  • harpy/reports/align_stats.qmd
🧰 Additional context used
🪛 YAMLlint (1.35.1)
harpy/reports/_quarto.yml

[warning] 5-5: wrong indentation: expected 2 but found 4

(indentation)


[error] 10-10: trailing spaces

(trailing-spaces)


[error] 26-26: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build/Cache Container
🔇 Additional comments (6)
harpy/scripts/demultiplex_gen1.py (3)

137-139: LGTM! Early return for unclear reads.

The code now efficiently skips processing unclear reads by using an early continue statement.


139-144: LGTM! Simplified corrected reads handling.

The code correctly updates the count of corrected reads in clear_read_map, initializing if needed.


144-149: LGTM! Streamlined found reads handling.

The code efficiently updates the count of found reads in clear_read_map, initializing if needed.

harpy/reports/align_bxstats.qmd (2)

35-37: LGTM! Simplified valid BX handling.

The code efficiently processes valid BX tags with clear variable assignments and formatting.


86-86: LGTM! Added NA handling for aggregate_df.

This change aligns with the PR objective to handle NA values in sample statistics.

harpy/reports/harpy.scss (1)

1-17: LGTM! Well-structured SCSS configuration.

The SCSS file is well-organized with clear sections for defaults and rules. The font configuration with fallbacks and conditional import is a good practice.

@pdimens pdimens merged commit ae8b913 into main Feb 13, 2025
20 checks passed
@pdimens pdimens deleted the demux-tweaks branch February 13, 2025 16:09
@coderabbitai coderabbitai bot mentioned this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error during bxstats report generation
1 participant