--- a +++ b/man/GPROB.Rd @@ -0,0 +1,72 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/gprob.R +\name{GPROB} +\alias{GPROB} +\title{GPROB} +\usage{ +GPROB(prevalence, or, geno) +} +\arguments{ +\item{prevalence}{A numeric vector with prevalence of each phenotype in the population.} + +\item{or}{A matrix with odds ratios for each phenotype (column) and genetic variant (row).} + +\item{geno}{A matrix with risk allele counts for each person (row) and genetic variant (column).} +} +\value{ +A list with the population-level probabilities for each person to +have each phenotype, and the conditional probabilities, assuming that each +person has one of the phenotypes. +} +\description{ +Many diseases may have similar presentations in the clinic. By +using genetic information, it may sometimes be possible to prioritize some +diagnoses over others. GPROB implements calculations of genetic probability +from genotypes and effect sizes for genetic variants associated with +diseases. +} +\examples{ +prevalence <- c("RA" = 0.001, "SLE" = 0.001) +or <- read.delim( + sep = "", + row.names = 1, + text = " +snp RA SLE +SNP1 1.0 0.4 +SNP2 1.0 0.9 +SNP3 1.0 1.3 +SNP4 0.4 1.6 +SNP5 0.9 1.0 +SNP6 1.3 1.0 +SNP7 1.6 1.0 +") +or <- as.matrix(or) +geno <- read.delim( + sep = "", + row.names = 1, + text = " +id SNP1 SNP2 SNP3 SNP4 SNP5 SNP6 + 1 0 1 0 2 1 0 + 2 0 0 1 0 2 2 + 3 1 0 1 1 0 2 + 4 1 1 0 2 0 0 + 5 0 1 1 1 1 0 + 6 0 0 1 3 0 2 + 7 2 2 2 2 2 2 + 8 1 2 0 2 1 1 + 9 0 2 1 NA 1 2 +10 1 0 2 2 2 0 +") +geno <- as.matrix(geno) +ix <- apply(geno, 1, function(x) !any(is.na(x))) +geno <- geno[ix,] +ix <- apply(geno, 1, function(x) !any(x < 0 | x > 2)) +geno <- geno[ix,] +or <- or[colnames(geno),] +GPROB(prevalence, or, geno) +} +\references{ +{ +\insertRef{Knevel2020}{GPROB} +} +}