You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Objective
I'm currently making an upset plot where the size of all the intersections is one, but it's actually rather convenient because it allows me to use the intersection size plot almost as a key for another variable in my dataset (diet). However, I would ideally like to order the intersections so similar diets are next to each other, but I have so many columns that when I made an intersections list that accomplishes that goal to feed into 'intersections' I get an error "Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value", which according to google means the vector is too long for R to handle. Just wondering if there are any other solutions you can recommend? I'm really liking the look of my plot so far, but being able to order the intersections would take it to the next level!
Code
upset(data=Hajara_Up_Upset, intersect=ordered_intersection_cols, min_degree=1, sort_sets=FALSE,
sort_intersections=FALSE, intersections=intersection_list,
height_ratio=6,
set_sizes=(
upset_set_size(
geom=geom_bar(
aes(fill=Diet, x=group), show.legend=FALSE,
width=0.8
))+
scale_fill_manual(values=diet_pal) + ylab('Number of diets with genus increased')),
base_annotations=list('Intersection size'= intersection_size(
counts=FALSE,
mapping= aes(fill=Diet)) +
scale_fill_manual(values=diet_pal) + theme(axis.text.y= element_blank(), panel.grid= element_blank()) +
ylab('') + guides(fill= guide_legend(ncol=1))
), name='Taxa increased per diet',
guides='collect')
#intersection_list variable just for reference, but I have also tried this pasting the values manually into a form similar to the example on the wiki>intersection_list
[[1]]
[1] "Agathobaculum""Akkermansia""Anaerostipes""Bacteroides""Butyricicoccus""Butyrivibrio"
[7] "Catenibacterium""Enterorhabdus""Lachnoclostridium""Oscillospira""Roseburia""Senegalimassilia"
[13] "Slackia""Sphingobacterium""Succinivibrio"
[[2]]
[1] "Blautia""Caldicellulosiruptor""Coprococcus""Neisseria""Weissella"
[[3]]
[1] "Proteobacteria""Sutterella"
[[4]]
[1] "Anaerostipes""Coprococcus""Streptococcus"
[[5]]
[1] "Bifidobacterium""Lachnospira""Lactobacillus"
[[6]]
[1] "Butyricicoccus""Faecalibacterium""Lactonifactor"
[[7]]
[1] "Anaerostipes""Bilophila""Citrobacter""Collinsella""Escherichia/Shigella"
[6] "Gemella""Lautropia""Oscillospira""Parabacteroides""Synergistes"
[11] "Treponema"
[[8]]
[1] "Alistipes""Bacteroides""Bilophila""Faecalibacterium""Roseburia"
[[9]]
[1] "Alistipes""Bacteroides"
[[10]]
[1] "Bacteroides""Bifidobacterium"
[[11]]
[1] "Bilophila""Desulfovibrio"
[[12]]
[1] "Faecalibaculum""Gemella""Lachnospiraceae_UCG-004""Oscillibacter"
[5] "Pasteurellales""Prevotella""Ruminococcus"
[[13]]
[1] "Bacilli""Christensenella""Peptococcus""Streptococcus"
[[14]]
[1] "Bacteroides"
[[15]]
[1] "Bilophila""Butyrivibrio""Dorea""Lactobacillus""Porphyromonas""Veillonella"
[[16]]
[1] "Holdemania""RuminococcaceaeUBA1819"
[[17]]
[1] "Eubacterium""Roseburia"
[[18]]
[1] "Lactobacillus""Lactococcus""Streptococcus"
[[19]]
[1] "Bifidobacterium""Blautia""Clostridium""Coprococcus""Faecalibacterium""Roseburia"
[[20]]
[1] "Blautia""Faecalibacterium""Lactococcus""Mollicutes""Prevotella"
[[21]]
[1] "Slackia"
Screenshot or illustration
Context (required)
So essentially, the intersections end up being ordered in the same manner as the factor that they're coloured by. I understand this might be a niche use-case, but any help would be greatly appreciated.
Objective
I'm currently making an upset plot where the size of all the intersections is one, but it's actually rather convenient because it allows me to use the intersection size plot almost as a key for another variable in my dataset (diet). However, I would ideally like to order the intersections so similar diets are next to each other, but I have so many columns that when I made an intersections list that accomplishes that goal to feed into 'intersections' I get an error "Error in rep.int(rep.int(seq_len(nx), rep.int(rep.fac, nx)), orep) : invalid 'times' value", which according to google means the vector is too long for R to handle. Just wondering if there are any other solutions you can recommend? I'm really liking the look of my plot so far, but being able to order the intersections would take it to the next level!
Code
Screenshot or illustration
Context (required)
So essentially, the intersections end up being ordered in the same manner as the factor that they're coloured by. I understand this might be a niche use-case, but any help would be greatly appreciated.
ComplexUpset version: ‘1.3.3’
R version details
R session information
The text was updated successfully, but these errors were encountered: