對SRR7722937的三個fastq文件運行cellranger count ,完成後得到結果文件存於SRR7722937,打開其下的outs文件夾
下游分析所需的是紅框的文件,利用R讀入以上文件,形成expression_matrix
#!/usr/bin/R
library(Matrix)
cellbarcodes <- read.table("./barcodes.tsv")
genenames <- read.table("./genes.tsv")
molecules <- Matrix::readMM("./matrix.mtx")
rownames(molecules) <- genenames[,1]
colnames(molecules) <- cellbarcodes[,1]
#expression_matrix_df 是該樣品的表達矩陣,行是gene,列是cell_barcode
expression_matrix_df <- as.data.frame(as.matrix(molecules))