Commit 2c74381e authored by HaojiaWu's avatar HaojiaWu
Browse files

bug fixes

parent d3941a28
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ plot_circlize <- function(
  }
  circos.clear()
  par(bg = bg.color)
  circos.par(cell.padding=c(0,0,0,0), track.margin=c(0.01,0),"track.height" = 0.01, gap.degree =c(rep(2, (length(celltypes)-1)),12))
  circos.par(cell.padding=c(0,0,0,0), track.margin=c(0.01,0),"track.height" = 0.01, gap.degree =c(rep(2, (length(celltypes)-1)),12),points.overflow.warning=FALSE)
  circos.initialize(sectors =  data_plot$Cluster, x = data_plot$x_polar2)
  circos.track(data_plot$Cluster, data_plot$x_polar2, y=data_plot$dim2, bg.border=NA,panel.fun = function(x, y) {
    circos.text(CELL_META$xcenter,

README.html

0 → 100644
+258 −0

File added.

Preview size limit exceeded, changes collapsed.

+43 −3
Original line number Diff line number Diff line
# plot1cell: a package for advanced single cell data visualization

This package allows users to visualize the single cell data on the R objects or output files generated by the popular tools such as Seurat, Signac, SCENIC, monocle, CellPhoneDB, CellChat etc. It is currently under active development. A vignette will be available soon.
This package allows users to visualize the single cell data on the R objects or output files generated by the popular tools such as Seurat. It is currently under active development. 

## Installation
plot1cell R package can be easily installed from Github using devtools. Please make sure you have installed Seurat4.0, circlize and ComplexHeatmap packages.
```
# How to install in R:

devtools::install_github("HaojiaWu/plot1cell")
```

## Usage
We provide some example codes to help generate figures on user's own Seurat object. The Seurat object input to plot1cell should be a final object with completed clustering and cell type annotation. If a seurat object is not available, we suggest to use the demo data from Satija's lab (https://satijalab.org/seurat/articles/integration_introduction.html). To demonstrate the plotting functions in plot1cell, we re-created an Seurat object from our recent paper <a href="https://www.pnas.org/doi/10.1073/pnas.2005477117">Kirita et al, PNAS 2020</a> by integrating the count matrices we uploaded to GEO (GSE139107).
```
iri.integrated <- Install.example() 

# Please note that this Seurat object is just for demo purpose and 
# does not exactly the same as we published on PNAS.
# It take about 2 hours to run in a linux server with 500GB RAM and 32 CPU cores.
# You can skip this step and use your own Seurat object instead
```

### 1. Circlize plot to visualize cell clustering and meta data
```
###check and see the meta data info on your Seurat object
colnames(iri.integrated@meta.data)  

###Generate data for ploting
circ_data <- prepare_circlize_data(iri.integrated, scale = 0.8 )
set.seed(1234)
cluster_colors<-rand_color(length(levels(iri.integrated)))
group_colors<-rand_color(length(table(iri.integrated$Group)))
rep_colors<-group_colors<-rand_color(length(table(iri.integrated$orig.ident)))
###plot and save figures
png(filename =  'circlize_plot.png', width = 6, height = 6,units = 'in', res = 300)
plot_circlize(circ_data,do.label = T, pt.size = 0.01, col.use = cluster_colors ,bg.color = 'white', kde2d.n = 200)
add_track(circ_data, group = "Group", colors = group_colors) ## can change the meta data on your data
add_track(circ_data, group = "orig.ident",colors = rep_colors) ## can change the meta data on your data
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/circlize_plot.png) <br />

### 2. Dotplot to show gene expression across groups






circlize_plot.png

0 → 100644
+827 KiB
Loading image diff...