Entering edit mode
3.3 years ago
peter.berry5
▴
60
I'm using the UpSetR package to show intersects between sets of differentially expressed proteins from cells grown under different conditions. However, when I run my code I get the following error message
Error in dim(X) <- c(n, length(X)/n) : dims [product 2] do not match the length of object [3]
if I understand the output of the traceback I ran the error is in the colSums (data[sets]) set, but I've no idea how to fix this.
My code is as follows
df1 <- c("GAPDH", "ACTB", "CTSB", "DHRF", "AARS", "ACOT2" )
df2 <- c("GAPDH", "ACTB", "CTSB", "LDHA", "ACOT8" )
df3 <- c("GAPDH", "ACTB", "DHRF", "LDHA" )
data <- list(df1, df2, df3)
data_v2 <- UpSetR::fromList(data)
upset(fromList(data_v2),
nintersects = NA,
nsets = 3,
empty.intersections = "on",
order.by = "freq",
decreasing = T,
number.angles = 0,
text.scale = 1.1,
point.size = 2.8,
line.size = 1
)
dim(data_v2) # 8 observations of 3 variables
length(data_v2) #3
Any advice would be appreciated. I'm not sure what to try next.
I've modified the code and it now works.
The pplot it drew is below. I have 2 further questions thou.
Surely there should be bars showing the single interesction between Fred and Ciara (CTSB), Fred and Pat (DHRF) and Ciara and Pat (LDHA)? I understood that the function of
nintersects = NA,
was to ensure that all intersections were shown.Why is the barplot showing sample size saying all sets have 2 members rather than the actual numbers (Fred = 6, Ciara = 5 and Pat = 4) and how do I change this?
Thanks
Because you need to remove one of the
fromList()
calls...Just remove the
data_v2 <- UpSetR::fromList(data)
line and change thedata_v2
in the line below todata
Perfect. Thanks for that.