getMatchingSamples: Get samples matching the given patients

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Get samples matching the given patients

Usage

1
2
3
4
5
6
7
8
getMatchingSamples(patients, samples, clinical = NULL, rm.NA = TRUE,
  match = NULL, showMatch = FALSE)

getSampleFromPatient(patients, samples, clinical = NULL, rm.NA = TRUE,
  match = NULL, showMatch = FALSE)

getSampleFromSubject(patients, samples, clinical = NULL, rm.NA = TRUE,
  match = NULL, showMatch = FALSE)

Arguments

patients

Character or list of characters: patient identifiers

samples

Character: sample identifiers

clinical

Data frame or matrix: clinical dataset

rm.NA

Boolean: remove NAs? TRUE by default

match

Integer: vector of patient index with the sample identifiers as name to save time (optional)

showMatch

Boolean: show matching patient index? FALSE by default

Value

Names of the matching samples (if showMatch is TRUE, a character with the patients as values and their respective samples as names is returned)

Examples

1
2
3
4
5
patients <- c("GTEX-ABC", "GTEX-DEF", "GTEX-GHI", "GTEX-JKL", "GTEX-MNO")
samples <- paste0(patients, "-sample")
clinical <- data.frame(samples=samples)
rownames(clinical) <- patients
getMatchingSamples(patients[c(1, 4)], samples, clinical)

nuno-agostinho/psichomics documentation built on April 10, 2018, 8:58 a.m.