bacpop / PopPUNK

PopPUNK 👨‍🎤 (POPulation Partitioning Using Nucleotide Kmers)
https://www.bacpop.org/poppunk
Apache License 2.0
89 stars 18 forks source link

GPU accelerated graphs #87

Closed johnlees closed 3 years ago

johnlees commented 4 years ago

Could look at using https://github.com/rapidsai/cugraph

johnlees commented 3 years ago

Triangles: cugraph.community.triangle_count.triangles(G) Denominator: degree = G.degree(); sum([d * (d - 1) for d in degree) Transitivity = triangles/denominator (see https://networkx.org/documentation/stable/_modules/networkx/algorithms/cluster.html#transitivity)

Cliques: https://docs.rapids.ai/api/cugraph/stable/api.html?highlight=degree#module-cugraph.community.ktruss_subgraph

nickjcroucher commented 3 years ago

Should this be added under a --gpu-network flag? Could try adding these functions one-by-one that way I suppose, once the big PR is merged.

johnlees commented 3 years ago

It's supposed to be completely interoperable with networkx (perhaps unfortunate now we've completely removed that), but I think a third GPU flag to enable this would be very sensible

nickjcroucher commented 3 years ago

So networkx-type code needs to be added back in? At least we can retrieve the code.

johnlees commented 3 years ago

Yeah. I think we'll keep it as graph tools, and just have functions which convert to/from cugraph, and then the time-consuming ones (cliques, network score) should be fairly small drop-ins