Git Product home page Git Product logo

lfa's Introduction

lfa

Logistic factor analysis

Installation

To install latest version on Bioconductor, open R and type:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("lfa")

You can also install development version from GitHub this way:

install.packages("devtools")
library("devtools")
install_github("Storeylab/lfa")

Apple OS X users, see Troubleshooting below.

Data input

We recommend using the genio or BEDMatrix packages to read genotype data into an R matrix.

Be warned that genotype matrices from genio and some lfa functions require a lot of memory. As a rule of thumb, the in memory sizes of a few relevant genotype matrices:

  • 431345 SNPs by 940 individuals: 1.5 GB needed for genotype matrix, about 9 GB to run lfa.
  • 339100 SNPs by 1500 individuals: 1.9 GB needed for genotype matrix, about 11.5 GB to run lfa.

BEDMatrix inputs consume much less memory but can be slower otherwise.

Troubleshooting

Apple OS X users may experience a problem due to Fortran code that is included in this package. You must install the X code command line tools (XCode CLI) and gfortran. Try the following commands on terminal:

xcode-select --install 
brew install gcc

If XCode installation fails, you may have to sign up on Apple Developer: https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/macxcodecommandlinetools.html

Alternatively, this Installer Package for macOS R toolchain may work https://github.com/rmacoslib/r-macos-rtools/

Citations

Hao, Wei, Minsun Song, and John D. Storey. "Probabilistic Models of Genetic Variation in Structured Populations Applied to Global Human Studies." Bioinformatics 32, no. 5 (March 1, 2016): 713–21. doi:10.1093/bioinformatics/btv641. arXiv.

lfa's People

Contributors

alexviiia avatar jdstorey avatar jwokaty avatar ncchung avatar whao89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lfa's Issues

fix factors

Hello,

I hope is all is well! Is it possible in the lfa package to fix a few factors for all individuals and estimate the remaining factors?

Thanks,

Joe

1.28.2: compile error

* installing *source* package ‘lfa’ ...
** using staged installation
** libs
using C compiler: ‘gcc (GCC) 12.2.1 20230201’
gcc -I"/usr/include/R/" -DNDEBUG   -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c fastmat.c -o fastmat.o
gcc -I"/usr/include/R/" -DNDEBUG   -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c lfa-init.c -o lfa-init.o
gcc -I"/usr/include/R/" -DNDEBUG   -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c lfa.c -o lfa.o
gcc -I"/usr/include/R/" -DNDEBUG   -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c lreg.c -o lreg.o
In file included from /usr/include/R/R.h:78,
                 from lfa.h:4,
                 from fastmat.c:1:
fastmat.c: In function ‘mv’:
fastmat.c:22:14: error: too few arguments to function ‘dgemv_’
   22 |     F77_CALL(dgemv)(&tr,dimA,dimA+1,&alpha,A,dimA,v,&one,&zero,ret,&one);
      |              ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:10: note: declared here
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      |          ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:1: note: in expansion of macro ‘F77_NAME’
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      | ^~~~~~~~
fastmat.c: In function ‘tmv’:
fastmat.c:48:14: error: too few arguments to function ‘dgemv_’
   48 |     F77_CALL(dgemv)(&tr,dimA,dimA+1,&alpha,A,dimA,v,&one,&zero,ret,&one);
      |              ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:10: note: declared here
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      |          ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:1: note: in expansion of macro ‘F77_NAME’
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      | ^~~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:191: fastmat.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /usr/include/R/R.h:78,
                 from lfa.h:4,
                 from lreg.c:1:
lreg.c: In function ‘lreg’:
lreg.c:49:18: error: too few arguments to function ‘dgemv_’
   49 |         F77_CALL(dgemv)(&tr,dimX,dimX+1,&alpha,X,dimX,b,&ione,&zero,p,&ione);
      |                  ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:10: note: declared here
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      |          ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:1: note: in expansion of macro ‘F77_NAME’
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      | ^~~~~~~~
lreg.c:120:18: error: too few arguments to function ‘dgemv_’
  120 |         F77_CALL(dgemv)(&tr,dimX+1,dimX+1,&one,w,dimX+1,f,&ione,&one,b,&ione);
      |                  ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:10: note: declared here
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      |          ^~~~~
/usr/include/R/R_ext/RS.h:77:25: note: in definition of macro ‘F77_CALL’
   77 | # define F77_CALL(x)    x ## _
      |                         ^
/usr/include/R/R_ext/BLAS.h:107:1: note: in expansion of macro ‘F77_NAME’
  107 | F77_NAME(dgemv)(const char *trans, const int *m, const int *n,
      | ^~~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:191: lreg.o] Error 1
ERROR: compilation failed for package ‘lfa’
* removing ‘/build/r-lfa/src/lfa’
* restoring previous ‘/build/r-lfa/src/lfa’

trunc.svd and center not export

I noticed that trunc.svd and center have roxygen2 documentation but are not exported ... Are you going to export these functions? If not, I will just copy and paste the code and source the lfa package.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.