Skip to content

Adding spatial_exp_to_mif and error handling - #22

Open
cansavvy wants to merge 11 commits into
FridleyLab:masterfrom
fhdsl:cansavvy/spatialexperiment
Open

cansavvy wants to merge 11 commits into
FridleyLab:masterfrom
fhdsl:cansavvy/spatialexperiment

Conversation

@cansavvy

@cansavvy cansavvy commented Jan 2, 2025 •

Copy link
Copy Markdown

Summary

  • The spatial_exp_to_mif() function takes a spatialExperiment object and preps it to be a mif. The big caveat to this is I can't find more spatialExperiment objects thata re publicly available to test this on. So we will just have to adjust when that happens at some point.
  • For the purposes of the workshop I also altered the example data to have clean_names(). However this did have a ripple effect in the code so the reason you will see so many files changed is that I had to change references to columns in code. I did this with a search and replace.

Testing

This was tested by running

devtools::check()

Which built the vignettes and examples which all passed.

Usage

# Create mif object
if (!("VectraPolarisData" %in% installed.packages())) {
BiocManager::install("VectraPolarisData")
}
ovarian <- VectraPolarisData::HumanOvarianCancerVP()

ova_mif <- spatial_exp_to_mif(spatial_exp = ovarian, 
                              patient_id = "sample_id",
                              markers = c("phenotype_cd68", "phenotype_cd3", "phenotype_cd8"))

@cansavvy cansavvy changed the title Cansavvy/spatialexperiment Adding spatial_exp_to_mif and error handling Jan 2, 2025
Comment thread R/create_mif.R
#' # Create mif object
#'
#' x <- create_mif(
#' clinical_data = example_clinical,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Once I find where these example data are, we could just make it so they are ready to go instead of having these coerce mutates in the tutorial.

@cansavvy
cansavvy marked this pull request as ready for review January 18, 2025 00:08
@cansavvy

Copy link
Copy Markdown
Author

There is one note that the examples take too long to run. Just FYI.

   Examples with CPU (user + system) or elapsed time > 5s
                        user system elapsed
   spatial_exp_to_mif 68.205  8.648  90.105
   NN_G                5.609  2.894   5.274
✔  checking for unstated dependencies in ‘tests’ (361ms)
─  checking tests (697ms)
    [83s/97s] OKthat.R’
   * checking for unstated dependencies in vignettes ... OK
   * checking package vignettes ... OK
   * checking re-building of vignette outputs ... [7m/12m] OK
   * checking for non-standard things in the check directory ... OK
   * checking for detritus in the temp directory ... OK
   * DONE
   
   Status: 1 NOTE
   See
     ‘/private/var/folders/2d/d8927cd105550jjcy7qy99_w0000gn/T/Rtmp3izT5s/file8f54e04e86b/spatialTIME.Rcheck/00check.log’
   for details.
   
── R CMD check results ──────────────────────────── spatialTIME 1.3.4-5 ────
Duration: 18m 26.7s

❯ checking for future file timestamps ... NOTE
  unable to verify current time

0 errors ✔ | 0 warnings ✔ | 1 note ✖

This branch has not been deployed

No deployments
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