Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bed_autoSVD PC number calculation error? #530

Open
gradsmjin814 opened this issue Dec 25, 2024 · 3 comments
Open

bed_autoSVD PC number calculation error? #530

gradsmjin814 opened this issue Dec 25, 2024 · 3 comments

Comments

@gradsmjin814
Copy link

obj.bed=bed(YOBP_OE_cox_bed)
|--------------------------------------------------|
|==================================================|
obj.svd <- runonce::save_run(

  • bed_autoSVD(obj.bed, k=20, ncores=nb_cores(),min.maf=0.01, min.mac=10),
  • file=paste0(SWE_OE, "_YOBP_OE_cox_tmp_PCA.rds")
  • )
    user system elapsed
    1931.089 19.170 2921.727

PC<-predict(obj.svd); head(PC)
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] -15.339625 -0.6784555 4.219289 -4.806412 17.0022308 -3.276986 -9.4454624 1.886276
[2,] -18.129878 -5.1819836 1.729590 -10.008311 14.5715798 2.004858 -1.8473338 -3.185667
[3,] -8.836365 -0.3806917 8.346467 -5.900797 -4.0331445 -9.286730 2.1223432 7.873380
[4,] -8.545034 1.8428507 2.147583 -3.161611 -7.6413284 -9.879551 7.4082319 4.351154
[5,] -13.234423 -0.5214976 6.259730 -10.428578 5.5295740 -10.062408 -11.1693163 -6.209751
[6,] -13.033614 -4.3277959 8.582236 -9.232543 -0.7709548 7.052743 0.6112591 -5.495643
[,9] [,10]
[1,] -14.0802928 20.2251012
[2,] -11.4811502 2.1643478
[3,] -13.9776866 0.5716711
[4,] 0.7564992 -3.1917674
[5,] -4.8962562 -0.2635853
[6,] -12.6963200 -1.6274658

Not sure why it only gives me PC scores up to 10 when I ordered the SVD for 20?

@privefl
Copy link
Owner

privefl commented Dec 26, 2024

Are you sure you didn't previously run this with k=10, and save_run() stored and is reusing that older result?

@gradsmjin814
Copy link
Author

gradsmjin814 commented Dec 26, 2024 via email

@privefl
Copy link
Owner

privefl commented Dec 27, 2024

If the rds file already exists, it just uses it.
You'll have to remove the file yourself if you want to run some new code.

I can probably add a TIME attribute in next versions to give information on when this was computed and stored, if that helps.
And also maybe a warning if code has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants