使用R从RNAseq结果摘要文件中提取多个基因集的数据

问题描述 投票:0回答:1

我正在尝试从RNAseq结果摘要文件中提取几个基因集的数据:

enter image description here

示例基因列表:

enter image description here

我正在使用Excel首先突出显示重复的基因,对摘要文件进行排序,然后复制所需的数据。这非常耗时,并且在排序时(特别是对于大型基因列表),Excel总是“冻结”。

我想知道R是否可以做得更好。如果R可以成为更好的解决方案,有人可以提供代码吗?

r subset rna-seq
1个回答
0
投票

我想我已经找到了解决方案,尽管我仍然需要一张一张地处理这些列表。无论如何,它比Excel快。 :)

# read the RNAseq result summary file
result <- read_excel("RNAseq_Result.xlsx")

# read the gene lists file
geneset <- read_excel("Gene set list.xlsx")

# read one specific list from the gene lists file
ListA <- geneset$ListA

#subsetting
ResultListA <- result[(result$Gene_name) %in% ListA, ]

#output file
write.csv(ResultListA, 'ResultListA.csv')
© www.soinside.com 2019 - 2024. All rights reserved.