dviraran / SingleR

SingleR: Single-cell RNA-seq cell types Recognition (legacy version)
GNU General Public License v3.0
267 stars 98 forks source link

how to create a new reference data set #136

Open Shawn10312 opened 4 years ago

Shawn10312 commented 4 years ago

Hi, In the new version of Singler, it can not create a new reference data set as following viginette.

` name = 'My_reference' expr = as.matrix(expr) # the expression matrix types = as.character(types) # a character list of the types. Samples from the same type should have the same name. main_types = as.character(main_types) # a character list of the main types. ref = list(name=name,data = expr, types=types, main_types=main_types)

if using the de method, we can predefine the variable genes

ref$de.genes = CreateVariableGeneSet(expr,types,200) ref$de.genes.main = CreateVariableGeneSet(expr,main_types,300)

if using the sd method, we need to define an sd threshold

sd = rowsSd(expr) sd.thres = sort(sd, decreasing = T)[4000] # or any other threshold ref$sd.thres = sd.thres

save(ref,file='ref.RData') # it is best to name the object and the file with the same name.

we can then use this reference in the previous functions. Multiple references can used.

singler = CreateSinglerObject(... ref.list = list(immgen, ref, mouse.rnaseq)`

There is no function named 'CreateVariableGeneSet' or 'rowsSd'.

look forward to hearing from you. Thanks.

dviraran commented 4 years ago

Yes, all those function were redacted from the new version. In the new version you don’t need to create the DE genes in advance. Please refer to the bioc version vignette or the new SingleR book - https://ltla.github.io/SingleRBook/

Shawn10312 commented 4 years ago

Hi, My R version is R 3.6.1, and I can only install SingleR 1.0.6 (not SingleR 1.2.4, the newest version). Because I am using HPC for data analysis, it is really hard for me to install R 4.0 in HPC and SingleR 1.2.4.

SO I want to know is there a viggette for the SingleR 1.0.6? If so, that will be easir to find the functions to create the refference using my own interested database.

Thanks.

Shawn10312 commented 4 years ago

hi team,

Recently, I really want to build my own refference. But I do not know how to achieve this through SingleR 1.0.6.

PS. Higher version of R and SingleR are not available for me.

Look forward to hearing from you. Thanks.

dviraran commented 4 years ago

Again, I am quite confused. This repository include those functions, but it does not have a version 1.0.6.

I am pretty sure that you installed an earlier version of the Bioconductor version, for BioC 3.10. I can find their 1.0.5, so not sure what is 1.0.6 - https://bioconductor.org/packages/3.10/bioc/src/contrib/Archive/SingleR/

If you can install the version there (1.0.5, which assume you are using bioc 3.10), there should be no issue using the tutorials in the SingleR book and the bioc vignettes.

If I am wrong and you are trying to use the legacy version from this repository, I suggest you at least reinstall the latest version from this repository, and you should have all the functions and can follow the tutorial in this repository.

Hope this helps.

Best, Dvir