Commit 5181250a authored by HaojiaWu's avatar HaojiaWu
Browse files

updates

parent a48a82db
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@
#' This function is to show the cell fraction changes across groups.
#'
#' @param seu_obj A complete Seurat object
#' @param celltypes Cell types to be included in the dot plot. Default: all cell types.
#' @param celltypes Cell types to be included in the plot. Default: all cell types.
#' @param groupby The group to show on x axis. One of the column names in meta.data.
#' @param show_replicate Whether or not to show the individual replicates from the graph. If TRUE, the replicate column names need to specify.
#' @param show_replicate Whether or not to show the individual replicate on the graph. If TRUE, the replicate column name needs to specify in the argument rep_colname.
#' @param rep_colname The column name for biological replicates in the meta data.
#' @param strip.color Colors for the strip background
#' @return A ggplot object
+4 −2
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ prepare_circlize_data <- function(
#' @param do.label Whether to label the clusters
#' @param contour.levels Which contour line to be drawn on the plot. Value: 0-1
#' @param bg.color Canvas background color
#' @param label.cex Label font size
#' @param pt.size Point size of the graph
#' @param kde2d.n Number of grid points in each direction. A kde2d parameter
#' @param contour.nlevels Total number of levels in contour
@@ -174,6 +175,7 @@ plot_circlize <- function(
  contour.nlevels = 100,
  bg.color='#F9F2E4',
  col.use=NULL,
  label.cex = 0.5,
  repel=FALSE
  ) {
  data_plot %>%
@@ -211,9 +213,9 @@ plot_circlize <- function(
  contour(z, drawlabels=F, nlevels= 100, levels = contour.levels,col = '#ae9c76', add=TRUE)
  if(do.label){
    if(repel){
      textplot(x=centers$x, y=centers$y, words =  centers$Cluster,cex = 0.8, new = F,show.lines=F)
      textplot(x=centers$x, y=centers$y, words =  centers$Cluster,cex = label.cex, new = F,show.lines=F)
    } else {
      text(centers$x,centers$y, labels=centers$Cluster, cex = 0.8, col = 'black')
      text(centers$x,centers$y, labels=centers$Cluster, cex = label.cex, col = 'black')
    }
  } 
}
+1 KiB (946 KiB)
Loading image diff...
+3 −3
Original line number Diff line number Diff line
@@ -16,11 +16,11 @@ plot_cell_fraction(
\arguments{
\item{seu_obj}{A complete Seurat object}

\item{celltypes}{Cell types to be included in the dot plot. Default: all cell types.}
\item{celltypes}{Cell types to be included in the plot. Default: all cell types.}

\item{groupby}{The group to show on x axis. One of the column names in meta.data.}

\item{show_replicate}{Whether or not to show the individual replicates from the graph. If TRUE, the replicate column names need to specify.}
\item{show_replicate}{Whether or not to show the individual replicate on the graph. If TRUE, the replicate column name needs to specify in the argument rep_colname.}

\item{rep_colname}{The column name for biological replicates in the meta data.}

@@ -30,5 +30,5 @@ plot_cell_fraction(
A ggplot object
}
\description{
This function to show the cell fraction changes across groups.
This function is to show the cell fraction changes across groups.
}
+3 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ plot_circlize(
  contour.nlevels = 100,
  bg.color = "#F9F2E4",
  col.use = NULL,
  label.cex = 0.5,
  repel = FALSE
)
}
@@ -33,6 +34,8 @@ plot_circlize(

\item{col.use}{Colors used to label the cell type}

\item{label.cex}{Label font size}

\item{repel}{Whether or not to repel the cell type names on umap}
}
\value{