complex-upset icon indicating copy to clipboard operation
complex-upset copied to clipboard

Relocation of Intersection size number, Add exact number of set size on the set size bar plot, Remove the background from the set size bar plot.

Open Jihyunchun71 opened this issue 1 year ago • 2 comments

Objective

  1. Relocation of Intersection size number : In the generated figure, the intersection size number is located within the barplot only at the highest bar plot. I want all the numbers located at the top of the bar plots.

  2. Add exact number of set size on the set size bar plot Just like the intersection size plot, I want the exact number of set size to appear in the set size, but even after many trials, I failed. Please help me with it.

  3. Remove the background from the set size bar plot. I want to remove the stripe pattern and ticks behind the set size bar plot. I've removed the backgrounds in intersection size plot, but couldn't removed it in set size plot. I want the set size plot background to be just white.

Code

organs = c("Feces", "Muscle", "Serum")

upset( RP, organs, name = 'organs', stripes = upset_stripes( colors = c("grey95", "white"), geom = geom_segment(size = 20) ), sort_intersections_by = c('degree', 'cardinality'),

base_annotations = list( 'Intersection\nsize' = intersection_size( counts = TRUE, mapping = aes(fill = Direction) ) + scale_fill_manual( values = c("Up" = "#B2182B", "Down" = "#2166AC", "etc" = "#D9D9D9"), breaks = c("Up", "Down", "etc"), labels = c("Up", "Down", "etc") ) + theme( panel.grid = element_blank(), axis.line = element_line(),
axis.line.x = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank(), axis.ticks.y = element_line() ) ),

matrix = intersection_matrix( geom = geom_point(size = 4), # Adjust dot size segment = geom_segment(size = 1.3) # Adjust line thickness in intersection matrix ),

width_ratio = 0.2, mode = 'distinct' )

Screenshot or illustration

image

Context (required)

ComplexUpset version: 1.3.3

R version details
<!-- Please replace this line by output of R.Version() -->
R session information
<!-- Please replace this line by output of sessionInfo() -->

Jihyunchun71 avatar Nov 11 '24 04:11 Jihyunchun71

@Jihyunchun71

  1. intersection_size has bar_number_threshold argument, I think you can set it to 0 to get what you want.
  2. Like this https://krassowski.github.io/complex-upset/articles/Examples_R.html#display-counts ?
  3. stripes='white'? See https://krassowski.github.io/complex-upset/articles/Examples_R.html#stripes

krassowski avatar Nov 11 '24 10:11 krassowski

@Jihyunchun71

  1. intersection_size has bar_number_threshold argument, I think you can set it to 0 to get what you want.
  2. Like this https://krassowski.github.io/complex-upset/articles/Examples_R.html#display-counts ?
  3. stripes='white'? See https://krassowski.github.io/complex-upset/articles/Examples_R.html#stripes

Specifially regarding the "stripes='white'":

This changes the stripes in both the set size plot and the intersections matrix. Is there a way to only set the stripes in the set size plot to white (effectively removing them) while maintaining the stripes in the matrix?

OliverH96 avatar May 01 '25 12:05 OliverH96