How does top (the fraction of interactions to show) work
DelongZHOU opened this issue · 1 comments
Hello,
I'm trying to understand how "top" works, or which ranking system is used, for the functions netVisual_circle and netVisual_diffInteraction. Is it based on the weight, the p value, or something else?
Two reasons for this question are:
First, for netVisual_circle, when I use the same top fraction, plotting with number or weight do not involve the same cell groups.
Second, using the same top fraction, I first use netVisual_circle with number to show the network for two conditions; then netVisual_diffInteraction with the same top to show the difference. However, netVisual_diffInteraction shows edges that links to isolated cell groups in netVisual_circle, and edges only found in one netVisual_circle are not shown in netVisual_diffInteraction
E.g. in ctrl I see interaction from Group_A to Group_B, but not in treatment; but the netVisual_diffInteraction does not indicate Group_A to Group_B
Conversely, netVisual_diffInteraction shows edge Group_C to Group_D, but neither ctrl nor treatment netVisual_circle shows this edge.
Thank you!
Looking at the source code, it seems that both functions just take the (1-top) percentile of the cell group to cell group matrix as the cutoff and show the edges between groups that exceed the cutoff. (netVisual_diffInteraction takes abs() first to consider both directions)
Is there a way to plot for the interactions with the strongest weight or smallest p val (although with the boot_n=100 there'd be many draws), and for the diff to plot for those with most changes in comm. prob?
Thanks!