berkeleybop / bbop-graph

General purpose (mathematical) graph library in JavaScript.
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Allow multiple preidcates for walker #10

Open manulera opened 1 year ago

manulera commented 1 year ago

It would be great if for walker functions instead of allowing a single predicate, multiple predicates would be allowed. A recent use-case for me was to find all children of a given GO term related through part_of or is_a relationships. To do that I had to filter out relationships in the json before parsing the graph, but it would be nice to be able to do this within the library, providing a list instead of a string for the in_pred aragument in functions like the one below:

https://github.com/berkeleybop/bbop-graph/blob/8837355030f2f4cb75f1015ae0fbdaf6cb3b70e1/lib/graph.js#L1091-L1099