Unverified Commit 91161a98 authored by Austin Hartman's avatar Austin Hartman Committed by GitHub
Browse files

Merge pull request #3 from AustinHartman/gh-pages

github pages & documentation updates
parents 861b5514 0fd18180
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4,6 +4,5 @@ inst/doc
.RData
src/*.so
src/*.o
**/*.html
.ipynb_checkpoints
**/.ipynb_checkpoints
+13 −18
Original line number Diff line number Diff line
@@ -25,30 +25,28 @@ compute_hash <- function(data_df, vars_use) {
    return(hash)
}

#' Collapse counts
#' Collapse counts based on multiple categorical metadata columns
#'
#' @param counts_mat counts matrix where columns represent cells and rows
#' represent features
#' @param meta_data data.frame containing cell metadata
#' @param varnames subset of `meta_data` column names
#' @param min_cells_per_group minimum cells to keep collapsed group
#' @param keep_n keep or drop the `N`` column containing the number of
#' @param keep_n keep or drop the `N` column containing the number of
#' cells in each group. Default is `FALSE`
#' @param how method of collapsing counts from groups. `sum` or `mean`
#'
#' @importFrom data.table data.table
#'
#' @examples
#' library(Seurat)
#' m <- matrix(sample.int(8, 100*500, replace=TRUE), nrow=100, ncol=500)
#' rownames(m) <- paste0("G", 1:100)
#' colnames(m) <- paste0("C", 1:500)
#' o <- CreateSeuratObject(m)
#' o$md1 <- sample(c("a", "b"), 500, replace=TRUE)
#' o$md2 <- sample(c("c", "d"), 500, replace=TRUE)
#' data_collapsed <- collapse_counts(
#'     o@assays$RNA@counts, o@meta.data, c('md1', 'md2')
#' )
#' md1 <- sample(c("a", "b"), 500, replace=TRUE)
#' md2 <- sample(c("c", "d"), 500, replace=TRUE)
#' df <- data.frame(md1, md2)
#' data_collapsed <- collapse_counts(m, df, c("md1", "md2"))
#' head(data_collapsed$counts_mat)
#'
#' @export
#'
@@ -364,16 +362,13 @@ pseudobulk_within <- function(
#'
#' @examples
#' \dontrun{
#'     library(Seurat)
#'     m <- matrix(sample.int(8, 100*500, replace=TRUE),nrow=100, ncol=500)
#'     rownames(m) <- paste0("G", 1:100)
#'     colnames(m) <- paste0("C", 1:500)
#'     o <- CreateSeuratObject(m)
#'     o$md1 <- sample(c("a", "b"), 500, replace = TRUE)
#'     o$md2 <- sample(c("c", "d"), 500, replace = TRUE)
#'     data_collapsed <- collapse_counts(
#'         o@assays$RNA@counts, o@meta.data, c('md1', 'md2')
#'     )
#'     md1 <- sample(c("a", "b"), 500, replace=TRUE)
#'     md2 <- sample(c("c", "d"), 500, replace=TRUE)
#'     df <- data.frame(md1, md2)
#'     data_collapsed <- collapse_counts(m, df, c("md1", "md2"))
#'     res_mat <- pseudobulk_deseq2(
#'         ~md1 + md1,
#'         data_collapsed$meta_data,
+8 −2
Original line number Diff line number Diff line
@@ -118,9 +118,15 @@ rank_matrix.matrix <- function(X) {
#' @export
sumGroups <- function(X, y, MARGIN = 2) {
    if (MARGIN == 2 & nrow(X) != length(y)) {
        stop("wrong dims")
        stop(
            "nrow(X) != length(y) - the number of rows in the matrix is not
            the same length as group labels"
        )
    } else if (MARGIN == 1 & ncol(X) != length(y)) {
        stop("wrong dims")
        stop(
            "ncol(X) != length(y) - the number of columns in the matrix is not
             the same length as group labels"
        )
    }
    UseMethod("sumGroups")
}
+3 −4
Original line number Diff line number Diff line
@@ -5,11 +5,10 @@ Presto performs a fast Wilcoxon rank sum test and auROC analysis. Latest benchma

# Installation

We are working on getting presto into CRAN. For now, install Presto from github directly:
Install presto from CRAN:

```{r}
library(devtools)
install_github('immunogenomics/presto')
install.packages('presto')
```

# Usage
@@ -22,4 +21,4 @@ wilcoxauc(seurat_object, 'group_name')
wilcoxauc(sce_object, 'group_name')
```

For examples, see `?wilcoxauc` and the [vignette](http://htmlpreview.github.io/?https://github.com/immunogenomics/presto/blob/master/docs/getting-started.html)
For examples, see `?wilcoxauc` and the [vignette](https://austinhartman.github.io/presto/articles/getting-started.html)

docs/.nojekyll

0 → 100644
+1 −0
Original line number Diff line number Diff line
Loading