'ReorderModelnoSNP' not found

62 views
Skip to first unread message

Yu - Yvonne Huang

unread,
Jan 26, 2024, 7:37:55 AMJan 26
to Genomic SEM Users
Hi,

Firstly, thank you very much for the great package, I practice a lot with it!

I came across a problem with the mediation, this is my model:

model_med<-'GLAUCOMA=~NA*VCDR_UCL + start(0.7)*POAG_UCL + a*VCDR_UCL
            ANATOMY=~NA*VCDR_UCL + b*VCDR_UCL
            a>0.2
            b>0.4
            GLAUCOMA~c*SNP
            ANATOMY~d*SNP

           M_GLAUCOMA:=a*c
           M_ANATOMY:=b*d
         
         ANATOMY~~1*ANATOMY
         GLAUCOMA~~1*GLAUCOMA
         GLAUCOMA~~0*ANATOMY

         POAG_UCL~~0*VCDR_UCL
         POAG_UCL~~0*POAG_UCL
         VCDR_UCL~~0*VCDR_UCL
         SNP~~SNP
'
outputGWAS <-userGWAS(covstruc=LDSCoutput, SNPs=p_sumstats1,model=model_med,estimation = "DWLS",sub = c("GLAUCOMA~SNP","ANATOMY~SNP","M_GLAUCOMA:=a*c","M_ANATOMY:=b*d"), parallel=TRUE)

I can run this in my laptop, with GenomicSEM version 0.0.3. However, when I use GenomiSEM 0.0.5. I had error message:
" Error in userGWAS(covstruc = LDSCoutput, SNPs = p_sumstats1, model = model_med,  :
  object 'ReorderModelnoSNP' not found"...

I noticed a previous email "https://groups.google.com/g/genomic-sem-users/c/ZPPYVCA8qQg/m/-NZE7DKxAQAJ" had discussed this problem, and I re-installed the package, but the problem still exists....

Please can someone help me with this problem?

Best wishes,
Yvonne

agro...@gmail.com

unread,
Jan 27, 2024, 8:42:37 AMJan 27
to Genomic SEM Users
Hi Yvonne, 

Thanks for raising this! The issue had to do with some new functionality that will default to fixing the measurement model (i.e., the part of the model that does not include the individual SNP effects) that was throwing an error when you have "ghost parameters" like your  M_GLAUCOMA:=a*c estimate, where the model is unable to calculate the ghost parameter when one of those estimates is fixed (i.e., the 'a' parameter in your model).

I just updated the userGWAS functions to provide more informative errors when running the model, but you will want to turn off the fix_measurement default to get your model to run. Your code would now look like this:
outputGWAS <-userGWAS(covstruc=LDSCoutput, SNPs=p_sumstats1,model=model_med,estimation = "DWLS",sub = c("GLAUCOMA~SNP","ANATOMY~SNP","M_GLAUCOMA:=a*c","M_ANATOMY:=b*d"), parallel=TRUE,fix_measurement=FALSE)

If you redownload GenomicSEM, restart R, and try the code above it should work. 

Best, 
  Andrew

Yu - Yvonne Huang

unread,
Feb 1, 2024, 7:24:28 AMFeb 1
to Genomic SEM Users
Dear Andrew,

Thank you very much! Now I see what my problem is and the new code runs very well!

Best wishes,
Yvonne
Reply all
Reply to author
Forward
0 new messages