epicontacts icon indicating copy to clipboard operation
epicontacts copied to clipboard

Bug in subset(x cs_min = ...)

Open thibautjombart opened this issue 5 years ago • 2 comments

Using this as a placeholder as I cannot share the data leading to the issue and cannot come up with a MRE. When doing plot(subset(x, cs_min = 5)) I end up with a cluster of size 3. Seems to come from NAs in some of the meta-data used for plotting nodes / edge properties. Maybe a cursory look through the subset code with attention to handling of NAs will reveal the issue.

thibautjombart avatar Apr 01 '19 10:04 thibautjombart

Hi @thibautjombart , subset_clusters_by_size() doesn't look into NAs, so I'm not sure if that's causing the bug. I added some more checks in the function - if the minimum network cluster size is lesser than specified cs_min it'll stop instead of returning the same network (and a similar check for cs_max and cs). They might help you pinpoint the issue. I should have thought of this scenario earlier!

nistara avatar Apr 01 '19 19:04 nistara

Ref issue_97 branch

nistara avatar Apr 01 '19 19:04 nistara