【问题标题】:Extract data of several gene sets from an RNAseq result summary file using R使用 R 从 RNAseq 结果摘要文件中提取多个基因集的数据
【发布时间】:2020-06-13 01:17:10
【问题描述】:

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

基因列表示例:

我正在使用 Excel 首先突出显示重复的基因,对摘要文件进行排序,然后复制我需要的数据。这很耗时,而且 Excel 在排序时总是“冻结”,尤其是对于大基因列表。

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

【问题讨论】:

  • 您的问题太宽泛,无法回答,但通常您会希望将数据加载到 data.frames 中,这样您就可以访问大量的基础 R、tidyverse 和/或数据.table 函数来完成你想要的。

标签: r subset rna-seq


【解决方案1】:

我想我得到了解决方案,尽管我仍然需要一一处理这些列表。 无论如何,它比 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')

【讨论】:

    猜你喜欢
    • 2020-10-05
    • 1970-01-01
    • 1970-01-01
    • 2014-09-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-04
    • 2013-08-07
    相关资源
    最近更新 更多