Commit b94163f2 authored by HaojiaWu's avatar HaojiaWu
Browse files

Modified some functions

parent 5ea762e9
Loading
Loading
Loading
Loading
+11 −9
Original line number Original line Diff line number Diff line
@@ -56,6 +56,7 @@ modified_dotplot <- function(
#' @param pt.size Size of the data points
#' @param pt.size Size of the data points
#' @param label.box Whether or not to label the cell type name
#' @param label.box Whether or not to label the cell type name
#' @param label.size Font size of the labels
#' @param label.size Font size of the labels
#' @param do.reple Whether or not to repel the cluster annotation
#' @param title Main title of the plot
#' @param title Main title of the plot
#' @return A ggplot object
#' @return A ggplot object
#' @export
#' @export
@@ -65,6 +66,7 @@ modified_dimplot <- function(
  pt.size = 0.5,
  pt.size = 0.5,
  label.box = T,
  label.box = T,
  label.size = 6,
  label.size = 6,
  do.repel=F,
  title = "UMAP plot"
  title = "UMAP plot"
){
){
  if(is.null(colors)){
  if(is.null(colors)){
@@ -75,7 +77,7 @@ modified_dimplot <- function(
  y0<-min(seu_obj@reductions$umap@cell.embeddings[,2])
  y0<-min(seu_obj@reductions$umap@cell.embeddings[,2])
  y1<-y0+(max(seu_obj@reductions$umap@cell.embeddings[,2])-min(seu_obj@reductions$umap@cell.embeddings[,2]))/8
  y1<-y0+(max(seu_obj@reductions$umap@cell.embeddings[,2])-min(seu_obj@reductions$umap@cell.embeddings[,2]))/8
  DimPlot(seu_obj, label = T, cols = colors,label.box = label.box, 
  DimPlot(seu_obj, label = T, cols = colors,label.box = label.box, 
        label.size = label.size, pt.size = pt.size, raster = F)+NoLegend()+NoAxes()+
          label.size = label.size, pt.size = pt.size, raster = F, repel = do.repel)+NoLegend()+NoAxes()+
    geom_segment(aes(x=x0, xend = x1 , y=y0, yend = y0), size=0.8,
    geom_segment(aes(x=x0, xend = x1 , y=y0, yend = y0), size=0.8,
                 arrow = arrow(length = unit(0.2,"cm"))) +
                 arrow = arrow(length = unit(0.2,"cm"))) +
    geom_segment(aes(x=x0, xend = x0 , y=y0, yend = y1), size=0.8,
    geom_segment(aes(x=x0, xend = x0 , y=y0, yend = y1), size=0.8,
+1 −1
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ plot_circlize <- function(
  }
  }
}
}


#' Add tracts to the circlize plot
#' Add tracks to the circlize plot
#'
#'
#' This function allows users to add more tracks into the circlize plot
#' This function allows users to add more tracks into the circlize plot
#' @param data_plot Data for circlize plot 
#' @param data_plot Data for circlize plot 
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@
% Please edit documentation in R/plot_circlize.R
% Please edit documentation in R/plot_circlize.R
\name{add_track}
\name{add_track}
\alias{add_track}
\alias{add_track}
\title{Add tracts to the circlize plot}
\title{Add tracks to the circlize plot}
\usage{
\usage{
add_track(data_plot, group, colors = NULL)
add_track(data_plot, group, colors = NULL)
}
}
+3 −0
Original line number Original line Diff line number Diff line
@@ -10,6 +10,7 @@ modified_dimplot(
  pt.size = 0.5,
  pt.size = 0.5,
  label.box = T,
  label.box = T,
  label.size = 6,
  label.size = 6,
  do.repel = F,
  title = "UMAP plot"
  title = "UMAP plot"
)
)
}
}
@@ -25,6 +26,8 @@ modified_dimplot(
\item{label.size}{Font size of the labels}
\item{label.size}{Font size of the labels}


\item{title}{Main title of the plot}
\item{title}{Main title of the plot}

\item{do.reple}{Whether or not to repel the cluster annotation}
}
}
\value{
\value{
A ggplot object
A ggplot object