VEuPathDB / plot.data

1 stars 0 forks source link

Network: add support for finding degrees for nodes #239

Closed d-callan closed 6 months ago

d-callan commented 7 months ago

we may want to do things like sort a bipartite networks nodes based on degree, and to do that we have to actually know the degree. populating this could be a bit hard to do and maintain perf, so its possible we might want to introduce a method to finds degrees for nodes as needed. alternatively, we could add degree as a slot on the Node class and populate it on initialization of the Network, if we can do it well and quickly.

d-callan commented 7 months ago

we might also need to be able to get weighted degree lists

asizemore commented 7 months ago

If we're really going to do network analysis things at a later date, one of the most basic starting points is looking at the (weighted) degree distribution. To me that suggests we have a method that returns the degrees in a vector so we can go make a histogram. However, ordering or sizing nodes by degree suggests each node should have a slot for degree and weightedDegree. Probably that means that we start by adding the slots and eventually we add a method that just grabs all this info and returns it as a vector...