Skip to contents

plot_feat_clin produces a matrix of feature level clinical plots for a specific feature.

Usage

plot_feat_clin(
  feat.id,
  beam.result,
  beam.specs = NULL,
  beam.set.pvals,
  beam.feat.pvals,
  n.row = NULL,
  n.col = NULL
)

Arguments

feat.id

A character specifying the name of a feature. Must be in beam.result$beam.data$set.data

beam.result

A beam.stats object from compute_beam_stats

beam.specs

A data.frame. Default NULL, in which case beam.result$beam.specs is used. Otherwise can input other beam.specs data.frame that must contain name, mtx, mdl, plot columns.

beam.set.pvals

A list containing BEAMR set p-values from compute_set_pvalues.

beam.feat.pvals

A list containing feature-level p-values from compute_feature_pvalues.

n.row

A numeric. Specify the number of rows for the plot layout; default NULL will automatically define the number of rows after number of columns specified.

n.col

A numeric. Specify the number of columns for the plot layout; default NULL will use the number of omics types.

Value

A figure (ggarrange object)

Examples

data(beam_stats)
test.pvals <- compute_set_pvalues(beam.stats=beam_stats)
#> Preparing bootstrap results for calculating feature set p-values: Tue Jul 30 13:51:23 2024
#> Finding stats for each data matrix:Tue Jul 30 13:51:23 2024
#>   Finding stats for data matrix Lesion: Tue Jul 30 13:51:23 2024
#>    Finding features with with Lesion.MRD29 stats: Tue Jul 30 13:51:23 2024
#>    Finding features with with Lesion.EFS stats: Tue Jul 30 13:51:23 2024
#>    Finding features with with Lesion.OS stats: Tue Jul 30 13:51:23 2024
#>   Finding stats for data matrix RNA: Tue Jul 30 13:51:23 2024
#>    Finding features with with RNA.MRD29 stats: Tue Jul 30 13:51:23 2024
#>    Finding features with with RNA.EFS stats: Tue Jul 30 13:51:23 2024
#>    Finding features with with RNA.OS stats: Tue Jul 30 13:51:23 2024
#> Found 120 rows of stats: Tue Jul 30 13:51:23 2024
#> Merging stats with feature-sets: Tue Jul 30 13:51:23 2024
#> Merged feature-set stat rows: 120
#> Ordering and indexing feature sets: Tue Jul 30 13:51:23 2024
#>   Cleaning up beam.stat matrices:Tue Jul 30 13:51:23 2024
#>    Working on matrix 1 of 6: Tue Jul 30 13:51:23 2024
#>    Working on matrix 2 of 6: Tue Jul 30 13:51:23 2024
#>    Working on matrix 3 of 6: Tue Jul 30 13:51:23 2024
#>    Working on matrix 4 of 6: Tue Jul 30 13:51:23 2024
#>    Working on matrix 5 of 6: Tue Jul 30 13:51:23 2024
#>    Working on matrix 6 of 6: Tue Jul 30 13:51:23 2024
#> Computing p-value for feature set 1 of 34: Tue Jul 30 13:51:23 2024
#> 13ENSG00000081760
#> Computing p-value for feature set 26 of 34: Tue Jul 30 13:51:23 2024
#> 9496ENSG00000229835
#> Finished computing p-values at: Tue Jul 30 13:51:23 2024
#> Minimum q-value is 0.106439437831269
#> Creating set p-value data frame.
#> Done creating data frame.
#> Creating list for output.
test.feat.pvals <- compute_feature_pvalues(beam.stats=beam_stats)
#> Computing feature p-values for stat matrix 1 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
#> Computing feature p-values for stat matrix 2 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
#> Computing feature p-values for stat matrix 3 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
#> Computing feature p-values for stat matrix 4 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
#> Computing feature p-values for stat matrix 5 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
#> Computing feature p-values for stat matrix 6 of 6: Tue Jul 30 13:51:23 2024
#>   This matrix has 20 features.
plot.specs <- prep_beam_plot(beam.data=beam_stats$beam.data, beam.specs=beam_stats$beam.specs)
test.plot <- plot_feat_clin(beam.result=beam_stats, beam.specs=plot.specs,
                            beam.set.pvals=test.pvals, beam.feat.pvals=test.feat.pvals,
                            feat.id="ENSG00000227443_loss",
                            n.col=2, n.row=NULL)