Closed rbutleriii closed 1 month ago
This turns out to only be an issue if recalculating PI
outside of specificCellCellcommunicationScores
based on the NA
values in #948. The relevant bit of code to add if recalculating log2fc would be:
# get minimum adjusted p.value that is not zero
all_p.adj = comScore[['p.adj']]
lowest_p.adj = min(all_p.adj[all_p.adj != 0])
comScore[, PI := ifelse(p.adj == 0, log2fc*(-log10(lowest_p.adj)), log2fc*(-log10(p.adj)))]
Both
spatCellCellcom
andexprCellCellcom
can produce p.adj values of exactly 0, resulting in PI ofInf
andInf-
. These then result in an error forplotCCcomDotplot
You can fix it by setting the p.adj to the machine double min to get real values and recalculate PI