GithubHelp home page GithubHelp logo

chris1221 / prs Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 8.0 11.13 MB

Toolkit for the efficient construction and analysis of polygenic risk scores in R.

Home Page: https://chris1221.gitbooks.io/polygenic-risk-scores-in-r/content/

License: MIT License

R 62.44% Makefile 7.64% HTML 2.74% C++ 18.45% TeX 7.70% Shell 1.03%
polygenic-risk-scores genetics plink

prs's Introduction

pRs: Polygenic Risk Score Toolkit in R

NOTE: This project was started and never totally finished, however there still may be some useful code here should you wish to adopt it for your own projects. I've left the repository here archived however please be aware that I'm not maintaining it, and provide no guarentee of its functionality.


This package has been designed to work on large datasets in a computationally efficient manner. We introduce

  • A more efficient (and natively coded) method for finding optimal polygenic risk scores improving on PRSice able to be run on a laptop.
  • A novel method for aggregate co-morbid PRS (acmPRS) and optimal co-morbid PRS (ocmPRS) as presented in the companion article.
  • Convenience tools to quickly (faster than read.table, fread, or any existing strategy) read large genetic data into R.
  • A toolkit including various options for PRS construction and analysis.

Quick Start

pRs is currently under development and not indexed by CRAN. As such, you may install directly from Github. Keep in mind that there may be errors, though we would be pleased to help you use the software at any stage.

devtools::install_github("Chris1221/pRs")

The package has the following main high level functions:

  • make_prs(): Construct a simple PRS
  • make_optimal_prs(): Construct an Optimal PRS. Returns the optimal score and diagnostic figures along with association statistics. Similar output to PRSice.
  • make_comorbid_prs(): Construct an (optionally optimal) comorbid PRS for arbitrary number of traits.
  • read_plink(): Quickly read a binary genetic file into R.

There are accompanying low level C++ functions which may directly be accessed for advanced users. Please see the wiki for interactig with the API.

  • prs(): Reads a binary file and constructs a PRS with a given arma::mat of weights.
  • plink2r(): Low level interface to plink reading.

prs's People

Contributors

chris1221 avatar gitter-badger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

prs's Issues

[Fix later] Dirty workaround for reading byte-wise

This is currently working

        char c;

        while (in.get(c)) {

//              char c;
//              in.get(c);

But it's very dirty. Kind of like an analogue to while( in >> c); which does not work. This prevents the duplicated last byte, but at what cost? Come back to this at a later point and make sure it's safe.

installing pRs returns error - DESCRIPTION file

Hi,
I tried to install pRs according to your instructions (using devtools), please see code in the bottom:
used R version: RGui (32-bit) 3.4.3
It returns the error: Invalid DESCRIPTION file

I tested devtools with "swirldev/swirl", which installed this package.

I also tried to download the zip files, unzip, change the DESCRIPTION file (deleted one "cre"), rezip with the 7-Zip file Manager and enter the following code in [R]:
setwd("C:/Users/Desktop/")
unzip("pRs-master.zip")
file.rename("pRs-master", "pRs")
shell("R CMD build pRs")
The pRs files were generated but the last command failed to create a tarball version that I could have installed.

Is there any workaround?

Kind regards,
Ruser22

The first code that I used and the error:
library(devtools)
devtools::install_github("Chris1221/pRs")
Downloading GitHub repo Chris1221/pRs@master
from URL https://api.github.com/repos/Chris1221/pRs/zipball/master
Installing pRs
"C:/PROGRA1/R/R-341.3/bin/i386/R" --no-site-file --no-environ --no-save
--no-restore --quiet CMD INSTALL
"C:/Users/username/AppData/Local/Temp/RtmpmW1bCt/devtools51879ea37f6/Chris1221-pRs-4659db8"
--library="C:/Users/username/Documents/R/win-library/3.4" --install-tests

  • installing source package 'pRs' ...
    Error : Invalid DESCRIPTION file

Authors@R field gives more than one person with maintainer role:
Christopher Cole [email protected] [aut, cre]
Frank Dudbridge [email protected] [aut, cre]

See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.

ERROR: installing package DESCRIPTION failed for package 'pRs'

  • removing 'C:/Users/username/Documents/R/win-library/3.4/pRs'
  • restoring previous 'C:/Users/username/Documents/R/win-library/3.4/pRs'
    In R CMD INSTALL
    Installation failed: Command failed (1)
    Warning message:
    GitHub repo contains submodules, may not function as expected!

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.