|
a |
|
b/man/GPROB.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/gprob.R |
|
|
3 |
\name{GPROB} |
|
|
4 |
\alias{GPROB} |
|
|
5 |
\title{GPROB} |
|
|
6 |
\usage{ |
|
|
7 |
GPROB(prevalence, or, geno) |
|
|
8 |
} |
|
|
9 |
\arguments{ |
|
|
10 |
\item{prevalence}{A numeric vector with prevalence of each phenotype in the population.} |
|
|
11 |
|
|
|
12 |
\item{or}{A matrix with odds ratios for each phenotype (column) and genetic variant (row).} |
|
|
13 |
|
|
|
14 |
\item{geno}{A matrix with risk allele counts for each person (row) and genetic variant (column).} |
|
|
15 |
} |
|
|
16 |
\value{ |
|
|
17 |
A list with the population-level probabilities for each person to |
|
|
18 |
have each phenotype, and the conditional probabilities, assuming that each |
|
|
19 |
person has one of the phenotypes. |
|
|
20 |
} |
|
|
21 |
\description{ |
|
|
22 |
Many diseases may have similar presentations in the clinic. By |
|
|
23 |
using genetic information, it may sometimes be possible to prioritize some |
|
|
24 |
diagnoses over others. GPROB implements calculations of genetic probability |
|
|
25 |
from genotypes and effect sizes for genetic variants associated with |
|
|
26 |
diseases. |
|
|
27 |
} |
|
|
28 |
\examples{ |
|
|
29 |
prevalence <- c("RA" = 0.001, "SLE" = 0.001) |
|
|
30 |
or <- read.delim( |
|
|
31 |
sep = "", |
|
|
32 |
row.names = 1, |
|
|
33 |
text = " |
|
|
34 |
snp RA SLE |
|
|
35 |
SNP1 1.0 0.4 |
|
|
36 |
SNP2 1.0 0.9 |
|
|
37 |
SNP3 1.0 1.3 |
|
|
38 |
SNP4 0.4 1.6 |
|
|
39 |
SNP5 0.9 1.0 |
|
|
40 |
SNP6 1.3 1.0 |
|
|
41 |
SNP7 1.6 1.0 |
|
|
42 |
") |
|
|
43 |
or <- as.matrix(or) |
|
|
44 |
geno <- read.delim( |
|
|
45 |
sep = "", |
|
|
46 |
row.names = 1, |
|
|
47 |
text = " |
|
|
48 |
id SNP1 SNP2 SNP3 SNP4 SNP5 SNP6 |
|
|
49 |
1 0 1 0 2 1 0 |
|
|
50 |
2 0 0 1 0 2 2 |
|
|
51 |
3 1 0 1 1 0 2 |
|
|
52 |
4 1 1 0 2 0 0 |
|
|
53 |
5 0 1 1 1 1 0 |
|
|
54 |
6 0 0 1 3 0 2 |
|
|
55 |
7 2 2 2 2 2 2 |
|
|
56 |
8 1 2 0 2 1 1 |
|
|
57 |
9 0 2 1 NA 1 2 |
|
|
58 |
10 1 0 2 2 2 0 |
|
|
59 |
") |
|
|
60 |
geno <- as.matrix(geno) |
|
|
61 |
ix <- apply(geno, 1, function(x) !any(is.na(x))) |
|
|
62 |
geno <- geno[ix,] |
|
|
63 |
ix <- apply(geno, 1, function(x) !any(x < 0 | x > 2)) |
|
|
64 |
geno <- geno[ix,] |
|
|
65 |
or <- or[colnames(geno),] |
|
|
66 |
GPROB(prevalence, or, geno) |
|
|
67 |
} |
|
|
68 |
\references{ |
|
|
69 |
{ |
|
|
70 |
\insertRef{Knevel2020}{GPROB} |
|
|
71 |
} |
|
|
72 |
} |