Skip to content

Commit

Permalink
Merge pull request #33 from genesofeve/multivariateAnalysisR-testthat
Browse files Browse the repository at this point in the history
Merge Request: Integration of Updated Test Code and Test Data from multivariateAnalysisR-testthat to Master
  • Loading branch information
dimalvovs authored Dec 1, 2023
2 parents 07d31c0 + 040b0ea commit 6f07b65
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 17 deletions.
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: projectR
Type: Package
Title: Functions for the projection of weights from PCA, CoGAPS, NMF,
correlation, and clustering
Version: 1.19.01
Version: 1.20.01
Author: Gaurav Sharma, Charles Shin, Jared Slosberg, Loyal Goff, Genevieve Stein-O'Brien
Maintainer: Genevieve Stein-O'Brien <[email protected]>
Description: Functions for the projection of data into the spaces defined by PCA, CoGAPS, NMF, correlation, and clustering.
Expand Down Expand Up @@ -37,13 +37,15 @@ Suggests:
knitr,
rmarkdown,
ComplexHeatmap,
gplots
gplots,
SeuratObject
LazyData: TRUE
LazyDataCompression: gzip
RoxygenNote: 7.2.3
Encoding: UTF-8
VignetteBuilder: knitr
biocViews: FunctionalPrediction, GeneRegulation, BiologicalQuestion, Software
BugReports: https://support.bioconductor.org/t/projectR/
URL: https://github.com/genesofeve/projectR/
Depends:
R (>= 4.0.1)
R (>= 4.0.0)
7 changes: 4 additions & 3 deletions R/multivariateAnalysisR.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'

Expand Down Expand Up @@ -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)
}
6 changes: 6 additions & 0 deletions R/package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Overview

[![R-CMD-check](https://github.com/genesofeve/projectR/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/genesofeve/projectR/actions/workflows/R-CMD-check.yml)
[![R-CMD-check](https://github.com/genesofeve/projectR/actions/workflows/r-build-check.yml/badge.svg)](https://github.com/genesofeve/projectR/actions/workflows/r-build-check.yml)

An R package for creating projection matrices from gene weights extracted from
high dimensional genomic analysis.
Expand Down
1 change: 1 addition & 0 deletions data/.Rapp.history
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load("/Users/macintosh/Desktop/projectR/data/multivariateAnalysisR-seurat-test.RData")
Binary file added data/multivariateAnalysisR_seurat_test.RData
Binary file not shown.
2 changes: 1 addition & 1 deletion man/multivariateAnalysisR.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions man/multivariateAnalysisR_seurat_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions tests/testthat/test_projectR.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test_that("data is proper",{
expect_that(pd.RNAseq6l3c3t,is_a('data.frame'))
expect_true(all(dim(pd.RNAseq6l3c3t) == c(54,38)))
expect_true(all(dim(CR.RNAseq6l3c3t) == c(54,5)))
expect_that(multivariateAnalysisR_seurat_test, is_a('Seurat'))
})

test_that("results are as expected",{
Expand Down Expand Up @@ -48,4 +49,19 @@ test_that("results are as expected",{
expect_true(all(dim(pca.ESepiGen4c1l) == c(54,9)))
expect_true(all(pca.ESepiGen4c1l != 0))
expect_true(all(!is.na(pca.ESepiGen4c1l)))

#multivariateAnalysisR check
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]]))

})
2 changes: 1 addition & 1 deletion vignettes/projectR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions vignettes/projectR.html

Large diffs are not rendered by default.

0 comments on commit 6f07b65

Please sign in to comment.