Get subjects from given samples
Arguments
- sampleId
Character: sample identifiers
- patientId
Character: subject identifiers to filter by (optional; if a matrix or data frame is given, its rownames will be used to infer the subject identifiers)
- na
Boolean: return
NA
for samples with no matching subjects- sampleInfo
Data frame or matrix: sample information containing the sample identifiers as rownames and a column named "Subject ID" with the respective subject identifiers
See also
Other functions for data grouping:
createGroupByAttribute()
,
getGeneList()
,
getSampleFromSubject()
,
groupPerElem()
,
plotGroupIndependence()
,
testGroupIndependence()
Examples
samples <- paste0("GTEX-", c("ABC", "DEF", "GHI", "JKL", "MNO"), "-sample")
getSubjectFromSample(samples)
#> GTEX-ABC-sample GTEX-DEF-sample GTEX-GHI-sample GTEX-JKL-sample GTEX-MNO-sample
#> "GTEX-ABC" "GTEX-DEF" "GTEX-GHI" "GTEX-JKL" "GTEX-MNO"
# Filter returned samples based on available subjects
subjects <- paste0("GTEX-", c("DEF", "MNO"))
getSubjectFromSample(samples, subjects)
#> GTEX-DEF-sample GTEX-MNO-sample
#> "GTEX-DEF" "GTEX-MNO"