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

How to send query loom files through gene names and not through Gene ID #6

Open
abhisheksinghnl opened this issue Dec 26, 2018 · 1 comment

Comments

@abhisheksinghnl
Copy link

abhisheksinghnl commented Dec 26, 2018

Hi,

Presently, I can generate the loom files and can also upload them in SCOPE to visualise them

I am generating the loom files as follows:

```{r scRNALoomGeneration, echo=FALSE, message=FALSE, warning=FALSE, include=TRUE, warnings=FALSE, eval=TRUE, results="asis"}
                                                      for ( i in 1:length(paths))
                                                      {
                                                        dgem <- counts(sce_list[[i]])
                                                        dim(dgem)
                                                        class(dgem)
                                                        head(colnames(dgem))
                                                        cell.info <- colData(sce_list[[i]])
                                                        cell.info$nGene <- Matrix::colSums(dgem>0)
                                                        sum(sce_list[[i]]$total_counts)
                                                        default.tsne <- sc_list[[i]]
                                                        default.tne.name <- "t-SNE on full expression matrix"
                                                        head(default.tsne)
                                                        tsne<-reducedDim(sc_list[[i]], "TSNE")[,1:2]
                                                        file.name<-paste0("file",i,".loom")
                                                        dgem.subset<-as.matrix(x=dgem)[, row.names(tsne)]
                                                        build_loom(file.name=file.name,
                                                                   dgem=dgem.subset,
                                                                   title="Fake expression dataset for examples",
                                                                   genome="Mouse", # Just for user information, not used internally
                                                                   default.embedding=tsne,
                                                                   default.embedding.name=default.tne.name)
                                                        
                                                      }


The above is an code chunk from Rmarkdown.

However, I can only navigate in the SCOPE using GeneID and not gene symbol.
Could you please let me know, how to incorporate the Gene Symbols and to use them to navigate through the loom files.

Many thanks for your help.

Best regards
Abhishek

@dweemx
Copy link
Contributor

dweemx commented Jan 3, 2019

Currently, It is only possible to query genes by the values save in the Gene row attribute of a Loom. By default, SCopeLoomR stores the row.names of the dgem (argument of the build_loom function) as Gene.
If you would like to query based on the gene symbols, you would have to set the row.names of the dgem to the corresponding gene symbols.

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

2 participants