Giter VIP home page Giter VIP logo

jwasr's Introduction

JWASr

Installation

  1. Install Julia.

  2. Install R and RStudio (IDE).

  3. Install prerequisite R package JuliaCall and devtools in R.

    install.packages("JuliaCall")
    install.packages("devtools")

    If the error massage Installation failed: Command failed (50) is shown, please install the latest version of devtools as devtools::install_github("hadley/devtools").

  4. Install R package JWASr in R

    devtools::install_github("zhaotianjing/JWASr")

Set up

Please set up every time you start a new session of R. The set up time is about 10 seconds.

  • Mac or Linux users

    JWASr::jwasr_setup()
  • Windows users

    # please change to your local path of libjulia.dll
    path_libjulia = "C:/Users/ztjsw/AppData/Local/Julia-1.0.1/bin/libjulia.dll"
    JWASr::jwasr_setup_win(path_libjulia)

    If R session aborted, please click "Start New Session" and set up again.

Workflow

Note that all data can be found in our subfolder named "data".

Step 1: Load Package

library("JWASr")

Please make sure you've already set up.

Step 2: Read data

phenotypes = phenotypes #build-in data

ped_path = "D:\\JWASr\\data\\pedigree.txt" #please change to your local path
pedigree = get_pedigree(ped_path, separator = ',', header = TRUE)  

You can import your own data by read.table().

Step 3: Build Model Equations

model_equation = "y1 = intercept + x1*x3 + x2 + x3 + ID + dam";
R = 1.0

model = build_model(model_equation,R)

Step 4: Set Factors or Covariate

set_covariate(model, "x1")

Step 5: Set Random or Fixed Effects

G1 = 1.0
set_random(model, "x2", G1)
G2 = diag(2)
set_random_ped(model, "ID dam", pedigree, G2)

Step 6: Use Genomic Information

G3 = 1.0
geno_path = "D:/JWASr/data/genotypes.txt"  #please change to your local path

add_genotypes(model, geno_path, G3, separator=',', header = TRUE)  

Step 7: Run Bayesian Analysis

outputMCMCsamples(model, "x2")
out = runMCMC(model, phenotypes, methods = "BayesC", estimatePi = TRUE,
                     chain_length = 5000, output_samples_frequency = 100)

For developers

If you change any function in subfolder "R", please run devtools::document() in R to update the package. (under path of JWASr).

GUI

In the package, we provide a user friendly Graphical User Interface application, which was build by shiny.

Installation

After complete installation above for JWAS, please also install shiny by install.packages("shiny") in R.

Usage

In R, please run:

JWASr::runShiny()

To-do list

  • script to install required packages if not installed
  • improve GUI interface
  • add the complete interface to JWAS.jl

jwasr's People

Contributors

zhaotianjing avatar reworkhow avatar

Stargazers

 avatar

Watchers

James Cloos avatar

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.