plink.lr: Logistic regression analysis

Description Usage Arguments Value Examples

View source: R/LogisticRegression.R

Description

A Function to perform logistic regression analysis given a case/control phenotype using PLINK 1.9.

Usage

1
2
3
4
5
6
7
8
9
plink.lr(
  input.dir,
  output.dir,
  genotype,
  phenotype = NULL,
  covar.number = NULL,
  plink.path = NULL,
  verbose = TRUE
)

Arguments

input.dir

[character] The full absolute path to the directory containing the training and test dataset. If input.dir is missing, the current working directory obtained by getwd() is used.

output.dir

[character] The full absolute path where the result will be written to. If output.dir is missing, the current working directory obtained by getwd() is used.

genotype

[character] The prefix of PLINK binary files (bed/bim/fam).

phenotype

[character] To specify an alternate phenotype for the logistic regression analysis using the "--pheno" flag in plink. This file must have a header row. The first and second columns of the phenotype file must be "FID" and "IID", the case/control phenotype in column 3 (1 = unaffected (control), 2 = affected (case)), and covariates in remaining columns. If phenotype is NULL, the original fam file must contain a phenotype in column 6. See the PLINK 1.9 documentation for details (https://www.cog-genomics.org/plink/1.9/).

covar.number

[vector] To specify a subset of column numbers of covariates to load from phenotype file using the "--covar-number" flag in plink. If NULL (the default), the logistic regression model without covariate adjustment.

plink.path

[character] The full absolute path to the PLINK executable file. The executable to run is path/to/plink.exe if you are on a Windows operating system, for Unix-like operating system this is path/to/plink. If plink.path is NULL, the PLINK PATH should be added as a system environment variable.

verbose

[logical] If TRUE, the PLINK log, error, and warning information are printed to standard out. The default value is TRUE.

Value

plink.lr returns a data frame with the results of logistic regression analysis derived from PLINK.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
input.dir <- system.file("extdata", package="pv")
output.dir <- system.file("extdata", package="pv")
path2plink <- '/path/to/plink'
## Not run: 
lr.result <- plink.lr(input.dir = input.dir,
output.dir = output.dir,
genotype = "train",
phenotype = "train.phenotypes.txt",
covar.number = c(2, 3),
plink.path = path2plink,
verbose = TRUE)

## End(Not run)

abnerzyx/pv documentation built on Feb. 27, 2022, 12:06 a.m.