This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Creating Upset plot with Orthofinder result

enter image description hereHello all,

I have the file that I generated from orthofinder which looks like this:

Orthogroup      F105    F109    F23     F79     HDV247  T415
OG0000000       12      15      31      17      1       1
OG0000001       23      18      1       12      0       6
OG0000002       0       27      27      0       0       1
OG0000003       48      1       0       0       0       1
OG0000004       46      0       2       0       1       0
OG0000005       11      7       13      9       1       7
OG0000006       13      9       5       9       3       3
OG0000007       9       16      0       14      0       0
OG0000008       1       0       1       1       31      1

column 1 is a orthogroup and F105 to T415 represents different genomes. The numbers represent the count of that particular orthogroup in that genome. I want to make upset plot using this data in R but from what I can see looks like it requires a binary input file. Can I use this data to make upset plot? if not how can I modify this file to make upset plot?

so far with this data I have done this,

 orthogroups<- read.table("All_Orthogroups.tsv",  header=T, sep="\t")
data<- orthogroups[2:7]
str(data)
upset(fromList(data), order.by = "freq")

I have attached the upset plot generated. As you can see the numbers in the upset plot are wrong. It is only considering the numbers 0 and 1 from the file and ignoring everything else. Please help.

orthofinder upsetr r

1 answer

You have to make it as a binary file, I mean u have to convert yout data run this comand u will get in binary formate, hope, it help

data[data > 0] <- 1

Log in to answer this question.