issue with percent mitochondria from txt file
1
0
Entering edit mode
23 hours ago
Synat • 0

Dear All,

Hope you are well. I have read the txt file from from single cell data using Seurat. However, when it comes to plotting percent mitochondria, i got zero. Try to fix, but not working. if anyone could have a look, that would be great. thank in advance!

#read raw txt file
ATC_data<- read.delim("Y:/read_txt_file/read-txt/GSM5814583_ATC08_UMI.txt", 
                            header=TRUE, sep="\t")

GENE<- ATC_data[["GENE"]]

rownames(ATC_data)= GENE

ATC_data[["GENE"]]<-NULL

class(ATC_data)

ATC_data <-as.matrix (ATC_data)

class(ATC_data)

#create seurat obj
ACT_seurat_obj<- CreateSeuratObject(counts = ATC_data, 
                                    project = "ACT", min.cells = 3,
                                    min.features = 200)

#mitochondria
ACT_seurat_obj<- PercentageFeatureSet(ACT_seurat_obj, pattern = "^MT-", col.name = "percent.mt")
VlnPlot(ACT_seurat_obj, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)

enter image description here

enter image description here

seurat • 154 views
ADD COMMENT
4
Entering edit mode
20 hours ago
Dave Carlson ★ 2.0k

You've removed the rownames from your matrix, which is where the gene names are stored. Because of this, there are not data matching the "^MT-" pattern.

If you just make the Seurat object directly from the matrix you read in:

data <-"./GSM5814583_ATC08_UMI.txt"

ATC_data<- read.delim(data, header=TRUE, sep="\t")


# GENE<- ATC_data[["GENE"]]
# 
# rownames(ATC_data)= GENE
# 
# ATC_data[["GENE"]]<-NULL
# 
# class(ATC_data)
# 
# ATC_data <-as.matrix (ATC_data)
# 
# class(ATC_data)

ACT_seurat_obj<- CreateSeuratObject(counts = ATC_data, 
                                    project = "ACT", min.cells = 3,
                                    min.features = 200)

ACT_seurat_obj<- PercentageFeatureSet(ACT_seurat_obj, pattern = "^MT-", col.name = "percent.mt")

VlnPlot(ACT_seurat_obj, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)

Then you'll be able to mark the mito genes:

Seurat plot

ADD COMMENT
0
Entering edit mode

Thanks, you very much. it worked well. I really appreciated !

ADD REPLY

Login before adding your answer.

Traffic: 2748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6