Show the missing value distributation.

show_missing_values(
  object,
  show_row_names = FALSE,
  show_column_names = TRUE,
  row_names_gp = gpar(fontsize = 12),
  column_names_gp = gpar(fontsize = 12),
  column_names_rot,
  cell_color = "transparent",
  row_names_side = "right",
  percentage = FALSE,
  sample_na_cutoff = 50,
  variable_na_cutoff = 50,
  only_outlier_samples = FALSE,
  only_outlier_variables = FALSE,
  ...
)

Arguments

object

(required) mass_dataset class object.

show_row_names

show row names or not. see?ComplexHeatmap::Heatmap

show_column_names

show column names or not. see?ComplexHeatmap::Heatmap

row_names_gp

row names gp, see?ComplexHeatmap

column_names_gp

column names gp, see?ComplexHeatmap

column_names_rot

column names rot see?ComplexHeatmap::Heatmap

cell_color

Cell color.

row_names_side

Row names side. left or right.

percentage

percentage or not.

sample_na_cutoff

Na cutoff for samples.

variable_na_cutoff

Na cutoff for variables

only_outlier_samples

Only show the outlier samples?

only_outlier_variables

Only show the outlier variables?

...

Other parameters for ComplexHeatmap::Heatmap

Value

A ggplot2 class object

Author

Xiaotao Shen shenxt1990@outlook.com

Examples

data("expression_data")
data("sample_info")
data("variable_info")

object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )

object
#> -------------------- 
#> massdataset version: 1.0.12 
#> -------------------- 
#> 1.expression_data:[ 1000 x 8 data.frame]
#> 2.sample_info:[ 8 x 4 data.frame]
#> 3.variable_info:[ 1000 x 3 data.frame]
#> 4.sample_info_note:[ 4 x 2 data.frame]
#> 5.variable_info_note:[ 3 x 2 data.frame]
#> 6.ms2_data:[ 0 variables x 0 MS2 spectra]
#> -------------------- 
#> Processing information (extract_process_info())
#> 1 processings in total
#> create_mass_dataset ---------- 
#>       Package         Function.used                Time
#> 1 massdataset create_mass_dataset() 2022-08-07 19:33:12

##show missing values plot
show_missing_values(object)


show_missing_values(object[1:10,], cell_color = "white")


###only show subject samples
object %>%
  activate_mass_dataset(what = "sample_info") %>%
  filter(class == "Subject") %>%
  show_missing_values()


###only show QC samples
object %>%
  activate_mass_dataset(what = "expression_data") %>%
  dplyr::select(contains("QC")) %>%
  show_missing_values()


###only show features with mz < 100
object %>%
  activate_mass_dataset(what = "variable_info") %>%
  dplyr::filter(mz < 100) %>%
  show_missing_values(cell_color = "white",
                      show_row_names = TRUE,
                      row_names_side = "left",
                      percentage = TRUE,
                      sample_na_cutoff = 50,
                      variable_na_cutoff = 20)