Commit ce8f6083 authored by Jun Zhao's avatar Jun Zhao
Browse files

update tutorial

parent a49baa84
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
Package: DAseq
Type: Package
Title: Detecting regions of differential abundance between scRNA-seq datasets
Version: 1.0.1
Version: 1.0.0
Author: Jun Zhao <jun.zhao@yale.edu>
Maintainer: Jun Zhao <jun.zhao@yale.edu>
Description: DA-seq is a multiscale approach for detecting DA subpopulations.
@@ -15,8 +15,12 @@ LazyData: true
RoxygenNote: 6.1.1
Imports: 
    RANN, 
    glmnet, 
    caret, 
    Seurat, 
    e1071, 
    reticulate, 
    ggplot2, 
    cowplot, 
    reticulate,
    scales, 
    tclust
    ggrepel
+5 −0
Original line number Diff line number Diff line
@@ -57,6 +57,11 @@ getDAcells <- function(
  }
  n.cells <- length(cell.labels)

  # default k-vector
  if(is.null(k.vector)){
    k.vector <- round(seq(n.cells*0.0035, n.cells*0.035, length.out = 10))
  }

  # get DA score vector for each cell
  cat("Calculating DA score vector.\n")
  X.knn.result <- daPerCell(
+14 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#' @param prune.SNN parameter for Seurat function FindNeighbors(), default 1/15
#' @param resolution parameter for Seurat function FindClusters(), default 0.05
#' @param group.singletons parameter for Seurat function FindClusters(), default True
#' @param min.cell integer, number of cells below which a DA region will be removed as outliers, default 10
#' @param min.cell integer, number of cells below which a DA region will be removed as outliers, default 15
#' @param do.plot a logical value to indicate whether to return ggplot objects showing the results, default True
#' @param plot.embedding size N-by-2 matrix, 2D embedding for the cells
#' @param size cell size to use in the plot, default 0.5
@@ -34,15 +34,27 @@
getDAregion <- function(
  X, da.cells,
  cell.labels, labels.1, labels.2,
  prune.SNN = 1/15, resolution = 0.05, group.singletons = F, min.cell = 10,
  prune.SNN = 1/15, resolution = 0.05, group.singletons = F, min.cell = 15,
  do.plot = T, plot.embedding = NULL, size = 0.5,
  ...
){
  if(!inherits(x = X, what = "matrix")){
    cat("Turning X to a matrix.\n")
    X <- as.matrix(X)
  }
  n.cells <- nrow(X)
  n.dims <- ncol(X)
  if(is.null(rownames(X))){
    rownames(X) <- paste("C",c(1:n.cells), sep = "")
  }
  # check label input
  if(!inherits(cell.labels, "character") |
     !inherits(labels.1, "character") | !inherits(labels.2, "character")){
    stop("Input parameters cell.labels, labels.1 and labels.2 must be character")
  }
  if(length(setdiff(cell.labels, c(labels.1, labels.2))) > 0){
    stop("Input parameter cell.labels contain labels not from labels.1 or labels.2")
  }
  seurat.version <- substr(packageVersion("Seurat"),1,1)
  if(seurat.version == "3"){
    X.S <- CreateSeuratObject(counts = t(X))
+1 −3
Original line number Diff line number Diff line
@@ -6,9 +6,7 @@ DA-seq is a method to detect cell subpopulations with differential abundance bet
[This](https://github.com/KlugerLab/DAseq) repository contains the DA-seq package.

## R Dependencies
Required packages: RANN, tclust, ggplot2, cowplot, RColorBrewer, scales, reticulate

Suggested package: Seurat
Required packages: RANN, glmnet, caret, Seurat, e1071, reticulate, ggplot2, cowplot, scales, ggrepel

## Python Dependencies
Python 3 or above ([Miniconda](https://docs.conda.io/en/latest/miniconda.html) is recommended.)
+38.9 KiB (1.24 MiB)

File changed.

No diff preview for this file type.

Loading