GWAStools error when performing regression analysis
0
0
Entering edit mode
thye • 0
@thye-19883
Last seen 5.2 years ago

Hello ,

I successfully imported PLINK binary files with the SNPRelate snpgdsBED2GDS function for analysis with GWAStools package. Unfortunately, when I try to perform an association analysis with the assocRegression module of the GWAStools I get the following error:

> fam.fn <-  "extdata/zztest.fam"
> bim.fn <-  "extdata/zztest.bim"
> bed.fn <-  "extdata/zztest.bed"
> gdsfile <- "snps4.gds"
> snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, gdsfile, family=TRUE, cvt.chr="int", verbose=TRUE)
> gds <- GdsGenotypeReader(gdsfile, YchromCode=24L, XYchromCode=25L)
>assoc = assocRegression(gds, outcome="status", model.type="logistic", snpStart=1, snpEnd=50)
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘hasSex’ for signature ‘"GdsGenotypeReader"

Any help is appreciated.

With kind regards,

Thorsten

GWAStools association GdsGenotypeReader hasSex • 563 views
ADD COMMENT
0
Entering edit mode

Finally found the solution. Had to add sex and phenotype data from the PLINK FAM-file to the gds genotype file in an extra step.

FAM<-read.table(file="extdata/zztest.fam", header=FALSE)

names(FAM)=c("FAMID", "ID", "FA","MO","SEX","STATUS")

mydat <- data.frame(scanID = FAM$ID, famID=FAM$FAMID,SEX=FAM$SEX, STATUS = FAM$STATUS)

scanAnnotT=ScanAnnotationDataFrame(mydat)

scanAnnot <- ScanAnnotationDataFrame(mydat)

genoDATA <- GenotypeData(gds, scanAnnot = scanAnnotT)

assoc = assocRegression(genoDATA, outcome="STATUS", model.type="logistic", snpStart=1, snpEnd=50)

ADD REPLY

Login before adding your answer.

Traffic: 604 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