3
$\begingroup$

I have tried to use UpsetR to visualize the input file which can be found here.

enter image description here

library("UpSetR")
orthogroups_df<- read.table("orthogroups.GeneCount.tsv",  header=T, stringsAsFactors = F)

#All species
selected_species <- colnames(orthogroups_df)[2:(ncol(orthogroups_df) -1)] 
selected_species
 [1] "Atha" "Cann" "NQLD" "Natt" "Ngla" "Nlab" "Nsyl" "Ntab" "Ntom" "Slyc" "Stub" "Vvin"

head(orthogroups_df)
  Orthogroup Atha Cann NQLD Natt Ngla Nlab Nsyl Ntab Ntom Slyc Stub Vvin Total
1  OG0000000    0    0  965    0    0    3    0    0    0    0    0    0   968
2  OG0000001    0    1    3    0    0  448    0    0    0    0    0    0   452
3  OG0000002    0    1  313    0    0  120    1    0    1    0    0    0   436
4  OG0000003    0   93   15   21   46   16   33   63   36   25   39   26   413
5  OG0000004    1   42    2   34  109    6    8  154   11    9    4    0   380
6  OG0000005    0    2   61    1   34   44   91   70   43   20    1    0   367

ncol(orthogroups_df)
[1] 14

orthogroups_df[orthogroups_df > 0] <- 1
# we only show intersections of interest
intersections=list(list(selected_species),
                   list("Nlab", "NQLD", "Ngla"), 
                   list("Nlab", "NQLD", "Nsyl"), 
                   list("Nlab", "Ngla", "Nsyl"), 
                   list("NQLD", "Nsyl", "Ngla"))
upset(orthogroups_df, 
      text.scale = c(1.4, 1.4, 1.4, 1.4, 1.4, 1.4),
      sets=rev(selected_species), 
      nsets = ncol(orthogroups_df),
      #keep.order=T, 
      #mb.ratio=c(0.5,0.5), 
      #order.by='degree', 
      #order.by='freq',
      intersections = intersections, 
      sets.x.label="Total nbr of orthogroups", 
      mainbar.y.label = "Nbr of orthogroups", 
      #empty.intersections = "on", 
      group.by = "intersections")

How is possible to make the bar bigger of the double digits values or is a way to rotate the plot?

$\endgroup$

1 Answer 1

1
$\begingroup$

I'm not quite sure what you mean. You can alter the % of height that the bottom part of the graph takes up, that will make all the vertical bar parts proportionately taller, but I don't think you should because you have so many groups to display in the bottom part.

I think what you'd want to do is to alter the y-axis so that it stops being totally proportional, to compress the size of the tallest bar, so you can better see the difference in bar sizes between the other comparisons?

I'm not sure you can do that. Making the y axis logged with "scale.intersections" might help.

You'd probably be best off making a second graph that omits that "common to all" intersection. Once that is out of the picture, the difference between the others will be more visible.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.