This is a test version of Biostars. For the public version, visit https://www.biostars.org.
scRNAseq: working with barcode, gene and matrix files

hey, Folks:

never worked with barcode, matrix and gene files before, it seem they have these 3 file types for the same sample, I wonder are there tutorials available on getting the data into data frame files that we usually are familiar with?

thanks, this is a newbie question ...

scrnaseq

1 answer

You aren't going to want to use a traditional data-frame with single-cell matrices because how large they end up being. Instead, use a package such as Matrix as follows:

1.) Use the Matrix package to load the MTX file:

if(!require("Matrix")) install.packages("Matrix")
mtx <- Matrix::readMM(mtx)

2.) Read in the barcodes and gene names:

features <- read.delim(features)
barcodes <- read.delim(barcodes)

3.) Set the column names as the barcodes, and rownames as the gene names:

rownames(mtx) <- features
colnames(mtx) <- barcodes

now after reading from several websites, I realized, for some weird reason, the code to combine them together does not work, but Read10X from Seurat package works for this data... only issue is we have to do this by changing file names

Read10X(data.dir="./tmp", gene.column=2, unique.features =T, strip.suffix=F)

This is an issue of where you have gotten the data from then. The matrix file should not have more columns than the amount of barcodes.

Log in to answer this question.