mirror of
https://github.com/johrpan/ubigen.git
synced 2025-10-26 19:57:24 +01:00
gsea: Improve smoothing resolution
This commit is contained in:
parent
19b395a564
commit
3d7c508a83
1 changed files with 6 additions and 3 deletions
|
|
@ -30,7 +30,10 @@ result <- result[, rbindlist(result), by = bucket]
|
|||
|
||||
data <- result[, .(count = .N), by = c("bucket", "source")]
|
||||
data[, total := sum(count), by = bucket]
|
||||
smooth_model <- loess(total ~ bucket, data, span = 0.25)
|
||||
|
||||
smooth_model <- loess(total ~ bucket, data, span = 0.3)
|
||||
bucket_smoothed <- seq(1, nrow(data), 0.1)
|
||||
total_smoothed <- predict(smooth_model, bucket_smoothed)
|
||||
|
||||
fig <- plotly::plot_ly(data) |>
|
||||
plotly::add_bars(
|
||||
|
|
@ -39,8 +42,8 @@ fig <- plotly::plot_ly(data) |>
|
|||
color = ~source
|
||||
) |>
|
||||
plotly::add_lines(
|
||||
x = ~bucket,
|
||||
y = predict(smooth_model),
|
||||
x = ~bucket_smoothed,
|
||||
y = ~total_smoothed,
|
||||
name = "All (smoothed)"
|
||||
) |>
|
||||
plotly::layout(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue