tests/testthat/test.add_plotly_layout_scatter.R

context('add_plotly_legend_scatter')

data("example_data")

test_that('add layout to scatter plot',{
  
  # perform moderated t-test
  stats_df <- calc_mod_ttest(example_data)
  sig_df <- id_significant_proteins(stats_df)
  
  # generate volcano plot with bait protein labeled
  basic_scatter <- plot_scatter_basic(sig_df)
  bait_scatter <- plot_overlay(basic_scatter,as.bait('BCL2'))
  
  # interactive volcano plot
  result = make_interactive(bait_scatter) %>%
    add_plotly_layout_scatter()
  
  # check result
  m = result$x$layoutAttrs[[2]]
  expect_true(!is.null(m))
  expect_equal(m$xaxis$title, "Replicate 1 log<sub>2</sub>(Fold change)")
  expect_equal(m$yaxis$title, "Replicate 2 log<sub>2</sub>(Fold change)")
  
})
lagelab/Genoppi documentation built on Oct. 13, 2022, 2:36 p.m.