You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sq.gr.ligrec was used to calculate ligand-receptor statistics for the whole input dataset. However, when plotting the results, the dots for the same interactions differ depending on the clusters selected for plotting. If I only plot clusters 1 and 2 as source and clusters 1, 2, and 3 as target groups, the same dots shown in the graph as being significant (tori) might suddenly become non-significant when I choose to plot clusters 1 and 2 as source and 1 and 2 as target groups.
To my understanding the pvalues shouldn't get modified based on result subsetting. Additionally, when I subset the result["pvalues"] for my own data to the remaining source and target molecules that are being plotted, all should be shown to be significant, but are not in the plot.
...
Minimal reproducible example
adata=sq.datasets.seqfish()
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
res_test=sq.gr.ligrec(
adata,
n_perms=100,
threshold=0,
copy=True,
cluster_key="celltype_mapped_refined",
use_raw=False
)
sq.pl.ligrec(
res_test,
source_groups=["Lateral plate mesoderm","Intermediate mesoderm"],
target_groups=["Lateral plate mesoderm","Intermediate mesoderm",'Allantois'],
means_range=(0.5, np.inf),
alpha=0.005,
swap_axes=True,
)
# vs. sq.pl.ligrec(
res_test,
source_groups=["Lateral plate mesoderm","Intermediate mesoderm"],
target_groups=["Lateral plate mesoderm","Intermediate mesoderm"],
means_range=(0.5, np.inf),
alpha=0.005,
swap_axes=True,
)
# in the second plot for example the pair "WNT5A" and "FZD2" should all be significant like seen here, but is not in the plot# Target clusters to keeptargets= ["Lateral plate mesoderm","Intermediate mesoderm"]
# Filter the columnsfiltered_test=res_test["pvalues"].loc[:,
res_test["pvalues"].columns.get_level_values('cluster_1').isin(targets) &res_test["pvalues"].columns.get_level_values('cluster_2').isin(targets)
]
filtered_test=filtered_test[(filtered_test.index.get_level_values(0) =="WNT5A") &
(filtered_test.index.get_level_values(1) =="FZD2")]
filtered_test
Version
python=3.10.16, squidpy=1.6.1
...
The text was updated successfully, but these errors were encountered:
t-a-m-i
changed the title
differing plotting results based on plotted clusters in sq.pl.ligrec
significance of same dots changes based on plotted clusters in sq.pl.ligrec
Jan 24, 2025
Description
sq.gr.ligrec was used to calculate ligand-receptor statistics for the whole input dataset. However, when plotting the results, the dots for the same interactions differ depending on the clusters selected for plotting. If I only plot clusters 1 and 2 as source and clusters 1, 2, and 3 as target groups, the same dots shown in the graph as being significant (tori) might suddenly become non-significant when I choose to plot clusters 1 and 2 as source and 1 and 2 as target groups.
To my understanding the pvalues shouldn't get modified based on result subsetting. Additionally, when I subset the result["pvalues"] for my own data to the remaining source and target molecules that are being plotted, all should be shown to be significant, but are not in the plot.
...
Minimal reproducible example
Version
python=3.10.16, squidpy=1.6.1
...
The text was updated successfully, but these errors were encountered: