forked from martintnr/PRISM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
82 lines (54 loc) · 1.88 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# PleioVar
<!-- badges: start -->
<!-- badges: end -->
PleioVar takes as input GWAS data and outputs pleiotropic labels for a list of variants.
## Installation
You can install the current version of PleioVar like so:
``` r
pkgs = c("data.table", "dplyr", "devtools","stats", "stringr", "parallel", "matrixStats")
pkgs.na = pkgs[!pkgs %in% installed.packages()[, "Package"]]
if (length(pkgs.na) > 0) {
install.packages(pkgs.na)
}
if(!"PleioVar" %in% installed.packages()[, "Package"]) {
devtools::install_github("martintnr/PleioVar")
}
```
## Example
This is a basic example to obtain pleiotropic labels from GWAS summary statistics.
Parameters obtained from LHC-MR, LDscores of all variants, and simulated GWAS ZScores are already included.
You should specify the NbCores parameters if your computer can handle parallel computations.
```{r example, eval = FALSE}
library(data.table)
library(dplyr)
library(stats)
library(stringr)
library(parallel)
library(matrixStats)
library(PleioVar)
if(!file.exists("PleioVar_example/")){system("mkdir PleioVar_example")}
setwd("PleioVar_example")
Prepare_example_data(gzip = T)
ParametersTable <- fread("Data/ParametersTable.csv", header = T, sep = ",")
Index <- fread("Data/Index.csv", header = T, sep = ",")
ListofTraits <- unique(c(ParametersTable$X, ParametersTable$Y))
PleioVar_main(ListofTraits, ParametersTable, Index , NbCores = 1, gzip = T)
```
In the Results/ folder can be found, for each trait, a file with variants, p-values from PleioVar, and pleiotropy annotation.
```{r graph, eval = FALSE}
library(ggplot2)
Graph <- Example_graph(Trait = "B4")
print(Graph)
```