如何解决rowSums(tbl.external.all) 中的错误:“x”必须是数字
我尝试运行 SKAT 派生的 R 工具,但遇到了一些错误。 几乎运行脚本的最后一步时
re<-iECAT.SSD.All(EC.INFO,obj=obj,method="optimal")
我收到以下错误:
Error in rowSums(tbl.external.all) : 'x' must be numeric
In addition: Warning messages:
1: Error to run iECAT for 1:1918090: Error in rowSums(tbl.external.all) : 'x' must be numeric
2: In if (class(try1) != "try-error") { :
the condition has length > 1 and only the first element will be used
3: No polymorphic SNPs!
4: In if (class(try1) != "try-error") { :
the condition has length > 1 and only the first element will be used
以前的函数和对象分配没有问题。 以下是我在 R 脚本中运行的命令行:
library(SKAT)
library(MetaSKAT)
library(iECAT)
File.bed<-"file.bed"
File.Bim<-"file.bim"
File.Fam<-"fam_all.fam"
File.SetID<-"file.setID"
File.EC<-("file.txt")
File.SSD<-"file.SSD"
File.Info<-"file.SSD.INFO"
File.EC.Info<-"file.SSD.ECINFO"
FAM<-Read_Plink_FAM(File.Fam,Is.binary=TRUE)
Generate_SSD_SetID_wEC(File.bed,File.Bim,File.Fam,File.SetID,File.EC,File.SSD,File.Info,File.EC.Info)
EC.INFO= Open_SSD_wEC(File.SSD,File.EC.Info)
obj<-SKAT_Null_Model(Phenotype ~ 1,out_type="D",data=FAM)
re<-iECAT.SSD.All(EC.INFO,method="optimal") #here error occurs
re
我的输入文件的片段: 比姆:
1 rs201219564 0 69270 A G
1 rs2691305 0 69511 A G
1 rs200505207 0 69761 A T
1 rs200676709 0 69897 T C
家庭:
1 1 0 0 1 2
2 2 0 0 1 2
3 3 0 0 1 2
集合ID:
set1_183937 rs1169172101
set1_601436 rs373360530
set1_601667 rs879812396
set1_609407 rs61769279
set1_611317 rs12025928
set1_923421 rs7418179
欧盟
1 69183 rs1333310753 C T 0 498
1 69200 rs1453226491 T C 0 496
1 69208 rs1570409667 A C 0 478
1 69335 rs773188222 G A 0 1066
1 69404 rs1328728149 T C 0 1486
1 69428 rs140739101 T G 20 1652
1 69438 rs758790416 T C 0 1768
1 69440 rs1424058787 T G 0 1766
1 69448 rs1366217262 T A 0 1828
1 69462 rs1217994907 C G 0 1870
我尝试玩弄 setID 文件,将其更改为:
1:183937 rs1169172101
1:601436 rs373360530
1:601667 rs879812396
但问题依然存在。 我试图在可疑函数中找到问题,但没有发现任何问题:
> print(rowSums)
new("standardGeneric",.Data = function (x,na.rm = FALSE,dims = 1,...)
standardGeneric("rowSums"),generic = "rowSums",package = "base",group = list(),valueClass = character(0),signature = "x",default = new("derivedDefaultMethod",...)
base::rowSums(x,na.rm = na.rm,dims = dims,...),target = new("signature",.Data = "ANY",names = "x",package = "methods"),defined = new("signature",generic = "rowSums"),skeleton = (new("derivedDefaultMethod",generic = "rowSums"))(x,na.rm,dims,...))
<bytecode: 0x399c868>
<environment: 0x39a4718>
attr(,"generic")
[1] "rowSums"
attr(,"generic")attr(,"package")
[1] "base"
attr(,"group")
list()
attr(,"valueClass")
character(0)
attr(,"signature")
[1] "x"
attr(,"default")
Method DeFinition (Class "derivedDefaultMethod"):
function (x,...)
base::rowSums(x,...)
<environment: 0x301fa08>
Signatures:
x
target "ANY"
defined "ANY"
attr(,"skeleton")
(new("derivedDefaultMethod",...)
attr(,"class")
[1] "standardGeneric"
attr(,"class")attr(,"package")
[1] "methods"
先谢谢你!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。