Skip to content

Commit

Permalink
fix knitting error: seperating track objects
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-t committed Jun 20, 2024
1 parent b6a7358 commit 224e5f2
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions vignettes/b_visualization.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,6 @@ ui <- fluidPage(
goslingOutput("gosling_plot")
)
bases = c("A", "T", "G", "C")
categories = c("Likely_benign", "Likely_pathogenic", "ambiguous")
track1_data <- track_data_gr(
as_GRanges,chromosomeField = "seqnames", genomicFields = c("start", "end"))
Expand Down Expand Up @@ -358,18 +354,18 @@ ui <- fluidPage(
categories = c("Likely_benign", "Likely_pathogenic", "ambiguous")
track1_data <- track_data_gr(
track2_data <- track_data_gr(
as_GRanges,chromosomeField = "seqnames", genomicFields = c("start", "end"))
ui <- fluidPage(
use_gosling(clear_files = FALSE),
goslingOutput("gosling_plot")
)
track_1 <- add_single_track(
track_2 <- add_single_track(
width = 800,
height = 180,
data = track1_data,
data = track2_data,
mark = "text",
x = visual_channel_x(
field = "start", type = "genomic", axis = "bottom"
Expand Down Expand Up @@ -397,24 +393,24 @@ track_1 <- add_single_track(
size = list(value = 20)
)
composed_view <- compose_view(
composed_view2 <- compose_view(
layout = "linear",
xDomain = list(chromosome = "chr2",interval = c(46000, 46400)),
tracks = track_1
tracks = track_2
)
arranged_view <- arrange_views(
arranged_view2 <- arrange_views(
title = "Test track track : Q1W6H9 ",
subtitle = "Gosling Example with text labels",
views = composed_view
views = composed_view2
)
server <- function(input, output, session) {
output$gosling_plot <- renderGosling({
gosling(
component_id = "component_1",
arranged_view
component_id = "component_2",
arranged_view2
)
})
}
Expand All @@ -423,7 +419,7 @@ shiny::shinyApp(ui, server)
```


```{r, two-track}
```{r, multi-track}
library(shiny.gosling)
library(shiny)
Expand All @@ -434,15 +430,15 @@ ui <- fluidPage(
colormapping = c( "#029F73", "gray", "#CB3B8C")
track2_data <- track_data_gr(
track3_data <- track_data_gr(
as_GRanges,chromosomeField = "seqnames", genomicFields = c("start", "end"))
ui <- fluidPage(
use_gosling(clear_files = FALSE),
goslingOutput("gosling_plot")
)
track_2ref <- add_single_track(
track_3ref <- add_single_track(
data = track2_data,
mark = "text",
x = visual_channel_x(
Expand All @@ -453,7 +449,7 @@ track_2ref <- add_single_track(
size = list(value = 20)
)
track_2alt <- add_single_track(
track_3alt <- add_single_track(
data = track2_data,
mark = "text",
Expand All @@ -465,7 +461,7 @@ track_2alt <- add_single_track(
size = list(value = 20)
)
composed_view <- compose_view(
composed_view3 <- compose_view(
width = 800,
height = 180,
multi = TRUE,
Expand All @@ -478,11 +474,11 @@ composed_view <- compose_view(
range = colormapping,
legend = TRUE
),
tracks = add_multi_tracks(track_2ref,track_2alt)
tracks = add_multi_tracks(track_3ref,track_3alt)
)
arranged_view <- arrange_views(
arranged_view3 <- arrange_views(
title = "Test track track : Q1W6H9 ",
subtitle = "stacked nucleotide example",
views = composed_view
Expand All @@ -491,8 +487,8 @@ arranged_view <- arrange_views(
server <- function(input, output, session) {
output$gosling_plot <- renderGosling({
gosling(
component_id = "component_1",
arranged_view
component_id = "component_3",
arranged_view3
)
})
}
Expand Down

0 comments on commit 224e5f2

Please sign in to comment.