Degree-weighted path count (DWPC) measures how prevalent a specified metapath is between source and target nodes while reducing the influence of highly connected intermediate nodes. Unlike path count (PC), which assigns every path a value of 1, DWPC weights each path inversely according to node degrees. section 4.3 section 10.2.2
A typical DWPC workflow is:
- Choose a metapath, such as Compound–binds–Gene–associates–Disease, which specifies node and relationship types rather than one concrete path. section 4.3 section 10.2.2
- Match the concrete path instances between the selected source and target nodes and count them as PC. section 4.3
- Collect the degrees along each path, apply inverse degree damping, and sum the resulting path contributions. section 4.3 section 10.2.2
- Order candidate relationships by DWPC, then inspect the underlying paths to support interpretation and validation. section 4.3.1 section 4.3.1
Metformin and type 2 diabetes
For the CbGaD metapath, a Neo4j query computes PC and DWPC using degree terms raised to −0.4. Running it for metformin and type 2 diabetes mellitus produces a DWPC value of 0.0007. A path through a gene with degree 10 contributes more than one through a gene with degree 100, reducing hub-driven noise. section 10.2.2 section 10.2.2
Listing 10.15 DWPC between metformin and type 2 diabetes for CbGaD
MATCH path = (c:Compound)-[:BINDS_CbG]-(g)-[:ASSOCIATES_DaG]-(d:Disease)
WHERE c.name = 'Metformin' AND d.name = 'type 2 diabetes mellitus'
WITH
[
count{(v)-[:BINDS_CbG]-()},
count{()-[:BINDS_CbG]-(g)},
count{(g)-[:ASSOCIATES_DaG]-()},
count{()-[:ASSOCIATES_DaG]-(d)}
]
AS degrees, path, d
WITH
d.identifier AS disease_id,
d.name AS disease_name,
count(path) AS PC,
sum(reduce(pdp = 1.0, d in degrees| pdp * d ^ -0.4)) AS DWPC
RETURN
disease_id, disease_name, PC, DWPC
Inspect the complete Cypher query for calculating PC and DWPC on the metformin–type 2 diabetes CbGaD metapath. section 10.2.2
