Query Metapaths Random Nodes
Return metapaths for a random source and target node for which at least one metapath with path count information exists in the database.
GET /v1/metapaths/random-nodes/?format=api
{ "source": { "id": 40736, "identifier": "55785", "identifier_type": "int", "name": "FGD6", "properties": { "url": "http://identifiers.org/ncbigene/55785", "source": "Entrez Gene", "license": "CC0 1.0", "chromosome": "12", "description": "FYVE, RhoGEF and PH domain containing 6" }, "metanode": "Gene" }, "target": { "id": 7519, "identifier": "152273", "identifier_type": "int", "name": "FGD5", "properties": { "url": "http://identifiers.org/ncbigene/152273", "source": "Entrez Gene", "license": "CC0 1.0", "chromosome": "3", "description": "FYVE, RhoGEF and PH domain containing 5" }, "metanode": "Gene" }, "path_counts": [ { "id": 39190269, "adjusted_p_value": 6.957362516228429e-05, "path_count": 14, "dwpc": 6.304201454002372, "p_value": 2.174175786321384e-06, "reversed": false, "metapath_abbreviation": "GpBPpG", "metapath_name": "Gene–participates–Biological Process–participates–Gene", "metapath_length": 2, "metapath_path_count_density": 0.0942277, "metapath_path_count_mean": 0.41078000000000003, "metapath_path_count_max": 387, "metapath_dwpc_raw_mean": 2.59996e-05, "metapath_n_similar": 32, "metapath_p_threshold": 0.000399182788117621, "metapath_id": "GpBPpG", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Biological Process", "participates", "both" ], [ "Biological Process", "Gene", "participates", "both" ] ], "dgp_id": 5735836, "dgp_source_degree": 14, "dgp_target_degree": 14, "dgp_n_dwpcs": 21780000, "dgp_n_nonzero_dwpcs": 2531824, "dgp_nonzero_mean": 2.4296112102511658, "dgp_nonzero_sd": 0.6814040931631121, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:PARTICIPATES_GpBP]-(n1)-[:PARTICIPATES_GpBP]-(n2:Gene)\nUSING JOIN ON n1\nWHERE n0.identifier = 55785 // FGD6\nAND n2.identifier = 152273 // FGD5\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:PARTICIPATES_GpBP]-()),\nsize(()-[:PARTICIPATES_GpBP]-(n1)),\nsize((n1)-[:PARTICIPATES_GpBP]-()),\nsize(()-[:PARTICIPATES_GpBP]-(n2))\n] AS degrees, path\nWITH path, reduce(pdp = 1.0, d in degrees| pdp * d ^ -0.5) AS PDP\nWITH collect({paths: path, PDPs: PDP}) AS data_maps, count(path) AS PC, sum(PDP) AS DWPC\nUNWIND data_maps AS data_map\nWITH data_map.paths AS path, data_map.PDPs AS PDP, PC, DWPC\nRETURN\n path AS neo4j_path,\n substring(reduce(s = '', node IN nodes(path)| s + '–' + node.name), 1) AS path,\n PDP,\n 100 * (PDP / DWPC) AS percent_of_DWPC\nORDER BY percent_of_DWPC DESC\nLIMIT 10" }, { "id": 17300457, "adjusted_p_value": 0.0008477281955284148, "path_count": 5, "dwpc": 6.256847849110503, "p_value": 2.6491506110262963e-05, "reversed": false, "metapath_abbreviation": "GpMFpG", "metapath_name": "Gene–participates–Molecular Function–participates–Gene", "metapath_length": 2, "metapath_path_count_density": 0.0281503, "metapath_path_count_mean": 0.07041339999999999, "metapath_path_count_max": 35, "metapath_dwpc_raw_mean": 2.58787e-05, "metapath_n_similar": 32, "metapath_p_threshold": 0.000399182788117621, "metapath_id": "GpMFpG", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Molecular Function", "participates", "both" ], [ "Molecular Function", "Gene", "participates", "both" ] ], "dgp_id": 5868997, "dgp_source_degree": 5, "dgp_target_degree": 5, "dgp_n_dwpcs": 266343200, "dgp_n_nonzero_dwpcs": 22178026, "dgp_nonzero_mean": 3.4252406506809043, "dgp_nonzero_sd": 0.6840858988747054, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:PARTICIPATES_GpMF]-(n1)-[:PARTICIPATES_GpMF]-(n2:Gene)\nUSING JOIN ON n1\nWHERE n0.identifier = 55785 // FGD6\nAND n2.identifier = 152273 // FGD5\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:PARTICIPATES_GpMF]-()),\nsize(()-[:PARTICIPATES_GpMF]-(n1)),\nsize((n1)-[:PARTICIPATES_GpMF]-()),\nsize(()-[:PARTICIPATES_GpMF]-(n2))\n] AS degrees, path\nWITH path, reduce(pdp = 1.0, d in degrees| pdp * d ^ -0.5) AS PDP\nWITH collect({paths: path, PDPs: PDP}) AS data_maps, count(path) AS PC, sum(PDP) AS DWPC\nUNWIND data_maps AS data_map\nWITH data_map.paths AS path, data_map.PDPs AS PDP, PC, DWPC\nRETURN\n path AS neo4j_path,\n substring(reduce(s = '', node IN nodes(path)| s + '–' + node.name), 1) AS path,\n PDP,\n 100 * (PDP / DWPC) AS percent_of_DWPC\nORDER BY percent_of_DWPC DESC\nLIMIT 10" } ], "n_metapaths": 2, "pathcount_table_random_id": 17300457, "pathcount_table_max_id": 169602979 }