Learn R Programming

CSeQTL (version 1.0.0)

CSeQTL_GS: CSeQTL_GS

Description

Main function that performs eQTL mapping on one gene with its associated SNPs.

Usage

CSeQTL_GS(
  XX,
  TREC,
  SNP,
  hap2,
  ASREC,
  PHASE,
  RHO,
  trim = TRUE,
  thres_TRIM = 20,
  numAS = 5,
  numASn = 5,
  numAS_het = 5,
  cistrans = 0.01,
  ncores = 1,
  show = TRUE
)

Value

A R list of statistics and metrics after optimizing the model across multiple SNPs. The list contains parameter MLEs, gene expression estimates, fold change estimates, convergence indicators, likelihood ratio test statistics, and associated p-values.

Arguments

XX

A numeric design matrix of baseline covariates including the intercept in the first column and centered continuous covariates. One of the non-intercept columns should correspond to centered log-transformed library size. The rownames(XX) needs to be specified.

TREC

An integer vector containing one gene's total read counts. The names(TREC) needs to be specified.

SNP

A nonnegative integer matrix with genotypes. Values should be coded 0, 1, 2, 3, 5 for genotypes AA, AB, BA, BB, NA, respectively. Rows correspond to SNPs and columns correspond to subjects. The rownames(SNP) needs to be specified.

hap2

An integer vector of the second haplotype's counts for the gene. The names(hap2) needs to be specified and match names(TREC).

ASREC

An integer vector of the total haplotype counts (ASReC) for the gene. The names(ASREC) needs to be specified and match names(TREC).

PHASE

A binary 0/1 vector indicating if haplotype counts for the gene will be used. The names(PHASE) needs to be specified and match names(TREC).

RHO

A numeric matrix of cell type proportions. Rows correspond to subjects and columns correspond to cell types. The rownames(RHO) needs to be specified and match names(TREC). The colnames(RHO) also needs to be specified.

trim

Boolean value set to FALSE by default to prevent outcome trimming. If TRUE, the CSeQTL model will be fitted without SNP genotype to calculate each subject's Cooks' distance for the gene.

thres_TRIM

A positive numeric value to perform subject outcome trimming. Subjects with standardized Cooks' Distances greater than the threshold are trimmed.

numAS

A positive integer to determine if a subject has enough total haplotype counts.

numASn

A positive integer to determine how many subjects have at least numAS to use the haplotype counts.

numAS_het

A positive integer to determine how many subjects with at least numAS are heterozygous (AB or BA). If sum(PHASE == 1 & ASREC >= numAS & (SNP == 1 | SNP == 2)) >= numAS_het, those subjects haplotype counts will be used for TReCASE and cis/trans testing and estimation.

cistrans

A numeric value specifying the cis/trans test p-value cutoff to determine if the eQTLs from TReC-only or TReCASE model is reported.

ncores

A positive integer specifying the number of threads available to decrease computational runtime when performing trimming and looping through SNPs.

show

A boolean value to display verbose output.