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": 42325, "identifier": "1521", "identifier_type": "int", "name": "CTSW", "properties": { "url": "http://identifiers.org/ncbigene/1521", "source": "Entrez Gene", "license": "CC0 1.0", "chromosome": "11", "description": "cathepsin W" }, "metanode": "Gene" }, "target": { "id": 42454, "identifier": "WP2849_r84764", "identifier_type": "str", "name": "Hematopoietic Stem Cell Differentiation", "properties": { "url": "http://www.wikipathways.org/instance/WP2849_r84764", "source": "WikiPathways", "license": "CC BY 3.0" }, "metanode": "Pathway" }, "path_counts": [ { "id": 150020492, "adjusted_p_value": 3.538429971456995e-09, "path_count": 447, "dwpc": 1.533658118567671, "p_value": 7.528574407355309e-11, "reversed": false, "metapath_abbreviation": "GeAeGpPW", "metapath_name": "Gene–expresses–Anatomy–expresses–Gene–participates–Pathway", "metapath_length": 3, "metapath_path_count_density": 0.8626309999999999, "metapath_path_count_mean": 665.92, "metapath_path_count_max": 55830, "metapath_dwpc_raw_mean": 7.12822e-05, "metapath_n_similar": 47, "metapath_p_threshold": 0.0005654360906725609, "metapath_id": "GeAeGpPW", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Anatomy", "expresses", "both" ], [ "Anatomy", "Gene", "expresses", "both" ], [ "Gene", "Pathway", "participates", "both" ] ], "dgp_id": 32227181, "dgp_source_degree": 18, "dgp_target_degree": 40, "dgp_n_dwpcs": 679800, "dgp_n_nonzero_dwpcs": 679800, "dgp_nonzero_mean": 0.9106865779708386, "dgp_nonzero_sd": 0.0815101255371104, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:EXPRESSES_AeG]-(n1)-[:EXPRESSES_AeG]-(n2)-[:PARTICIPATES_GpPW]-(n3:Pathway)\nUSING JOIN ON n1\nWHERE n0.identifier = 1521 // CTSW\nAND n3.identifier = 'WP2849_r84764' // Hematopoietic Stem Cell Differentiation\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:EXPRESSES_AeG]-()),\nsize(()-[:EXPRESSES_AeG]-(n1)),\nsize((n1)-[:EXPRESSES_AeG]-()),\nsize(()-[:EXPRESSES_AeG]-(n2)),\nsize((n2)-[:PARTICIPATES_GpPW]-()),\nsize(()-[:PARTICIPATES_GpPW]-(n3))\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": 74693746, "adjusted_p_value": 5.72088384741973e-09, "path_count": 79, "dwpc": 2.6292687871108864, "p_value": 1.2172093292382404e-10, "reversed": false, "metapath_abbreviation": "GuAuGpPW", "metapath_name": "Gene–upregulates–Anatomy–upregulates–Gene–participates–Pathway", "metapath_length": 3, "metapath_path_count_density": 0.7365649999999999, "metapath_path_count_mean": 39.2263, "metapath_path_count_max": 5985, "metapath_dwpc_raw_mean": 6.212270000000001e-05, "metapath_n_similar": 47, "metapath_p_threshold": 0.0005654360906725609, "metapath_id": "GuAuGpPW", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Anatomy", "upregulates", "both" ], [ "Anatomy", "Gene", "upregulates", "both" ], [ "Gene", "Pathway", "participates", "both" ] ], "dgp_id": 36285913, "dgp_source_degree": 4, "dgp_target_degree": 40, "dgp_n_dwpcs": 3942400, "dgp_n_nonzero_dwpcs": 3942400, "dgp_nonzero_mean": 0.9930306824598528, "dgp_nonzero_sd": 0.18373189383623464, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:UPREGULATES_AuG]-(n1)-[:UPREGULATES_AuG]-(n2)-[:PARTICIPATES_GpPW]-(n3:Pathway)\nUSING JOIN ON n1\nWHERE n0.identifier = 1521 // CTSW\nAND n3.identifier = 'WP2849_r84764' // Hematopoietic Stem Cell Differentiation\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:UPREGULATES_AuG]-()),\nsize(()-[:UPREGULATES_AuG]-(n1)),\nsize((n1)-[:UPREGULATES_AuG]-()),\nsize(()-[:UPREGULATES_AuG]-(n2)),\nsize((n2)-[:PARTICIPATES_GpPW]-()),\nsize(()-[:PARTICIPATES_GpPW]-(n3))\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": 133718928, "adjusted_p_value": 4.2118412592767546e-07, "path_count": 122, "dwpc": 1.8774753489680418, "p_value": 8.961364381439904e-09, "reversed": false, "metapath_abbreviation": "GuAeGpPW", "metapath_name": "Gene–upregulates–Anatomy–expresses–Gene–participates–Pathway", "metapath_length": 3, "metapath_path_count_density": 0.75776, "metapath_path_count_mean": 131.376, "metapath_path_count_max": 21793, "metapath_dwpc_raw_mean": 4.89196e-05, "metapath_n_similar": 47, "metapath_p_threshold": 0.0005654360906725609, "metapath_id": "GuAeGpPW", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Anatomy", "upregulates", "both" ], [ "Anatomy", "Gene", "expresses", "both" ], [ "Gene", "Pathway", "participates", "both" ] ], "dgp_id": 36242913, "dgp_source_degree": 4, "dgp_target_degree": 40, "dgp_n_dwpcs": 3942400, "dgp_n_nonzero_dwpcs": 3942400, "dgp_nonzero_mean": 1.0630712407553817, "dgp_nonzero_sd": 0.11935122040465086, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:UPREGULATES_AuG]-(n1)-[:EXPRESSES_AeG]-(n2)-[:PARTICIPATES_GpPW]-(n3:Pathway)\nUSING JOIN ON n1\nWHERE n0.identifier = 1521 // CTSW\nAND n3.identifier = 'WP2849_r84764' // Hematopoietic Stem Cell Differentiation\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:UPREGULATES_AuG]-()),\nsize(()-[:UPREGULATES_AuG]-(n1)),\nsize((n1)-[:EXPRESSES_AeG]-()),\nsize(()-[:EXPRESSES_AeG]-(n2)),\nsize((n2)-[:PARTICIPATES_GpPW]-()),\nsize(()-[:PARTICIPATES_GpPW]-(n3))\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": 147667514, "adjusted_p_value": 1.66092837850422e-05, "path_count": 124, "dwpc": 1.9727873776766474, "p_value": 3.533890167030256e-07, "reversed": false, "metapath_abbreviation": "GeAuGpPW", "metapath_name": "Gene–expresses–Anatomy–upregulates–Gene–participates–Pathway", "metapath_length": 3, "metapath_path_count_density": 0.8334219999999999, "metapath_path_count_mean": 123.65899999999999, "metapath_path_count_max": 8985, "metapath_dwpc_raw_mean": 4.93454e-05, "metapath_n_similar": 47, "metapath_p_threshold": 0.0005654360906725609, "metapath_id": "GeAuGpPW", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Anatomy", "expresses", "both" ], [ "Anatomy", "Gene", "upregulates", "both" ], [ "Gene", "Pathway", "participates", "both" ] ], "dgp_id": 32381981, "dgp_source_degree": 18, "dgp_target_degree": 40, "dgp_n_dwpcs": 679800, "dgp_n_nonzero_dwpcs": 679800, "dgp_nonzero_mean": 0.9957200641928079, "dgp_nonzero_sd": 0.1564215899389041, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:EXPRESSES_AeG]-(n1)-[:UPREGULATES_AuG]-(n2)-[:PARTICIPATES_GpPW]-(n3:Pathway)\nUSING JOIN ON n1\nWHERE n0.identifier = 1521 // CTSW\nAND n3.identifier = 'WP2849_r84764' // Hematopoietic Stem Cell Differentiation\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:EXPRESSES_AeG]-()),\nsize(()-[:EXPRESSES_AeG]-(n1)),\nsize((n1)-[:UPREGULATES_AuG]-()),\nsize(()-[:UPREGULATES_AuG]-(n2)),\nsize((n2)-[:PARTICIPATES_GpPW]-()),\nsize(()-[:PARTICIPATES_GpPW]-(n3))\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": 44969987, "adjusted_p_value": 0.0014169753970056584, "path_count": 20, "dwpc": 1.837508762768958, "p_value": 3.014841270224805e-05, "reversed": false, "metapath_abbreviation": "GdAdGpPW", "metapath_name": "Gene–downregulates–Anatomy–downregulates–Gene–participates–Pathway", "metapath_length": 3, "metapath_path_count_density": 0.7038840000000001, "metapath_path_count_mean": 45.172, "metapath_path_count_max": 8841, "metapath_dwpc_raw_mean": 5.79283e-05, "metapath_n_similar": 47, "metapath_p_threshold": 0.0005654360906725609, "metapath_id": "GdAdGpPW", "metapath_reversed": false, "metapath_metaedges": [ [ "Gene", "Anatomy", "downregulates", "both" ], [ "Anatomy", "Gene", "downregulates", "both" ], [ "Gene", "Pathway", "participates", "both" ] ], "dgp_id": 31365325, "dgp_source_degree": 2, "dgp_target_degree": 40, "dgp_n_dwpcs": 3443000, "dgp_n_nonzero_dwpcs": 3442927, "dgp_nonzero_mean": 0.7545875803766421, "dgp_nonzero_sd": 0.2004559810554872, "dgp_reversed": false, "cypher_query": "MATCH path = (n0:Gene)-[:DOWNREGULATES_AdG]-(n1)-[:DOWNREGULATES_AdG]-(n2)-[:PARTICIPATES_GpPW]-(n3:Pathway)\nUSING JOIN ON n1\nWHERE n0.identifier = 1521 // CTSW\nAND n3.identifier = 'WP2849_r84764' // Hematopoietic Stem Cell Differentiation\nAND n0 <> n2\nWITH\n[\nsize((n0)-[:DOWNREGULATES_AdG]-()),\nsize(()-[:DOWNREGULATES_AdG]-(n1)),\nsize((n1)-[:DOWNREGULATES_AdG]-()),\nsize(()-[:DOWNREGULATES_AdG]-(n2)),\nsize((n2)-[:PARTICIPATES_GpPW]-()),\nsize(()-[:PARTICIPATES_GpPW]-(n3))\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": 5, "pathcount_table_random_id": 150020492, "pathcount_table_max_id": 169602979 }