These functions generate heatmaps, spectral plots, and interactive plots for OpenSpecy data.
plotly_spec(x, ...)# S3 method for default
plotly_spec(x, ...)
# S3 method for OpenSpecy
plotly_spec(
x,
x2 = NULL,
line = list(color = "rgb(255, 255, 255)"),
line2 = list(dash = "dot", color = "rgb(255,0,0)"),
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
showlegend = FALSE,
make_rel = TRUE,
...
)
heatmap_spec(x, ...)
# S3 method for default
heatmap_spec(x, ...)
# S3 method for OpenSpecy
heatmap_spec(
x,
z = NULL,
sn = NULL,
cor = NULL,
min_sn = NULL,
min_cor = NULL,
select = NULL,
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
colorscale = "Viridis",
showlegend = FALSE,
type = "interactive",
...
)
interactive_plot(x, ...)
# S3 method for default
interactive_plot(x, ...)
# S3 method for OpenSpecy
interactive_plot(
x,
x2 = NULL,
select = NULL,
line = list(color = "rgb(255, 255, 255)"),
line2 = list(dash = "dot", color = "rgb(255,0,0)"),
font = list(color = "#FFFFFF"),
plot_bgcolor = "rgba(17, 0, 73, 0)",
paper_bgcolor = "rgb(0, 0, 0)",
colorscale = "Viridis",
...
)
A plotly heatmap object displaying the OpenSpecy data. A subplot
containing the heatmap and spectra plot. A plotly object displaying the
spectra from the OpenSpecy
object(s).
an OpenSpecy
object containing metadata and spectral data for
the first group.
an optional second OpenSpecy
object containing metadata and
spectral data for the second group.
list; line
parameter for x
; passed to
add_trace()
.
list; line
parameter for x2
; passed to
list; passed to layout()
.
color value; passed to layout()
.
color value; passed to layout()
.
whether to show the legend passed to
logical, whether to make the spectra relative or use the raw values
optional numeric vector specifying the intensity values for the
heatmap. If not provided, the function will use the intensity values from the
OpenSpecy
object.
optional numeric value specifying the signal-to-noise ratio
threshold. If provided along with min_sn
, regions with SNR below the
threshold will be excluded from the heatmap.
optional numeric value specifying the correlation threshold. If
provided along with min_cor
, regions with correlation below the
threshold will be excluded from the heatmap.
optional numeric value specifying the minimum signal-to-noise ratio for inclusion in the heatmap. Regions with SNR below this threshold will be excluded.
optional numeric value specifying the minimum correlation for inclusion in the heatmap. Regions with correlation below this threshold will be excluded.
optional index of the selected spectrum to highlight on the heatmap.
colorscale passed to add_trace()
can
be an array or one of "Blackbody"
, "Bluered"
, "Blues"
, "Cividis"
,
"Earth"
, "Electric"
, "Greens"
, "Greys"
, "Hot"
, "Jet"
, "Picnic"
,
"Portland"
, "Rainbow"
, "RdBu"
, "Reds"
, "Viridis"
, "YlGnBu"
,
"YlOrRd"
.
specification for plot type either interactive or static
plot_ly()
.
further arguments passed to plot_ly()
.
Win Cowger, Zacharias Steinmetz
data.table::setDTthreads(2)
data("raman_hdpe")
tiny_map <- read_extdata("CA_tiny_map.zip") |> read_zip()
plotly_spec(raman_hdpe)
heatmap_spec(tiny_map, z = tiny_map$metadata$y, showlegend = TRUE)
sample_spec(tiny_map, size = 12) |>
interactive_plot(select = 2, x2 = raman_hdpe)
Run the code above in your browser using DataLab