Question: GWAStools error when performing regression analysis
0
gravatar for thye
5 weeks ago by
thye0
thye0 wrote:

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

ADD COMMENTlink written 5 weeks ago by thye0

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by thye0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 285 users visited in the last hour