Skip to content

Fix bugs and reduce technical debt#1

Open
psychemistz wants to merge 18 commits intodata2intelligence:mainfrom
psychemistz:main
Open

Fix bugs and reduce technical debt#1
psychemistz wants to merge 18 commits intodata2intelligence:mainfrom
psychemistz:main

Conversation

@psychemistz
Copy link
Copy Markdown

@psychemistz psychemistz commented Mar 28, 2026

Summary

  • Fix 3 bugs: crash in sweep_sparse (wrong variable xm), undefined my_cols in CCC.circle/CCC.sankey, coutourBins typo
  • Eliminate code duplication: extract 8 helper functions, removing ~160 lines of repeated logic
  • Modernize R package practices: replace 14 library() calls with :: / @import, replace class() checks with inherits(), add missing RANN to Imports
  • Clean repo: remove tracked .DS_Store files, dead code, unused Makevars variables

Test plan

  • R CMD check passes without errors or warnings
  • SecAct.activity.inference() produces identical results on test data
  • SecAct.CCC.circle() and SecAct.CCC.sankey() work with sender/receiver filters (previously crashed due to my_cols bug)
  • Spatial velocity contour plots use corrected contourBins parameter

- Add 3-tab dataset loading: Upload Object, Space Ranger zip, Demo (Visium HCC)
- Space Ranger zip upload: extract, find spatial/ dir, call create.SpaCET.object.10X()
- Demo button: loads bundled Visium_HCC from inst/extdata/
- Run SecAct Inference button: calls SecAct.activity.inference.ST() on loaded data
- hasSecActResults reactive flag controls inference panel visibility
- Refactored load paths to share finish_load() helper
- Add on.exit() cleanup for Space Ranger zip extraction temp directory
- Add missing return() after unrecognized object type error in load path 1
- Remove unused file_name variable
- Extract swap_activity_matrix() to utils_viz.R (was inline in renderPlot)
- Remove redundant WHAT comments in inference section
- Fix crash in sweep_sparse (x@j → m@j for non-dgCMatrix sparse matrices)
- Fix undefined my_cols variable in CCC.circle and CCC.sankey (→ colors_cellType)
- Fix coutourBins typo in signaling velocity parameter
- Extract 8 helper functions to eliminate code duplication (~160 lines removed)
- Replace 14 library() calls with :: notation and @import ggplot2
- Replace ~12 class() checks with inherits() per R CMD check guidelines
- Add RANN to DESCRIPTION Imports
- Remove tracked .DS_Store files and add to .gitignore
- Remove dead code (commented-out hello(), color scales, score lines)
- Remove unused GSL_CFLAGS/GSL_LIBS from Makevars
- Add stop() in extract_ccc_data for unrecognized input class
- Replace deprecated row.names() with rownames() in activity.R
- Pre-allocate numeric vectors in compute_spatial_correlation
  instead of growing a data.frame row-by-row
- Fix q() that kills R session on low death rate (→ stop())
- Fix hardcoded column 3 in signaling.pattern.gene (→ column n)
- Fix length(death_rate) check (always 1; use death_rate directly)
- Remove unused patchwork and networkD3 from Imports
- Remove unused gsl_cdf.h include
- Remove commented-out sprintf line
Prevents R from dropping matrix to vector when only one
secreted protein matches a pattern, which would crash the
subsequent column indexing.
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.

1 participant