Skip to content

Figure 3 #29

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

Merged
merged 31 commits into from
Jul 15, 2025
Merged

Figure 3 #29

merged 31 commits into from
Jul 15, 2025

Conversation

Nathaniel-github
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 98.05447% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.79%. Comparing base (3be1ac3) to head (d0967fc).
Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
cellcommunicationpf2/cc_pf2.py 83.33% 2 Missing ⚠️
cellcommunicationpf2/ccc.py 66.66% 2 Missing ⚠️
...ommunicationpf2/figures/commonFuncs/plotFactors.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #29       +/-   ##
===========================================
+ Coverage   46.81%   77.79%   +30.98%     
===========================================
  Files           6       11        +5     
  Lines         361      653      +292     
===========================================
+ Hits          169      508      +339     
+ Misses        192      145       -47     
Flag Coverage Δ
unittests 77.79% <98.05%> (+30.98%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new figure generation module (Figure 3) that analyzes the correlation between component weights and cell counts in CC-PF2 decomposition. The PR also adds comprehensive testing infrastructure for automatic figure validation and makes several improvements to the codebase.

Key changes include:

  • Implementation of Figure 3 showing rank-1 component weight vs. sample size analysis
  • Addition of automated figure testing framework to validate all figure generation scripts
  • Updates to CC-PF2 implementation to properly handle component weights and standardization

Reviewed Changes

Copilot reviewed 8 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Added tensorly-viz dependency for visualization support
cellcommunicationpf2/tests/test_figures.py New automated testing framework for figure generation validation
cellcommunicationpf2/tests/test_ccpf2.py Updated tests to handle new CC-PF2 output format with weights
cellcommunicationpf2/figures/figure3.py New figure showing correlation between component weights and cell counts
cellcommunicationpf2/figures/figure2.py Comprehensive stability analysis figure with FMS calculations
cellcommunicationpf2/figures/figure1.py Enhanced factor visualization with improved plotting functions
cellcommunicationpf2/figures/commonFuncs/plotFactors.py Improved factor plotting with better error handling and visualization
cellcommunicationpf2/cc_pf2.py Enhanced CC-PF2 implementation with proper weight handling and standardization

@andrewram4287
Copy link
Collaborator

@Nathaniel-github This looks fine to me!

@Nathaniel-github Nathaniel-github requested a review from aarmey July 14, 2025 20:53
@meyer-lab meyer-lab deleted a comment from Copilot AI Jul 14, 2025
Copy link
Member

@aarmey aarmey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just some minor tweaking here.

@@ -84,3 +89,89 @@ def genFigure():
)

print(f"Figure {sys.argv[1]} is done after {time.time() - start} seconds.\n")


def correct_conditions(X: anndata.AnnData):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't seem directly related to the figures, so perhaps they should go outside of the figures folder?

assert fig is not None

# Close the figure to clean up
plt.close(fig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run rye fmt

@Nathaniel-github Nathaniel-github merged commit b9ce618 into main Jul 15, 2025
3 checks passed
@Nathaniel-github Nathaniel-github deleted the figure_3 branch July 15, 2025 08:06
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.

3 participants