format_to_ref: Format the sample and reference data to match

View source: R/data_formatting.R

format_to_refR Documentation

Format the sample and reference data to match

Description

This function keeps matching gene IDs between the sample and reference data, removing non-matching data.

Usage

format_to_ref(samp, refdata, na.rm = T, verbose = T)

Arguments

samp

the sample gene expression matrix with genes as rows and individuals as columns

refdata

the reference matrix, same format as samp

na.rm

if TRUE (default), rows with NA are removed

verbose

if TRUE (default), prints a summary of initial and resulting gene counts

Value

a list with matching samp and refdata expression matrices as well as an inter.genes character vector with the matching gene IDs.

Examples

X <- matrix(rnorm(50), ncol = 5)
Y <- X
rownames(X) <- paste0('g', 1:10)
rownames(Y) <- paste0('g', 4:13)

Z <- format_to_ref(X,Y)

LBMC/wormAge documentation built on April 6, 2023, 3:52 a.m.