NAs for all Q_SNP values

39 views
Skip to first unread message

Holly Poore

unread,
Apr 19, 2024, 9:16:37 AMApr 19
to Genomic SEM Users
Hello, 

I am running the model below and specifying Q_SNP=TRUE, but all the values for the three Q_SNP variables (Q, df, and p-value) are NA. Can you help me understand why this is happening?

Thank you,
Holly


MODEL <- "F1 =~ 1*phen1 + phen2 + phen3 + phen4 + phen5 + phen6 + phen7 + phen8 + phen9 + phen10
          phen2 ~~ phen5
          F1 ~~ NA*F1
         F1 ~ SNP"

results <- userGWAS(LDSCoutput,
                    sumstats,
                    estimation = "DWLS",
                    model = MODEL,
                    printwarn = TRUE,
                    sub=c("F1~SNP"),
                    cores=1,
                    toler = 1e-50,
                    Q_SNP=TRUE)

agro...@gmail.com

unread,
Apr 19, 2024, 11:24:00 AMApr 19
to Genomic SEM Users
Hi Holly, 

Thanks for raising this. Q_SNP will only print values for rows that reflect SNP effects on latent factors. So if you request full model output, the majority of rows will print as NA (e.g., residual variances of the indicators; factor loadings). With that said, I see you are specifying the 'sub' argument to just save 'F1~SNP', in which case I'm not sure why you would be seeing NAs for all of the Q_SNP metrics. I'm not currently able to reproduce the error using a toy example for neuroticism that I specified to try and mirror the set of arguments and model you are running (see my code below). I'm not sure then what may be going wrong for your model. If it's possible to send a set of 10 SNPs and the LDSCoutput I can take a closer look (and fine to leave as pheno1-pheno10 as naming if there are concerns about sharing the model itself). You can send to my e-mail: andrew.g...@colorado.edu 

Best, 
  Andrew

model<-"F1=~1*mood+misery+irritability+fedup+lonely+guilt+hurt+embarass+nerves+worry+tense+nervous
F1~~NA*F1
mood~~misery
F1 ~ SNP"

CorrelatedFactors<-userGWAS(LDSCoutput, SNPs = neuroticism_sumstats, model = model, printwarn = TRUE, sub=c("F1~SNP"), cores = 1, toler = 1e-50,Q_SNP=TRUE)

agro...@gmail.com

unread,
Apr 25, 2024, 9:01:59 AMApr 25
to Genomic SEM Users
Hi Holly, 

Thanks for sending over those files and for raising this issue! The problem was spacing in the model syntax that was causing the code not to catch that you were estimating a SNP effect on F1. I've updated the userGWAS function to remove spacing to ensure this doesn't happen and checked that you know get Q_SNP estimates with this code update. If you reinstall the package, restart R, and try rerunning you should be good to go. 

Best, 
  Andrew

Holly Poore

unread,
Jul 10, 2024, 1:29:25 PM (7 days ago) Jul 10
to Genomic SEM Users
Thanks very much for your help! I am now getting results for the Q_SNP parameters. I just want to make sure I'm requesting and interpretting them correctly in a two factor model. 

model <- "F1 =~ phen1 + phen2 + phen3 + phen4 + phen5 + phen6
          F2 =~ phen7 + phen8 + phen9 + phen10
          F1 ~~ NA*F1
          F2 ~~ NA*F2
          F1 ~ SNP
          F2 ~ SNP"

results <- userGWAS(LDSCoutput,
                        sumstats,
                        estimation = "DWLS",
                        model = model,
                        printwarn = TRUE,
                        sub=c("F1~SNP", "F2~SNP"),

                        cores=1,
                        toler = 1e-50,
                        Q_SNP=TRUE)

the results output is a list of two elements with the results for the SNP effects on F1 and F2. Am I correct that the Q_SNP results included here also correspond to F1 and F2? For example, the results for F1 ~ SNP also contain Q_SNP results for F1? The Q_SNP_df does seem to support this. 

Thanks!
Holly

agro...@gmail.com

unread,
Jul 10, 2024, 1:41:10 PM (7 days ago) Jul 10
to Genomic SEM Users
Hi Holly, 

The model looks right and your correct that the Q_SNP results are specific to each factor. So for a single SNP, you should have two separate Q_SNP values for the list object that contains the F1~SNP results and for the second list object that contains the F2~SNP results. 

Best, 
  Andrew

Reply all
Reply to author
Forward
0 new messages