Skip to content

feat: new SINCLAIR functions - #7

Merged
kelly-sovacool merged 28 commits into
mainfrom
nathan
Aug 21, 2025
Merged

feat: new SINCLAIR functions#7
kelly-sovacool merged 28 commits into
mainfrom
nathan

Conversation

@wong-nw

@wong-nw wong-nw commented Jul 18, 2025

Copy link
Copy Markdown
Collaborator

Changes

Primary upload to include SINCLAIR functions:

  • seurat_clustering
  • convert_to_human_genelist
  • main_process_so -> seurat_preprocess
  • run_singleR
  • main_singleR -> run_SingleR_db
  • main_doublets -> filter_doublets
  • run_singleR_average -> run_SingleR_cluster
  • main_batch_correction -> run_batch_correction

Includes ad hoc functions which will also be updated as needed for formatting:

  • bubble_plot
  • calc_sc_gsea_score
  • cluster_metrics
  • convert_mtx_to_h5
  • run_hypergeometric_test
  • splitFeaturePlot
  • volcano_plot

Issues

Resolves #6 by migrating the substance of https://github.com/CCBR/SINCLAIR/blob/main/bin/scRNA_functions.R into an R package.

PR Checklist

(Strikethrough any points that are not applicable.)

  • This comment contains a description of changes with justifications, with any relevant issues linked.
  • Write unit tests for any new features, bug fixes, or other code changes.
  • Update the docs if there are any API changes (roxygen2 comments, vignettes, readme, etc.).
  • [ ] Update NEWS.md with a short description of any user-facing changes and reference the PR number. Follow the style described in https://style.tidyverse.org/news.html
  • Run devtools::check() locally and fix all notes, warnings, and errors.

@kopardev kopardev added the SCOT RepoName label Jul 18, 2025
@wong-nw
wong-nw requested a review from kelly-sovacool July 18, 2025 16:46

@kelly-sovacool kelly-sovacool left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are remnants from unsolved merge conflicts in a few files, please remove them

They look like this:
<<<<<<< HEAD
=======
>>>>>>> COMMIT_HASH

@kelly-sovacool kelly-sovacool changed the title Upload of SINCLAIR functions feat: new SINCLAIR functions Jul 18, 2025
@kelly-sovacool

This comment was marked as outdated.

Comment thread DESCRIPTION
Comment thread R/volcano_plot.R Outdated
Comment thread R/bubble_plot.R Outdated
Comment thread R/splitFeaturePlot.R Outdated
@kelly-sovacool

Copy link
Copy Markdown
Member

Now would be a great time to create or borrow a very small test dataset and create unit tests -- see https://usethis.r-lib.org/reference/use_r.html

@wong-nw
wong-nw requested a review from kelly-sovacool August 20, 2025 14:05

@kelly-sovacool kelly-sovacool left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All of the comments I left previously haven't been addressed. Please either commit the suggestion, push a commit that addresses the comment, or respond to the comment to start a discussion about the merits of the suggestion. Only mark the conversation as resolved once it has either been addressed or we've discussed that it doesn't need to be addressed.

Comment thread DESCRIPTION
Comment thread .gitignore Outdated
Comment thread NAMESPACE Outdated
Comment thread R/split_featurePlot.R
Comment thread R/volcano_plot.R Outdated
Comment thread README.Rmd
Comment thread R/bubble_plot.R Outdated
Comment thread R/split_featurePlot.R
Comment thread R/split_featurePlot.R
@kelly-sovacool

Copy link
Copy Markdown
Member

Also, please run pre-commit install in your local clone of this repo

wong-nw and others added 2 commits August 20, 2025 12:54
Merge conflict correction and BioConductor dependencies

Co-authored-by: Kelly Sovacool, PhD <kelly-sovacool@users.noreply.github.com>
@wong-nw

wong-nw commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator Author

Also, please run pre-commit install in your local clone of this repo

Done

@wong-nw
wong-nw requested a review from kelly-sovacool August 20, 2025 19:28
@kelly-sovacool

Copy link
Copy Markdown
Member

R CMD check failed -- I'll work on fixing the problems and push to this branch directly. Later we can have a debrief about it so you can pre-empt these problems as you write code.
https://github.com/CCBR/SCOT/actions/runs/17109318156/job/48526459850?pr=7#step:6:201

@kelly-sovacool

Copy link
Copy Markdown
Member

notes from devtools::check() that I'm fixing:

❯ checking dependencies in R code ... NOTE
  Namespaces in Imports field not imported from:
    ‘SingleCellExperiment’ ‘grDevices’ ‘ontologyIndex’ ‘utils’
    All declared Imports should be used.

❯ checking R code for possible problems ... [36s/50s] NOTE
  make_bubble_plot: warning in AverageExpression(so, assay = assay):
    partial argument match of 'assay' to 'assays'
  run_AUCell: warning in AUCell_exploreThresholds(cells_AUC, plotHist =
    FALSE, assign = TRUE): partial argument match of 'assign' to
    'assignCells'
  convert_human_gene_list: no visible binding for global variable ‘gns’
  make_bubble_plot: no visible binding for global variable ‘pct.exp’
  make_bubble_plot: no visible binding for global variable ‘id’
  make_bubble_plot: no visible binding for global variable
    ‘features.plot’
  make_bubble_plot: no visible global function definition for ‘melt’
  make_bubble_plot: no visible binding for global variable ‘group’
  make_bubble_plot: no visible binding for global variable ‘Gene’
  make_bubble_plot: no visible binding for global variable ‘Pct.Exp’
  make_bubble_plot: no visible binding for global variable ‘AvgExp’
  preprocess_sample: no visible binding for global variable ‘cc.genes’
  run_batch_correction: no visible binding for global variable
    ‘scVIIntegration’
  run_batch_correction: no visible global function definition for
    ‘RunOptimizeALS’
  run_batch_correction: no visible global function definition for
    ‘RunQuantileNorm’
  run_batch_correction: no visible binding for global variable ‘v_list’
  run_singleR_cluster: no visible binding for global variable ‘refFile’
  split_featurePlot: no visible global function definition for
    ‘DefaultDimReduc’
  split_featurePlot: no visible global function definition for ‘dev.new’
  Undefined global functions or variables:
    AvgExp DefaultDimReduc Gene Pct.Exp RunOptimizeALS RunQuantileNorm
    cc.genes dev.new features.plot gns group id melt pct.exp refFile
    scVIIntegration v_list
  Consider adding
    importFrom("grDevices", "dev.new")
  to your NAMESPACE file.

@kelly-sovacool

Copy link
Copy Markdown
Member

Down to 2 remaining R CMD check notes:

── R CMD check results ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── SCOT 0.0.0.9000 ────
Duration: 4m 28.7s

❯ checking package dependencies ... NOTE
  Imports includes 24 non-default packages.
  Importing from so many packages makes the package vulnerable to any of
  them becoming unavailable.  Move as many as possible to Suggests and
  use conditionally.

❯ checking R code for possible problems ... [30s/44s] NOTE
  preprocess_sample: no visible binding for global variable ‘cc.genes’
  run_singleR_cluster: no visible binding for global variable ‘refFile’
  Undefined global functions or variables:
    cc.genes refFile

0 errors ✔ | 0 warnings ✔ | 2 notes ✖
  • We can ignore the one about package dependencies unless we submit this to CRAN. Let's kick that can down the road until we cross that bridge.
  • The global variable notes are genuine problems that need to be fixed, otherwise those functions will not work. I'll open a separate issue so we can merge this PR.

@kelly-sovacool
kelly-sovacool merged commit d07de36 into main Aug 21, 2025
2 of 7 checks passed
@kelly-sovacool
kelly-sovacool deleted the nathan branch August 21, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCOT RepoName

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task: Migrate functions from SINCLAIR

3 participants