getPatientFromSample {psichomics} | R Documentation |
Get patients from given samples
getPatientFromSample(sampleId, patientId = NULL, na = FALSE, sampleInfo = NULL) getSubjectFromSample(sampleId, patientId = NULL, na = FALSE, sampleInfo = NULL)
sampleId |
Character: sample identifiers |
patientId |
Character: patient identifiers to filter by (optional; if a matrix or data frame is given, its rownames will be used to infer the patient identifiers) |
na |
Boolean: return NA for samples with no matching patients |
sampleInfo |
Data frame or matrix: sample information containing the sample identifiers as rownames and a column named "Subject ID" with the respective subject identifiers |
Character: patient identifiers corresponding to the given samples
samples <- paste0("GTEX-", c("ABC", "DEF", "GHI", "JKL", "MNO"), "-sample") getPatientFromSample(samples) # Filter returned samples based on available patients patients <- paste0("GTEX-", c("DEF", "MNO")) getPatientFromSample(samples, patients)