This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to count gene expression level in R?

Hi! Could anyone suggest some reasonable quick way (library or tutorial) to get table with gene expression level with data listed below?

.tsv with barcodes

.tsv with genes

and .mtx matrix

I am new in this and I will appreciate any help.

expression seurat r gene bioconductor

Come on. How can anyone help if you don't say what format your data is now?

You would need phenotype data in addition to gene and matrix. In addition, please pose if gene order (in from genes .tsv) match with order of values (in matrix). Matrix needs sample names. Do you have corresponding sample names matching with matrix columns?

"The context of "I used CellRanger from 10X genomics..." would be needed for most people to provide you with actual help..." Devon Ryan 's comment relevant even after 3.1 yr :).

Here is the tutorial on how to load the scdata in R: https://hbctraining.github.io/scRNA-seq/lessons/readMM_loadData.html. 10x it self has put manual over there how to do this in R and python: https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/output/matrices

Thanks very much for help. I will try those links.

1 answer

Making scRNA counts file from barcodes, genes and matrix.mtx file

The mtx file stores the counts, the barcodes are the colnames and the genes are the rownames.

Do you know way to store that count matrix in .tsv or .csv file? Sorry for not smart question but R in not my strong site. I am definitely prefer python.

You can export any matrix in R with write.table() but depending on the dimensions it is going to be large, that is why these sparse formats exist.

Should I count that matrix after normalization, feature selection, scaling and dimensional reduction? Or wheres before?

Count? what does that mean?

I need to get table with gene expression level (count matrix). I did not confuse the concepts?

That would be the mtx file after reading into R with readMM, but if you prefer python then I am sure there are ways to read it into python. mtx is short for MatrixMarket, google will for sure give suitable packages for python to read it.

Appreciate the help!

Log in to answer this question.