diff --git a/DESCRIPTION b/DESCRIPTION index f5b089f..40f0336 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: projectR Type: Package Title: Functions for the projection of weights from PCA, CoGAPS, NMF, correlation, and clustering -Version: 1.17.11 +Version: 1.17.12 Author: Gaurav Sharma, Charles Shin, Jared Slosberg, Loyal Goff, Genevieve Stein-O'Brien Maintainer: Genevieve Stein-O'Brien Description: Functions for the projection of data into the spaces defined by PCA, CoGAPS, NMF, correlation, and clustering. diff --git a/R/multivariateAnalysisR.R b/R/multivariateAnalysisR.R index 1eab7f1..224bb70 100644 --- a/R/multivariateAnalysisR.R +++ b/R/multivariateAnalysisR.R @@ -18,7 +18,7 @@ #' @param CIheight height of CI png #' @param CIspacing spacing between each CI in CI graph #' -#' @return none; ANOVA and Confidence Intervals are visualized and exported in both PNG and CSV +#' @return a sorted list of ANOVA and CI results; ANOVA and Confidence Intervals are visualized and exported in both PNG and CSV #' @export #' @@ -387,5 +387,6 @@ multivariateAnalysisR <- function( ) CI_export_path <- file.path(getwd(), exportFolder, "multivariateAnalysisR_CI.csv") write.csv(CI_CSV_df, CI_export_path, row.names = FALSE) - + + return(sortedGrossList) } diff --git a/R/package.R b/R/package.R index 6d6fbc8..d9c261b 100644 --- a/R/package.R +++ b/R/package.R @@ -117,3 +117,9 @@ #' @format A gene (rows) by cell (column) matrix "glial_counts" +#' Truncated Seurat Object with latent space projection +#' done to unspecified cells in different stages for multivariateAnalysisR analysis +#' @name multivariateAnalysisR_seurat_test +#' @docType data +#' @format A Seurat Object with 31034 observations of 4 variables in meta.data: +"multivariateAnalysisR_seurat_test" diff --git a/data/multivariateAnalysisR-seurat-test.RData b/data/multivariateAnalysisR-seurat-test.RData deleted file mode 100644 index 6390ce9..0000000 Binary files a/data/multivariateAnalysisR-seurat-test.RData and /dev/null differ diff --git a/data/multivariateAnalysisR_seurat_test.RData b/data/multivariateAnalysisR_seurat_test.RData new file mode 100644 index 0000000..1c1cee9 Binary files /dev/null and b/data/multivariateAnalysisR_seurat_test.RData differ diff --git a/man/multivariateAnalysisR.Rd b/man/multivariateAnalysisR.Rd index b873836..b7e1707 100644 --- a/man/multivariateAnalysisR.Rd +++ b/man/multivariateAnalysisR.Rd @@ -45,7 +45,7 @@ multivariateAnalysisR( \item{CIspacing}{spacing between each CI in CI graph} } \value{ -none; ANOVA and Confidence Intervals are visualized and exported in both PNG and CSV +a sorted list of ANOVA and CI results; ANOVA and Confidence Intervals are visualized and exported in both PNG and CSV } \description{ Performs multivariate analysis across specified clusters in datasets diff --git a/man/multivariateAnalysisR_seurat_test.Rd b/man/multivariateAnalysisR_seurat_test.Rd new file mode 100644 index 0000000..0e0713b --- /dev/null +++ b/man/multivariateAnalysisR_seurat_test.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/package.R +\docType{data} +\name{multivariateAnalysisR_seurat_test} +\alias{multivariateAnalysisR_seurat_test} +\title{Truncated Seurat Object with latent space projection +done to unspecified cells in different stages for multivariateAnalysisR analysis} +\format{ +A Seurat Object with 31034 observations of 4 variables in meta.data: +} +\usage{ +multivariateAnalysisR_seurat_test +} +\description{ +Truncated Seurat Object with latent space projection +done to unspecified cells in different stages for multivariateAnalysisR analysis +} +\keyword{datasets} diff --git a/tests/testthat/test_projectR.R b/tests/testthat/test_projectR.R index 96d3976..3d7e072 100644 --- a/tests/testthat/test_projectR.R +++ b/tests/testthat/test_projectR.R @@ -51,7 +51,17 @@ test_that("results are as expected",{ expect_true(all(!is.na(pca.ESepiGen4c1l))) #multivariateAnalysisR check - output <- multivariateAnalysisR(multivariateAnalysisR_seurat_test) - expect_true(is.null(output)) + output <- multivariateAnalysisR(seuratobj = multivariateAnalysisR_seurat_test, + patternKeys = list("Pattern_1", "Pattern_2"), + dictionaries = list( + list("stage" = "E18"), + list("stage" = "Adult") + ) + ) + expect_is(output, "list") + expect_length(output, 2) + expect_true("patternKey" %in% names(output[[1]])) + expect_true("ANOVA" %in% names(output[[1]])) + expect_true("CI" %in% names(output[[1]])) }) diff --git a/vignettes/projectR.Rmd b/vignettes/projectR.Rmd index b79b317..af6ccba 100644 --- a/vignettes/projectR.Rmd +++ b/vignettes/projectR.Rmd @@ -518,7 +518,7 @@ The arguments for `multivariateAnalysisR` are: ### Output -The outputs of `multivariateAnalysisR` are two pairs of exported PNG/CSV files: one for ANOVA analysis, another for CI. No values are returned from the function. From the ANOVA analysis, researchers can see the general ranking of differential uses of patterns across the specified clusters. From the CI analysis, researchers can identify the specific differential use cases between every pair of clusters. +`multivariateAnalysisR` returns a sorted list of the generated ANOVA and CI values. It also exports two pairs of exported PNG/CSV files: one for ANOVA analysis, another for CI. From the ANOVA analysis, researchers can see the general ranking of differential uses of patterns across the specified clusters. From the CI analysis, researchers can identify the specific differential use cases between every pair of clusters. ### Comparing differential uses of patterns across different clusters Demonstrative example will be added soon. diff --git a/vignettes/projectR.html b/vignettes/projectR.html index 0ece1cd..90bada9 100644 --- a/vignettes/projectR.html +++ b/vignettes/projectR.html @@ -15,7 +15,7 @@ - + projectR Vignette @@ -57,7 +57,7 @@ h5 {font-size: 16px;} h6 {font-size: 12px;} code {color: inherit; background-color: rgba(0, 0, 0, 0.04);} -pre:not([class]) { background-color: white } +