hetio / hetnetpy

Hetnets in Python (relocated from dhimmel/hetio)
https://het.io/software
Other
93 stars 28 forks source link

extract_all_metapaths: get all metapaths for any source/target metanodes #14

Closed dhimmel closed 6 years ago

dhimmel commented 6 years ago

Refs https://github.com/greenelab/hetmech/issues/76#issuecomment-378698413

Possibly relevant: code in 1-prepare.ipynb from dhimmel/integrate.

dhimmel commented 6 years ago

This PR does two things:

  1. Changes the existing metagraph.extract_metapaths function to use source and target as argument names rather than source_kind and target_kind. This function can now take metanodes or metanode_kinds for these args. Unfortunately, this could break existing code which calls these parameters by name. I don't see any code via a GitHub search that specified these arguments by name. Now target can be set to None to get all metapaths starting on source.

  2. Add metagraph.extract_all_metapaths which gets all metapaths below a certain length. This function has a exclude_inverts toggle that could help us only calculate values (like path counts) for one orientation of metapaths.

dhimmel commented 6 years ago

@zietzm care to review?