AlexsLemonade / OpenScPCA-analysis

An open, collaborative project to analyze data from the Single-cell Pediatric Cancer Atlas (ScPCA) Portal
Other
9 stars 17 forks source link

Add function to extract PC matrix (1/2) #758

Closed sjspielman closed 2 months ago

sjspielman commented 2 months ago

PR 1/2 for #754

This PR adds a function and associated tests to extract a PC matrix from a given SCE or Seurat object, allowing for a custom PC name while trying to set reasonable defaults for either object type. Currently I don't export this function, but that decision was kind of arbitrary. I also removed the previous README so that roxygen could write to it, and I then cleaned up some imports. (I also learned that stopifnot() does not like paste or glue::glue in the error message, which I think I had previously known but forgot.)

I expect to write a second PR to close out #754 that updates the calculate_clusters() function to, as discussed, also be able to take a single cell object and call this function to extract the matrix before clustering when needed.

sjspielman commented 2 months ago

In general, we probably want to avoid importing too much if we don't need to

Seurat is out (as is scpcaTools), but I kept SingleCellExperiment as an import since I figured it's relative more lightweight; let me know if you prefer more :: there

sjspielman commented 2 months ago

Checks passing (locally), and no code styling needed from accepted suggestions which all made sense to me!