rnaglib.algorithms.Hasher¶
- class rnaglib.algorithms.Hasher(method='WL', string_hash_size=8, graphlet_hash_size=16, symmetric_edges=True, wl_hops=2, label='LW', directed=True)[source]¶
The hasher object. Once created, it will hash new graphs and optionnaly, one can run it onto a whole graph dir to create the hashtable once and for all.
- Parameters:
method – for now only WL hashing is supported
string_hash_size – The length of the hash, longer ones will yields less collision but more processing time
graphlet_hash_size – Same thing for hashes of graphlets
symmetric_edges – Whether to use symetric weights for the edges.
wl_hops – The depth to consider for hashing
label – How the data for the surrounding edges is encoded in the nodes.
directed – To use directed graphs instead of undirected ones
- __init__(method='WL', string_hash_size=8, graphlet_hash_size=16, symmetric_edges=True, wl_hops=2, label='LW', directed=True)[source]¶
The hasher object. Once created, it will hash new graphs and optionnaly, one can run it onto a whole graph dir to create the hashtable once and for all.
- Parameters:
method – for now only WL hashing is supported
string_hash_size – The length of the hash, longer ones will yields less collision but more processing time
graphlet_hash_size – Same thing for hashes of graphlets
symmetric_edges – Whether to use symetric weights for the edges.
wl_hops – The depth to consider for hashing
label – How the data for the surrounding edges is encoded in the nodes.
directed – To use directed graphs instead of undirected ones
Methods
__init__
([method, string_hash_size, ...])The hasher object.
get_hash_table
(graph_dir[, max_graphs])get_node_hash
(graph, n)Get the correct node hashing from a node and a graph
hash
(graph)WL hash of a graph.