R 中的 goseq 包"missing value where TRUE/FALSE needed"错误



我正试图在R中运行GO分析(我从未做过这种分析,所以我正在尝试不同的包(,我很难在goseq包中找到我的代码的问题。

我从这个代码开始,它产生了一个差异表达基因名称列表:

de.genes <- rownames(res)[ which(res$padj < fdr.threshold & !is.na(res$padj)) ]

然后我试着运行这个代码(基于小插曲的第7页(https://bioconductor.org/packages/devel/bioc/vignettes/goseq/inst/doc/goseq.pdf)

pwf <- nullp(de.genes, "hg38","geneSymbol")

但我得到以下错误:

Can't find hg38/geneSymbol length data in genLenDataBase...
Found the annotation package, TxDb.Hsapiens.UCSC.hg38.knownGene
Trying to get the gene lengths from it.
Error in if (matched_frac == 0) { : missing value where TRUE/FALSE needed
In addition: Warning message:
In grep(txdbPattern, installedPackages):argument 'pattern' has length > 1 and only the first element will be used

我发现了这个论坛:https://support.bioconductor.org/p/38580/上面写着我需要一个";指示符变量";但我不知道这是什么。

如果您对这个错误有任何帮助,或者您知道任何其他易于学习的GO软件包,我们将不胜感激。谢谢

您可以检查支持的数据库,hg38不是其中之一:

library(org.Hs.eg.db)
library(goseq)
supported[grep("hg38|hg19",supported$Genome),]
Genome         Id  Id Description Lengths in geneLeneDataBase
4    hg19  knownGene  Entrez Gene ID                        TRUE
36   hg19    ensGene Ensembl gene ID                        TRUE
81   hg19 geneSymbol     Gene Symbol                        TRUE
98   hg38                                                  FALSE
GO Annotation Available
4                     TRUE
36                    TRUE
81                    TRUE
98                    TRUE

你可以通过使用hg19大致了解它的外观,你会有一些缺失或不匹配的。应该可以。你需要有一个二进制矢量,它应该被命名,例如:

set.seed(111)
allgenes = keys(org.Hs.eg.db,keytype="SYMBOL")
de.genes = rbinom(100,1,0.3)
names(de.genes) = sample(allgenes,100)

它看起来像这样:

GALNT5        TPRKB         CD48       OR52R1 LOC105372708 LOC112163649 
0            1            0            0            0            0 

LOC105369203 LOC110121115 LOC105377654 LOC105371502 loc10192964 HPC140 0 0 0highd4-17 LOC101927993 HINT1 BCC3 RPL18P3 LOC1082811920 0 0 0 1RNU6-793P JUN0 0

这将是好的:

res = nullp(de.genes,"hg19","geneSymbol")

最新更新