Commit 972aa59f authored by HaojiaWu's avatar HaojiaWu
Browse files

Readme updated

parent a723a968
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,12 @@ complex_featureplot<-function(
  order=F
){
  gene_count<-extract_gene_count(seu_obj,features = features, meta.groups = group)
  if (is.null(levels(seu_obj@meta.data[,group]))){
    seu_obj@meta.data[,group] <-factor(seu_obj@meta.data[,group], levels = names(table(seu_obj@meta.data[,group])))
  }
  group_level<-levels(seu_obj@meta.data[,group])
  gene_count[,group]<-factor(gene_count[,group],
                                    levels = group_level)
  if(!is.null(select)){
    gene_count<-gene_count[gene_count[, group] %in% select,]
  }
+17 −7
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ 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).
We provide some example codes to help generate figures on user's provided 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 a 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() 

@@ -38,7 +38,7 @@ add_track(circ_data, group = "Group", colors = group_colors) ## can change the m
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 />
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/circlize_plot.png) <br />

### 2. Dotplot to show gene expression across groups
Here is an example to use plot1cell to show one gene expression across different cell types breakdown by group.
@@ -47,14 +47,14 @@ png(filename = 'dotplot_single.png', width = 4, height = 6,units = 'in', res =
complex_dotplot_single(seu_obj = iri.integrated, feature = "Havcr1",groupby = "Group")
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/dotplot_single.png) <br />
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/dotplot_single.png) <br />
plot1cell allows visualization of multiple genes in dotplot format too. Here is an example.
```
png(filename =  'dotplot_multiple.png', width = 10, height = 4,units = 'in', res = 300)
complex_dotplot_multiple(seu_obj = iri.integrated, features = c("Slc34a1","Slc7a13","Havcr1","Krt20","Vcam1"),groupby = "Group", celltypes = c("PTS1" ,   "PTS2"  ,  "PTS3"  ,  "NewPT1" , "NewPT2"))
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/dotplot_multiple.png) <br />
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/dotplot_multiple.png) <br />

### 3. Violin plot to show gene expression across groups
#### One gene/one group violin plot:
@@ -63,7 +63,7 @@ png(filename = 'vlnplot_single.png', width = 4, height = 6,units = 'in', res =
complex_vlnplot_single(iri.integrated, feature = "Havcr1", groups = "Group",celltypes   = c("PTS1" ,   "PTS2"  ,  "PTS3"  ,  "NewPT1" , "NewPT2"))
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/vlnplot_single.png) <br />
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/vlnplot_single.png) <br />

#### One genes/multiple groups violin plot:
```
@@ -71,7 +71,7 @@ png(filename = 'vlnplot_multiple.png', width = 8, height = 6,units = 'in', res
complex_vlnplot_single(iri.integrated, feature = "Havcr1", groups = c("Group","Replicates"),celltypes   = c("PTS1" ,   "PTS2"  ,  "PTS3"  ,  "NewPT1" , "NewPT2"))
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/vlnplot_multiple.png) <br />
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/vlnplot_multiple.png) <br />

Note that the Replicates group here is for demo purpose. This is not the mouse ID as reported in our original paper.

@@ -79,5 +79,15 @@ Note that the Replicates group here is for demo purpose. This is not the mouse I
The violin plot will look too messy in this scenario so it is not included in plot1cell. It would highly recommend to use the complex_dot_plot instead. <br />
For scRNA-seq studies with higher complexity, the complex_vlnplot_single function also allows split the group by another group in the meta data with the argument "split.by". Since the demo dataset doesn't have this complexity, examples are not included here. Users can refer to our recent DKD dataset with multiple treatments/two timepoints (the PCT violin graph in <a href="https://humphreyslab.com/SingleCell/">K.I.T.</a>)

### 4. Umap geneplot across groups
```
png(filename =  'geneplot_umap.png', width = 4, height = 6,units = 'in', res = 100)
complex_featureplot(iri.integrated, features = c("Havcr1","Slc34a1"), group = "Group", select = c("Control","12hours","6weeks"), order = T)
dev.off()
```
![alt text](https://github.com/HaojiaWu/Plot1cell/blob/master/data/geneplot_umap.png) <br />




(827 KiB)

File moved.

(252 KiB)

File moved.

(52.3 KiB)

File moved.

Loading