Skip to contents

Ensure that the patients in the expression and pheno tibbles match via subsetting and sorting, during preprocessing.

Usage

ensure_patients_match(
  expr_tbl,
  pheno_tbl,
  patient_id_col = "patient_id",
  gene_id_col = "gene_id",
  quiet = FALSE
)

Arguments

expr_tbl

tibble. With genes as rows and patients as columns. The column gene_id_col (see below) holds the gene identifiers, all other colum names are the patient identifiers.

pheno_tbl

tibble. The pheno data, with patients as rows and variables as columns. The column patient_id_col (see below) holds the patient identifiers.

patient_id_col

string. The name of the column in pheno that holds the patient identifiers.

gene_id_col

string. The name of the column in expr that holds the gene identifiers.

quiet

logical. Whether to print messages. Default is FALSE.

Value

A list with two tibbles named expr and pheno. Matching and sorted expression and pheno data, i.e. the vectors of patient identifiers are identical.