Error in { :
task 1 failed - "system is computationally singular: reciprocal condition number = 2.94596e-10"
Calls: commonfactorGWAS -> %dopar% -> <Anonymous>
Execution halted
I've tried fixing the issue with LDSC matrix adjustments before running the model, and changing the toler parameters but I cant seem to fix the problem.
library(devtools)
library(GenomicSEM)
library(parallel)
# Load LDSC structure
load("LDSC_INT.RData")
LDSC_INT$V <- LDSC_INT$V + diag(1e-6, nrow(LDSC_INT$V))
# Load chromosome-specific summary statistics
sumstats_file <- paste0("CWP_ATHEROSCLEROSIS_sumstats_chr22.RData")
load(sumstats_file) # Load the per-chromosome sumstats
# Specify the model
model <- "F1 =~ CWP + Atherosclerosis
F1 ~ SNP"
# Run Common Factor GWAS for this chromosome
CWP_Atherosclerosis_factor <- commonfactorGWAS(
covstruc = LDSC_INT,
SNPs = chr_data,
cores = 120,
smooth_check = TRUE,
parallel = TRUE,
toler = 1e-6
)
# Save results per chromosome
save_file <- paste0("CWP_Atherosclerosis_factor_chr22.RData")
save(CWP_Atherosclerosis_factor, file = save_file)
# Save summary to text file
sink(paste0("CWP_Atherosclerosis_factor_chr22_summary.txt"))
summary(CWP_Atherosclerosis_factor)
sink()
My LDSC matrix output looks like this
> print(LDSC_INT)
$V
[,1] [,2] [,3]
[1,] 8.073432e-04 -3.825977e-05 8.615926e-07
[2,] -3.825977e-05 1.287388e-04 9.360435e-06
[3,] 8.615926e-07 9.360435e-06 2.603861e-04
$S
CWP Atherosclerosis
[1,] 0.33262723 -0.08408001
[2,] -0.08408001 0.17893645
$I
[,1] [,2]
[1,] 1.00136917 -0.02388809
[2,] -0.02388809 1.01218723
$N
[,1] [,2] [,3]
[1,] 249843 300402.7 361194
$m
[1] 1173569
At the moment, im trying to run the script again but with parallel = FALSE to see if the issue is stemming from that, but if theres something obvious that im missing that you can help me with id really appreciate it!
Best, wishes and thanks in advance,
Dúalta
--
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 visit https://groups.google.com/d/msgid/genomic-sem-users/fb2be117-bb60-4b66-b7f0-d9a78f621c4cn%40googlegroups.com.