Git Product home page Git Product logo

variancecomponentmodels.jl's Introduction

VarianceComponentModels

Documentation Build Status Code Coverage
Build Status Build status Coverage Status codecov

This Julia package provides computational routines for fitting and testing variance component models. VarianceComponentModels is one package of the umbrella OpenMendel project.

Installation

This package requires Julia v0.7.0 or later, which can be obtained from https://julialang.org/downloads/ or by building Julia from the sources in the https://github.com/JuliaLang/julia repository.

This package is registered in the default Julia package registry, and can be installed through standard package installation procedure: e.g., running the following code in Julia REPL.

using Pkg
pkg"add VarianceComponentModels"

Citation

If you use OpenMendel analysis packages in your research, please cite the following reference in the resulting publications:

Zhou H, Sinsheimer JS, Bates DM, Chu BB, German CA, Ji SS, Keys KL, Kim J, Ko S, Mosher GD, Papp JC, Sobel EM, Zhai J, Zhou JJ, Lange K. OPENMENDEL: a cooperative programming project for statistical genetics. Hum Genet. 2020 Jan;139(1):61-71. doi: 10.1007/s00439-019-02001-z. Epub 2019 Mar 26. PMID: 30915546; PMCID: PMC6763373.

Acknowledgments

This project has been supported by the National Institutes of Health under awards R01GM053275, R01HG006139, R25GM103774, and 1R25HG011845.

variancecomponentmodels.jl's People

Contributors

ericsobel avatar github-actions[bot] avatar hua-zhou avatar jcpapp avatar jinjinzhou avatar juhkim111 avatar kose-y avatar msuchard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

variancecomponentmodels.jl's Issues

Obtaining cg10k data to follow tutorial

I am a beginner and trying to run Heritability analysis. I am reading the tutorial available and hoping that I could follow along with the tutorial. I am wondering where can I get the cg10k data to follow along with the tutorial.

Thanks,

Multiple variance components for univariate response

Hi,

Is it possible to fit models where Y is a n x 1 vector and V contains multiple covariance matrices? If not, would it be possible to add such functionality?

My application is that I want to model the data s a function several covariance matrices encoding both gentic and environmental similarity.

All the best,
Espen

Test failure on Julia 1.7 on Windows

chol_gradient: Test Failed at D:\a\VarianceComponentModels.jl\VarianceComponentModels.jl\test\multivariate_calculus_test.jl:87
  Expression: norm(dL1 - dL2) ≈ 0.0
   Evaluated: 5.551115123125783e-17 ≈ 0.0
Stacktrace:
 [1] macro expansion
   @ C:\hostedtoolcache\windows\julia\1.7.0\x64\share\julia\stdlib\v1.7\Test\src\Test.jl:445 [inlined]
 [2] macro expansion
   @ D:\a\VarianceComponentModels.jl\VarianceComponentModels.jl\test\multivariate_calculus_test.jl:87 [inlined]
 [3] macro expansion
   @ C:\hostedtoolcache\windows\julia\1.7.0\x64\share\julia\stdlib\v1.7\Test\src\Test.jl:1283 [inlined]
 [4] top-level scope
   @ D:\a\VarianceComponentModels.jl\VarianceComponentModels.jl\test\multivariate_calculus_test.jl:79

Looks like we would better change a ≈ b to something like isapprox(a, b; atol=eps()).

Variance component estimation for mixed model with 2 loci

Hi, Does VarianceComponentModels.jl, as it currently exists, permit the user to specify a model like:

vec(Y) ~ N(XB, Sigma)

where Y is a n by 2 matrix of (bivariate) phenotypes (and vec(Y) is a 2n-length vector), X is a known 2n by 2p matrix, B is a 2p-long vector, and Sigma is a 2n by 2n covariance matrix? I'm assuming that the covariance matrix Sigma = Sigma1 \otimes V1 + Sigma2 \otimes V2, where

Sigma1 & Sigma2 are known n by n matrices and V1 and V2 are unknown 2 by 2 matrices. I'd like to estimate V1, V2, and B.

If this isn't currently implemented, can you provide any suggestions as to how I might build on your existing code to implement it?

Much thanks!

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Julia version 1.0.1 support

Hi all,
As far as I know, the current package can't be used in Julia 1.0.1. However, I am wondering whether you might upgrade the package for Julia 1.0.1 soon. Could you please let me know about it? Thanks in advance!

Pkg.clone format listed requires public/private key

I think the format you list in your documentation under installation
Pkg.clone("[email protected]:OpenMendel/VarianceComponentModels.jl.git")
requires a public/private key set-up with github.

I think the alternate format
Pkg.clone("https://github.com/OpenMendel/VarianceComponentModels.jl.git")
would be better. It has the same basic functionality and can be run by anyone. Of course, since it does not require a public/private key, it is not as secure.

mle_reml_ipynb fails when increasing dimension from 2 to 3

Trying to increase the dimension of the problem from 2 to 3 as follows:

generate data from a d-variate response variance component model
using Random, LinearAlgebra
Random.seed!(123)
n = 1000 # no. observations
d = 3 # dimension of responses
m = 3 # no. variance components
p = 3 # no. covariates

X = randn(n, p)

Step 3 model fit:

vcmodel_mle = deepcopy(vcmodel)
@time logl, vcmodel_mle, Σse, Σcov, Bse, Bcov = fit_mle!(vcmodel_mle, vcdata; algo = :MM);

fails:

MethodError: no method matching TwoVarCompVariateRotate(::VarianceComponentVariate{Float64,3,Array{Float64,2},Array{Float64,2},Array{Float64,2}})
Closest candidates are:
TwoVarCompVariateRotate(!Matched::Array{T<:VarianceComponentVariate,N} where N) where T<:VarianceComponentVariate at C:\Users\Denis.julia\packages\VarianceComponentModels\6qDHu\src\VarianceComponentModels.jl:261
TwoVarCompVariateRotate(!Matched::YT<:(Union{AbstractArray{T,2}, AbstractArray{T,1}} where T), !Matched::XT<:(Union{AbstractArray{T,2}, AbstractArray{T,1}} where T), !Matched::Array{T<:AbstractFloat,1}, !Matched::Array{T<:AbstractFloat,2}, !Matched::T<:AbstractFloat) where {T<:AbstractFloat, YT<:(Union{AbstractArray{T,2}, AbstractArray{T,1}} where T), XT<:(Union{AbstractArray{T,2}, AbstractArray{T,1}} where T)} at C:\Users\Denis.julia\packages\VarianceComponentModels\6qDHu\src\VarianceComponentModels.jl:189
TwoVarCompVariateRotate(!Matched::Union{AbstractArray{T,2}, AbstractArray{T,1}} where T, !Matched::Union{AbstractArray{T,2}, AbstractArray{T,1}} where T, !Matched::Array{T,1} where T, !Matched::Array{T,2} where T, !Matched::Real) at C:\Users\Denis.julia\packages\VarianceComponentModels\6qDHu\src\VarianceComponentModels.jl:209
...

Stacktrace:
[1] #fit_mle!#31(::Symbol, ::Function, ::VarianceComponentModel{Float64,3,Array{Float64,2},Array{Float64,2}}, ::VarianceComponentVariate{Float64,3,Array{Float64,2},Array{Float64,2},Array{Float64,2}}) at C:\Users\Denis.julia\packages\VarianceComponentModels\6qDHu\src\two_variance_component.jl:1207
[2] (::getfield(VarianceComponentModels, Symbol("#kw##fit_mle!")))(::NamedTuple{(:algo,),Tuple{Symbol}}, ::typeof(fit_mle!), ::VarianceComponentModel{Float64,3,Array{Float64,2},Array{Float64,2}}, ::VarianceComponentVariate{Float64,3,Array{Float64,2},Array{Float64,2},Array{Float64,2}}) at .\none:0
[3] top-level scope at util.jl:156
[4] top-level scope at In[10]:2

Handle multiple (>= 3) variance components?

Thank you for the wonderful package. Things seem to run nicely. I have a couple questions.

  1. It appears that the package only handles up to two variance components, whether be it univariate or multivariate? Is there a plan to expand to handle more than 3 variance components?

  2. What would be the appropriate way of doing inference for these variance components? I imagine for univariate case, you can fit a null model without the variance component of interest, and running some variation of likelihood ratio test as done in GCTA, but would you recommend a different way? Also for multivariate cases, where you have the covariance parameters, is there a way to easily fit the null model with such a term set to zero, and run LRT?

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.