Hi, I am running it with Seurat. But when I create it as a seurat object using the mtx file, my Rstudio crashes when I try to make clusters from my RNA Seq data. The script requires the seurat object to be created using csv file and that what I am trying to generate.
Hi,
I have barcodes.tsv, genes.tsv and matrix.mtx file from my RNA seq data and I want to generate a scRNA counts files using R. When I tried using readMM function, It gives me the following error: Error: cannot allocate vector of size 185.1 Gb. This happens even when I run it as a job. How can I generate a combined csv file using R?
Thank you.
2 answers
You should use a package meant to coerce your files into a format that's easier to work with, such as a SingleCellExperiment object via DropletUtils or a Seurat object.
These formats are designed to work with other R packages meant for scRNA analysis (like scater, scran, Seurat, etc).
No, Seurat does not require the data to be in csv. Use Read10X to import your 10X data for object creation.
You can follow the instruction on the following webpage with the heading "Loading matrices into R".
It will generate what is called a "sparse-matrix". Then you convert the sparse-matrix (SM) into normal matrix (NM) with following command in R.
NM<-as.matrix(SM)
Cautionary word: the matrix would be huge depending upon the number of cells. Also the following code is for V3 output that gives "features.tsz.gz" file instead of old "genes.tsz.gz".
You have to put all the three output files form one experiment into the same folder.
Log in to answer this question.
Also posted here: https://bioinformatics.stackexchange.com/questions/9247/how-to-generate-an-scrna-counts-file