Giter Club home page Giter Club logo

interactive-3d-plotting-in-seurat-3.0.0's Introduction

3D-Plotting-in-Seurat

The following code is used to generate nice interactive 3D tSNE and UMAP plots against Seurat objects created using the excellent single cell RNAseq analysis tool created by the Satijalab. V1 works for Seurat v2.3.4 + v3.0.2 and V2 (better interactive graphics, uses RShiny) of the code works for Seurat v3.0.0-v4.0

The engine behind this code uses plotly: Plotly Technologies Inc. Collaborative data science. Montréal, QC, 2015. https://plot.ly.

For more on Seurat please visit:https://satijalab.org/seurat/

News:

Code for analyzing UMAP embeddings and plotting in 3D are now added. Compatible with integrated/combined datasets created using new and improved sample integration systems in Seurat.

IF you use please dont forget to Cite, Thank you 🤩 !!

Please cite as:

Qadir, M. M. F., Álvarez-Cubela, S., Klein, D., van Dijk, J., Muñiz-Anquela, R., Moreno-Hernández, Y. B., ... & Díaz, Á. (2020). Single-cell resolution analysis of the human pancreatic ductal progenitor cell niche. Proceedings of the National Academy of Sciences, 117(20), 10876-10887.https://doi.org/10.1073/pnas.1918314117

Fahd Qadir, Saad Sadiq, & Juan Domínguez-Bendala. (2019, October 11). 3D Plotting of scRNAseq data using Seurat objects (Version 1.3). Zenodo. http://doi.org/10.5281/zenodo.3483177

Contact

Fahd Qadir, Graduate Student. Molecular Cell and Dev. Biology Graduate Program, Dept. of Cell Biology, University of Miami, Miller School of Medicine. [email protected]

DOI

interactive-3d-plotting-in-seurat-3.0.0's People

Contributors

dragonmasterx87 avatar jdblab avatar msaadsadiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

interactive-3d-plotting-in-seurat-3.0.0's Issues

saving 3D-UMAP

Hi guys! could some one give me tips on how to save 3D-UMAP in a movie for power point presentation purposes?

The following requested variables were not found: TOP2A

Hello,
When I ran the 3d umap for seurat encounter following error. Did anyone find how to work it out? Thanks.

Code:

goi <- "TOP2A"
plotting.data <- FetchData(object = yourseuratobject, vars = c("UMAP_1", "UMAP_2", "UMAP_3", "Expression"=goi), slot = 'data')
Warning message:
In FetchData(object = yourseuratobject, vars = c("UMAP_1", "UMAP_2", :
The following requested variables were not found: TOP2A

Curious: why extract the embeddings separately?

Code is very helpful; thank you!

Not an 'issue', but a question: I just realized that I do not understand a set of entries; why does one pull the embeddings into separate objects? Example:
umap_1 <- cystLineage2021_10[["umap"]]@cell.embeddings[,1]
(and two more lines for _2, and _3). These objects are not actually used for the plot, unless I am missing something obvious.

Some suggestions to 3D UMAP Plotting v1.3.R

Great work, thanks for sharing!

Some Typos

  1. plotting.data should be plot.data at line ~40
# Prepare a dataframe for cell plotting
plotting.data <- FetchData(object = yourseuratobject, vars = c("UMAP_1", "UMAP_2", "UMAP_3", "seurat_clusters"))



# Make a column of row name identities (these will be your cell/barcode names)
plot.data$label <- paste(rownames(plot.data))
  1. pancreas.integrated should be yourseuratobject

  1. Couple of suggestions
# create a dataframe
goi <- "TOP2A"
plotting.data <- FetchData(object = yourseuratobject, vars = c("UMAP_1", "UMAP_2", "UMAP_3", "Expression"=goi), slot = 'data')

# Say you want change the scale, so that every cell having an expression >1 will be one color
# Basically, you are re-adjusting the scale here, so that any cell having a certain expression will light up on your 3D plot

# First make another column in your dataframe, where all values above 1 are re-assigned a value of 1
# This information is stored in the 'Expression' column of your dataframe
# Cutoff <- 2
Cutoff <- quantile(plotting.data[,goi], probs = .95)
plotting.data$"ExprCutoff" <- ifelse(test = plotting.data[,goi] <Cutoff, yes = plotting.data[,goi], no = Cutoff)

# Add the label column, so that now the column has 'cellname-its expression value'
plotting.data$label <- paste(rownames(plotting.data)," - ", plotting.data[,goi], sep="")

# Plot your data, in this example my Seurat object had 21 clusters (0-20), and cells express a gene called ACTB
plot_ly(data = plotting.data,
        # name = goi,
        x = ~UMAP_1, y = ~UMAP_2, z = ~UMAP_3, 
        color = ~ExprCutoff, # you can just run this against the column for the gene as well using ~ACTB, the algorith will automatically scale in that case based on maximal and minimal values
        opacity = .5,
        colors = c('darkgrey', 'red'), 
        type = "scatter3d", 
        mode = "markers",
        marker = list(size = 1), 
        text=~label,
        hoverinfo="text"
) %>%layout(title=goi)

Making/saving 3D animation

Hi,

not a problem as such, but I'd like to make this interactive 3D plot into a 3D animation where the plot spins on an axis continually. Is there a way I can do this?

Thanks in advance!

Alex

Re-scaling (min.cutoff, max.cutoff) in expression plots

Hi!

Thanks for this nice script! It works like a charm ;)

I would like to make these plots more comparable to my 2D seurat plots. When you plot gene-expression values and re-scale for expression >1 that is similar to FeaturePlot is seurat, I guess.
Could you tell me how to apply the min.cutoff, max.cutoff arguments in the plot_ly plot?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.