Extend dplyr::left_join() to operate on the sampleTable slot of a
mesaDimRed object.
mesaDimRed
Object whose sampleTable will be joined.
data.frame
Table to join.
character() or NULL
Join columns; see dplyr::left_join(). Default: NULL.
logical(1)
See dplyr::left_join(). Default: FALSE.
character(2)
Suffixes appended to overlapping non-join column names.
Default: c(".x", ".y").
logical(1) or NULL
Retain join keys from both tables. Default: NULL.
Additional arguments to dplyr::left_join().
A mesaDimRed object:
sampleTable updated with y via a left join.
new <- data.frame(sample_name = c("Colon1_N", "Colon2_N"), foo = c(1, 2))
exampleTumourNormal %>%
getPCA() %>%
left_join(new, by = join_by(sample_name)) %>%
getSampleTable()
#> ------------------------------
#> Initial number of windows = 819.
#> -----------
#> Generating table of beta values for 819 regions across 10 samples.
#> -----------
#> Filtered out 220 windows with at least one missing value: 599 windows remaining.
#> ------------------------------
#> The following topVarNum values are larger than the number of remaining windows (= 599): 1000
#> These values are not used; PCA will be done with all remaining windows instead.
#> ------------------------------
#> No filtering of windows based on window standard deviation.
#> Performing PCA with 10 samples and 599 windows
#> -> pca1.
#> ------------------------------
#> sample_name group patient type tumour tissue age gender
#> Colon1_N Colon1_N Colon1_N Colon1 NormalColon Normal Colon 80 F
#> Colon1_T Colon1_T Colon1_T Colon1 CRC Tumour Colon 80 F
#> Colon2_N Colon2_N Colon2_N Colon2 NormalColon Normal Colon 67 F
#> Colon2_T Colon2_T Colon2_T Colon2 CRC Tumour Colon 67 F
#> Lung1_N Lung1_N Lung1_N Lung1 NormalLung Normal Lung 64 F
#> Lung1_T Lung1_T Lung1_T Lung1 LUAD Tumour Lung 64 F
#> Lung2_N Lung2_N Lung2_N Lung2 NormalLung Normal Lung 71 F
#> Lung2_T Lung2_T Lung2_T Lung2 LUSC Tumour Lung 71 F
#> Lung3_N Lung3_N Lung3_N Lung3 NormalLung Normal Lung 72 M
#> Lung3_T Lung3_T Lung3_T Lung3 LUAD Tumour Lung 72 M
#> stage foo
#> Colon1_N <NA> 1
#> Colon1_T III NA
#> Colon2_N <NA> 2
#> Colon2_T IV NA
#> Lung1_N <NA> NA
#> Lung1_T IIA NA
#> Lung2_N <NA> NA
#> Lung2_T IA NA
#> Lung3_N <NA> NA
#> Lung3_T IB NA