Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a clean featureplot #16

Open
beginner984 opened this issue Nov 13, 2018 · 0 comments
Open

Creating a clean featureplot #16

beginner984 opened this issue Nov 13, 2018 · 0 comments

Comments

@beginner984
Copy link

beginner984 commented Nov 13, 2018

Sorry,

This is not a problem with your nice software rather my own problem.

I noticed by plotDRExpression function we can plot a list of genes very clean because you are using a sort of centring I guess (-2,2).

You please imagine that, I have made 3 clusters of cells (clusters 1, 2 and 3) . I expect if I plot a list of marker genes across these three clusters, only cluster 1 should be lighted up because these marker genes supposed to be specific to cluster 1. Is there any way to use your plotDRExpression function for a list of genes but not each of them individually rather something like mean of expression of them or whatever by which I could have such a nice featureplot showing the expression of these genes?

I tried seurat like below code but my way of centring another clusters also being lighted up that I don't want

mat=seurat_object@data[rownames(seurat_object@data)%in%rownames(gene_list),]   
 
#I have converted expression matrix to a binary matrix by 2 as a threshold (arbitrarily)

mat[mat < 2] <- 0

mat[mat > 2] <- 1

 

 
exp=colSums(mat)

exp=as.matrix(exp)

colnames(exp)="value"

exp=as.data.frame(exp)

cc <- AddMetaData(object = surat_object, metadata = exp)

cc <- SetAllIdent(object = cc, id = "value")

TSNEPlot(object = cc, do.return= TRUE)

ggplot(as.data.frame(cc@meta.data), aes(x = cc@meta.data$CELL, y = cc@meta.data$res.0.7, colour =cc@meta.data$value)) + 
       geom_point(size = 9) +
      scale_colour_gradient(low = "yellow", high = "blue")

Thanks a lot for any help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant