discrepancy in results from batch and interactive run

66 views
Skip to first unread message

Holly Poore

unread,
Feb 23, 2024, 12:52:48 PMFeb 23
to Genomic SEM Users

I am having a problem with discrepancies in results from the userGWAS function when I run the model as a batch job and run it interactively on the same server. In both cases, I am using a subset of 750 SNPs, running GenomicSEM v. 0.0.5 and in the same miniconda environment, so I didn’t think I would be having a problem with different versions of R or the dependencies.  When I run the model twice interactively in the same R session, the results are identical.

 

For both the batch job and interactively run model, I run the following code:

 

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)

 

There are slight differences in the estimates, SEs, Z scores, p-values, and chisqs from these two runs (summarized below) and I’m wondering if that’s to be expected.

 

> summary(batch$est-results$est)

      Min.    1st Qu.     Median       Mean    3rd Qu.       Max.

-4.771e-07 -4.492e-09 -3.076e-10 -4.068e-09  1.806e-09  3.352e-07

 

> summary(batch$SE-results$SE)

      Min.         1st Qu.     Median       Mean    3rd Qu.       Max.

-4.756e-09 -8.921e-11 -5.521e-11 -6.036e-11 -2.320e-11  2.823e-09

 

> summary(batch$Z-results$Z)

      Min.    1st Qu.     Median       Mean    3rd Qu.       Max.

-9.685e-05 -2.303e-06 -2.398e-07 -1.117e-06  9.442e-07  8.613e-05

 

> summary(batch$P-results$P)

      Min.    1st Qu.     Median       Mean    3rd Qu.       Max.

-7.514e-05 -5.145e-07 -3.758e-08 -6.557e-07  3.398e-07  3.521e-05

 

Michel Nivard

unread,
Feb 23, 2024, 12:54:32 PMFeb 23
to Holly Poore, Genomic SEM Users
Can you give me the shell/bash line/script you use to launch? 

Op vr 23 feb. 2024 om 18:52 schreef Holly Poore <hollyb...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Genomic SEM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to genomic-sem-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/genomic-sem-users/2e60ad50-24a7-4a54-aa29-ae021310d778n%40googlegroups.com.

Holly Poore

unread,
Feb 23, 2024, 1:19:02 PMFeb 23
to Genomic SEM Users
I activate my conda environment and then run sbatch scriptname.sh

This is the shell script:

#!/bin/bash
#SBATCH --partition=main
#SBATCH --job-name=R16
#SBATCH --mem=10G
#SBATCH --output=slurm.%N.%j.out
#SBATCH --error=slurm.%N.%j.err

R CMD BATCH --no-restore --no-save scriptname.R

Michel Nivard

unread,
Feb 23, 2024, 1:27:07 PMFeb 23
to Holly Poore, Genomic SEM Users
I think you might need to activate your conda environment in your slurm script? If you activate it outside it your be activating it on the login node not the node your job will run o this might vary from hpc to hof environment…

Best,
Michel

Op vr 23 feb. 2024 om 19:19 schreef Holly Poore <hollyb...@gmail.com>

Holly Poore

unread,
Feb 23, 2024, 2:13:08 PMFeb 23
to Genomic SEM Users
I tried activating the environment in the sbatch script like this:

module purge

eval "$(conda shell.bash hook)"

conda activate my-env

R CMD BATCH --no-restore --no-save GWAS_750_job.R



and still get discrepant results. Is that what you meant?

Thanks,
Holly

Reply all
Reply to author
Forward
0 new messages