Commit 48a9fb1d authored by Jun Zhao's avatar Jun Zhao
Browse files

minor changes

parent dd8ddce5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ SeuratMarkerFinder <- function(
      output.markers[[as.character(ii)]] <- FindMarkers(
        object, ident.1 = ii, ...
      )
      output.markers[[as.character(ii)]]$pct.diff <- output.markers[[as.character(ii)]]$pct.1 -
        output.markers[[as.character(ii)]]$pct.2
    }
  }

@@ -101,6 +103,8 @@ SeuratLocalMarkers <- function(
    output.markers <- FindMarkers(
      object, ident.1 = "da", ident.2 = "local", ...
    )
    output.markers[[as.character(ii)]]$pct.diff <- output.markers[[as.character(ii)]]$pct.1 -
      output.markers[[as.character(ii)]]$pct.2
  }
  return(output.markers)
}
+3 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#' @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
#' @param do.label a logical value to indicate whether to label each DA region with text, default False

#' @param ... other parameters to pass to Seurat FindClusters()
#'
@@ -35,7 +36,7 @@ getDAregion <- function(
  X, da.cells,
  cell.labels, labels.1, labels.2,
  prune.SNN = 1/15, resolution = 0.05, group.singletons = F, min.cell = 15,
  do.plot = T, plot.embedding = NULL, size = 0.5,
  do.plot = T, plot.embedding = NULL, size = 0.5, do.label = F,
  ...
){
  if(!inherits(x = X, what = "matrix")){
@@ -140,7 +141,7 @@ getDAregion <- function(
    X.da.order <- order(X.da.label, decreasing = F)
    X.region.plot <- plotCellLabel(
      X = plot.embedding[X.da.order,], label = as.factor(X.da.label[X.da.order]),
      size = size, do.label = F
      size = size, do.label = do.label, label.plot = as.character(c(1:X.n.da))
    ) + scale_color_manual(values = c("gray",hue_pal()(X.n.da)), breaks = c(1:X.n.da))
  } else {
    X.region.plot <- NULL
+5 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ coherent DA regions.</p>
    <pre class="usage"><span class='fu'>getDAregion</span>(<span class='no'>X</span>, <span class='no'>da.cells</span>, <span class='no'>cell.labels</span>, <span class='no'>labels.1</span>, <span class='no'>labels.2</span>,
  <span class='kw'>prune.SNN</span> <span class='kw'>=</span> <span class='fl'>1</span>/<span class='fl'>15</span>, <span class='kw'>resolution</span> <span class='kw'>=</span> <span class='fl'>0.05</span>, <span class='kw'>group.singletons</span> <span class='kw'>=</span> <span class='no'>F</span>,
  <span class='kw'>min.cell</span> <span class='kw'>=</span> <span class='fl'>15</span>, <span class='kw'>do.plot</span> <span class='kw'>=</span> <span class='no'>T</span>, <span class='kw'>plot.embedding</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>size</span> <span class='kw'>=</span> <span class='fl'>0.5</span>,
  <span class='no'>...</span>)</pre>
  <span class='kw'>do.label</span> <span class='kw'>=</span> <span class='no'>F</span>, <span class='no'>...</span>)</pre>
    
    <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
    <table class="ref-arguments">
@@ -184,6 +184,10 @@ coherent DA regions.</p>
      <th>size</th>
      <td><p>cell size to use in the plot, default 0.5</p></td>
    </tr>
    <tr>
      <th>do.label</th>
      <td><p>a logical value to indicate whether to label each DA region with text, default False</p></td>
    </tr>
    <tr>
      <th>...</th>
      <td><p>other parameters to pass to Seurat FindClusters()</p></td>
+3 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
getDAregion(X, da.cells, cell.labels, labels.1, labels.2,
  prune.SNN = 1/15, resolution = 0.05, group.singletons = F,
  min.cell = 15, do.plot = T, plot.embedding = NULL, size = 0.5,
  ...)
  do.label = F, ...)
}
\arguments{
\item{X}{size N-by-p matrix, input merged dataset of interest after dimension reduction}
@@ -34,6 +34,8 @@ getDAregion(X, da.cells, cell.labels, labels.1, labels.2,

\item{size}{cell size to use in the plot, default 0.5}

\item{do.label}{a logical value to indicate whether to label each DA region with text, default False}

\item{...}{other parameters to pass to Seurat FindClusters()}
}
\value{