Skip to contents

This function processes a matrix, typically the output from `make_design_matrix`, by removing rows and columns that have a high percentage of missing values (`NA`). The function allows for flexibility in the order of operations, either removing rows first or columns first.

Usage

remove_missing_row_column(M, rowthres = 0.95, colthres = 0.95, rowfirst = TRUE)

Arguments

M

A matrix, typically the output from `make_design_matrix`, where rows represent SNPs, columns represent tissue-gene pairs, and values are z-scores.

rowthres

A numeric threshold (between 0 and 1). Rows with a proportion of missing values greater than this threshold will be removed.

colthres

A numeric threshold (between 0 and 1). Columns with a proportion of missing values greater than this threshold will be removed.

rowfirst

A logical value. If `TRUE`, rows are processed before columns. If `FALSE`, columns are processed before rows.

Value

A matrix with rows and columns containing excessive missing values removed based on the specified thresholds.