Package 'omics'

Title: '--omics' Data Analysis Toolbox
Description: A collection of functions to analyse '--omics' datasets such as DNA methylation and gene expression profiles.
Authors: Gianluca Campanella [aut, cre]
Maintainer: Gianluca Campanella <[email protected]>
License: GPL (>= 2)
Version: 0.1-5
Built: 2024-11-15 04:06:25 UTC
Source: https://github.com/cran/omics

Help Index


Cross Phenotype Meta-Analysis

Description

Performs (signed) cross phenotype meta-analysis.

Usage

cpma(ps)

Arguments

ps

a (non-empty) numeric vector of pp-values.

Value

A list with class htest containing the following components:

statistic

the value of the χ2\chi^2 test statistic.

parameter

the estimated rate λ\lambda.

p.value

the pp-value for the test.

method

a character string indicating the type of test performed.

data.name

a character string giving the name of the data.

References

Cotsapas, C., et al. 2011 Pervasive Sharing of Genetic Effects in Autoimmune Disease. PLOS Genetics 7(8):e1002254.


Multiple Linear Models

Description

Fits multiple linear models.

Usage

mlm(formula, data, vars, save.residuals=FALSE)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the models to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

vars

a character vector of variables of interest.

save.residuals

whether model residuals should be stored and returned.

Value

A list with elements:

coefficients

if 'vars' is missing or non-empty, an array (or data frame, if vars contains a single element) of regression coefficient estimates (coef), standard errors (coef.se), and corresponding pp-values (pval).

residuals

if save.residuals is TRUE, a matrix of model residuals.

See Also

lm

Examples

coefs <- matrix(runif(6*10), 6, 10)
    X <- matrix(rnorm(100*5), 100, 5)
    Y <- cbind(1, X) 

    models <- mlm(Y ~ X)
    str(models)

Multiple Linear Mixed-Effects Models

Description

Fits multiple linear mixed-effects models.

Usage

mlmer(formula, data, vars, lrt=TRUE, save.residuals=FALSE, save.ranks=TRUE)

Arguments

formula

an object of class formula (or one that can be coerced to that class): a symbolic description of the models to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

vars

a character vector of variables of interest.

lrt

whether pp-values should be computed using likelihood-ratio tests.

save.residuals

whether model residuals should be stored and returned.

save.ranks

whether random effect ranks should be stored and returned.

Value

A list with elements:

coefficients

if 'vars' is missing or non-empty, an array (or data frame, if vars contains a single element) of regression coefficient estimates (coef), standard errors (coef.se), and corresponding pp-values (pval).

residuals

if save.residuals is TRUE, a matrix of model residuals.

ranef.ranks

if save.ranks is TRUE (default), a list of rank matrices (one per random effect) that can be visualized using ranks.heatmap.

See Also

lmer and mlm


Count Missing Values

Description

Counts the number of missing values.

Usage

na.count(X, margin, fraction=TRUE)

Arguments

X

an array, including a matrix.

margin

a vector giving the subscripts to count over.

fraction

whether to return the fraction of missing values.

Value

The number (or fraction) of missing values.


Quantile-Quantile Plot for pp-values

Description

Computes value to produce a quantile-quantile plot in log10-log_10 scale of the given pp-values.

Usage

pqq(ps)

    pqq.ci(n, level=0.95)

Arguments

ps

a (non-empty) numeric vector of pp-values.

n

number of pp-values.

level

significance level.

Value

For pqq, a list containing the following components (all in log10-log_10 scale):

x

a vector of (sorted) expected pp-values.

y

a vector of (sorted) observed pp-values.

For pqq.ci, a matrix with the lower and upper bounds for the confidence interval at the given significance level.


Extract Random Effect Rank Distributions

Description

Extracts random effect rank distributions from a linear mixed-effects model.

Usage

## S3 method for class 'merMod'
ranef.ranks(model, groups)

Arguments

model

a linear mixed-effects model estimated using lmer.

groups

a character vector of random effects of interest.

Value

If which is missing, a list of rank distribution vectors for all random intercepts in the model. Otherwise, a list of rank distribution vectors for random intercepts specified by which.

See Also

mlmer


Plot Random Effect Rank Distributions

Description

Plots the rank distribution matrix for a random effect generated by mlmer.

Usage

ranks.heatmap(x, col="red")

Arguments

x

a matrix with the rank distribution for a random effect generated by mlmer.

col

the color corresponding to "higher-than-expected" counts.

Side Effects

Generates a new plot.

See Also

mlmer


Pattern Matching and Extraction

Description

Matches and extracts substrings using regular expressions.

Usage

re.match(pattern, x, ...)

Arguments

pattern

character string containing a regular expression.

x

a character vector where matches are sought, or an object which can be coerced by as.character to a character vector.

...

further arguments to be passed to regexec.

Details

This function is a wrapper for consecutive calls to regexec and regmatches.

Value

A matrix of matched substrings.

See Also

regexec and regmatches


Set Operations on Multiple Vectors

Description

Performs set operations on multiple vectors.

Usage

mintersect(..., sorted=FALSE)

    munion(..., sorted=FALSE)

Arguments

...

input vectors

sorted

whether the result should be sorted

Value

Set intersection or union of the given vectors

See Also

intersect and union


Extract Variance Components

Description

Extracts variance components from a linear mixed-effects model.

Usage

## S3 method for class 'merMod'
var.components(model)

Arguments

model

a linear mixed-effects model estimated using lmer.

Value

A data frame with elements:

group

the name of the random effect.

var.name

the name of the variable.

var

the estimated variance.

var.prop

the estimated proportion of variance.

See Also

mlmer