Closed jreimertz closed 7 months ago
hi @jreimertz yes this is a known issue at the moment but i haven't been able to find time to work on a good fix. tried it at #97 #99 to address #91 but not working at the moment
My current guess is that the issue is the pvals/relevant interaction file has different dimensions to the means file because the newer versions of cellphonedb trims the output.
The current manual fix is to try and duplicate the means file and pad the missing rows/columns with 1 or 0 (depending on whether it's statistical or deg mode respectively) like the suggested fix at https://github.com/zktuong/ktplotspy/issues/51
Would you be able to help me check if adding the missing row/columns for your data works?
I can confirm that pvals and means have different dimensions
> dim(means3)
[1] 2088 337
> dim(pvals3)
[1] 851 337
Unfortunately padding the missing rows in pvals led to a different error
I've included the code I used to pad the rows in pvals
mat <- matrix(0, 1237, 337)
colnames(mat) <- colnames(pvals3)
pvals_test <- bind_rows(pvals3, as_tibble(mat) %>%
mutate(across(everything(), ~ `class<-`(.x, class(pvals3[[cur_column()]])))))
> dim(means3) == dim(pvals_test)
[1] TRUE TRUE
What about slicing means to contain the same interactions?
oh i think your attempt to pad the rows throwing your issues because you didn't account for the first 11 or 15 columns where there's the usual information about the LR.
hi @jreimertz , can you try installing the PR at
devtools::install_github("zktuong/ktplots", ref="fix-uneven-rows-and-columns")
and see if that helps?
or just install the master branch if you see that i've merged this in the coming few days
Hi @zktuong, I've installed the PR you referenced but attempting to run plot_cpdb()
led to the following error:
Which was the error I got originally when trying to run the results from the second method
Slicing means to contain the same number of rows as pvals led to the original error:
Hmm puzzling. Could you send me your cellphonedb output files so that i can do some more testing? You can send them to z.tuong@uq.edu.au
ok the issue is with tidyverse
was used to read in the means
and relevant_interactions
files.
Hello! I keep getting the following error when trying to run
plot_cpdb()
:This is how I've been calling the function:
So far in attempting to resolve this issue I've tried:
means
andpvals
in case they're being overwrittencell_type1
andcell_type2
to different cell types as well as "."Running the function with the results of method 2 instead of method 3 resulted in the following error:
I haven't been able to reproduce this error with the sample
kidneyimmune
dataset which makes me think the issue might be with my CellPhoneDB results but I'm not sure what could be causing the issue. Thank you in advance!