process.locus: Process locus info

View source: R/input_processing.R

process.locusR Documentation

Process locus info

Description

Processes the summary statistics for all phenotypes within the specified locus and computes all parameters necessary for analysis.

Usage

process.locus(
  locus,
  input,
  phenos = NULL,
  min.K = 2,
  prune.thresh = 99,
  max.prop.K = 0.75,
  drop.failed = T
)

Arguments

input

Input object created with the process.input function, containing relevant summary statistics and related info (e.g. sample overlap, case/control ratio)

phenos

Subset of phenotypes from the input object to process. If NULL (default), all phenotypes will be processed

min.K

Minimum number of PCs required to process locus (cannot be less than two). If this criterion is not met, the function will fail and the locus cannot be analysed.

prune.thresh

PC pruning threshold governing the maximum number of PCs to retain.

max.prop.K

Upper bound on retained number of PCs as proportion of lowest sample size of input data.

drop.failed

Determines if failed phenotypes are removed from the output object (default) or retained. PCs are selected as such that the cumulative proportion of variance explained is at least that of the threshold (set to 99 percent by default).

loc

Locus info for a single locus, obtained using the read.loci function. Expects a locus ID ('LOC') together with locus coordinates ('CHR', 'START', 'STOP') and/or a ';' separated SNP list ('SNPS')

Value

Returns an environment containing general locus info, the processed locus related sumstats, and parameters required for analysis. If the function fails (e.g. due to too few SNPs), it will return NULL. If processing fails for specific phenotypes, only the successful phenotypes will be returned (unless the drop.failed argument is set to true).

  • id - locus ID

  • chr / start / stop - locus coordinates

  • snps - list of locus SNPs

  • n.snps - number of SNPs within locus

  • K - number of PCs retained

  • delta - PC projected joint SNP effects

  • sigma - sampling covariance matrix

  • omega - genetic covariance matrix

  • omega.cor - genetic correlation matrix

  • N - vector of average N across locus SNPs for each phenotype

  • phenos - phenotype IDs

  • binary - boolean vector indicating whether phenotypes are binary

  • h2.obs - observed local heritability

  • h2.latent - estimated local population heritability (only relevant for binary phenotypes; requires population prevalence to be specified in the input info file)

  • failed - boolean vector indicating whether phenotypes failed during processing (only present if drop.failed=F)


josefin-werme/LAVA documentation built on July 4, 2024, 8:11 p.m.