Repository navigation
Expand file tree
/
Copy patharaxi.js
More file actions
1481 lines (1481 loc) · 52 KB
/
Copy patharaxi.js
File metadata and controls
1481 lines (1481 loc) · 52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// WARNING:
// This file was auto-generated by /mnt/data/orangeboard/devLM/RTX/code/UI/interactive/./dsl2json.py on: 2026-07-28 23:37:03
//
var araxi_commands = {
"add_qedge()": {
"parameters": {
"key": {
"is_required": false,
"examples": [
"e00",
"e01"
],
"default": "",
"type": "string",
"description": "Any string that is unique among all QEdge key fields, with recommended format e00, e01, e02, etc.\n If no value is provided, autoincrementing values beginning for e00 are used."
},
"subject": {
"is_required": true,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "key of the source QNode already present in the QueryGraph (e.g. n00, n01)"
},
"object": {
"is_required": true,
"examples": [
"n01",
"n02"
],
"type": "string",
"description": "key of the target QNode already present in the QueryGraph (e.g. n01, n02)"
},
"predicates": {
"is_required": false,
"examples": [
[
"biolink:physically_interacts_with"
],
[
"biolink:participates_in"
]
],
"type": "ARAXedge",
"description": "A list (n >= 1) of valid BioLink relationship predicates (e.g. [physically_interacts_with], [participates_in])"
},
"option_group_id": {
"is_required": false,
"examples": [
"1",
"a",
"b2",
"option"
],
"type": "string",
"description": "A group identifier indicating a group of nodes and edges should either all be included or all excluded. An optional match for all elements in this group. If not included Node will be treated as required."
},
"exclude": {
"is_required": false,
"enum": [
"true",
"false"
],
"examples": [
"true",
"false"
],
"type": "boolean",
"description": "If set to true, results with this node will be excluded. If set to false or not included nodes will be treated as part of a normal query."
}
},
"description": "The `add_qedge` command adds an additional QEdge to the QueryGraph in the Message object. Currently\n subject and object QNodes must already be present in the QueryGraph. The specified type is not currently checked that it is a\n valid Translator/BioLink relationship type, but it should be."
},
"add_qnode()": {
"parameters": {
"key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"default": "",
"type": "string",
"description": "Any string that is unique among all QNode key fields, with recommended format n00, n01, n02, etc.\n If no value is provided, autoincrementing values beginning for n00 are used."
},
"ids": {
"is_required": false,
"examples": [
"DOID:9281",
"[UniProtKB:P12345,UniProtKB:Q54321]"
],
"type": "string",
"description": "A list (n >= 1) of compact URI (CURIE) (e.g. [DOID:9281] or [UniProtKB:P12345,UniProtKB:Q54321])"
},
"name": {
"is_required": false,
"examples": [
"hypertension",
"insulin"
],
"type": "string",
"description": "Any name of a bioentity that will be resolved into a CURIE if possible or result in an error if not (e.g. hypertension, insulin)"
},
"categories": {
"is_required": false,
"examples": [
"protein",
"chemical_substance",
"disease"
],
"type": "ARAXnode",
"description": "A list (n >= 1) of valid BioLink bioentity categories (e.g. biolink:Protein, biolink:ChemicalEntity, biolink:Disease)"
},
"is_set": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"examples": [
"true",
"false"
],
"type": "boolean",
"description": "If set to true, this QNode represents a set of nodes that are all in common between the two other linked QNodes (assumed to be false if not specified or value is not recognized as true/t case insensitive)"
},
"option_group_id": {
"is_required": false,
"examples": [
"1",
"a",
"b2",
"option"
],
"type": "string",
"description": "A group identifier indicating a group of nodes and edges should either all be included or all excluded. An optional match for all elements in this group. If not included Node will be treated as required."
}
},
"description": "The `add_qnode` method adds an additional QNode to the QueryGraph in the Message object."
},
"add_qpath()": {
"parameters": {
"key": {
"is_required": false,
"examples": [
"e00",
"e01"
],
"default": "",
"type": "string",
"description": "Any string that is unique among all QPath key fields, with recommended format e00, e01, e02, etc.\n If no value is provided, autoincrementing values beginning for p00 are used."
},
"subject": {
"is_required": true,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "key of the source QNode already present in the QueryGraph (e.g. n00, n01)"
},
"object": {
"is_required": true,
"examples": [
"n01",
"n02"
],
"type": "string",
"description": "key of the target QNode already present in the QueryGraph (e.g. n01, n02)"
}
},
"description": "The `add_qpath` command adds an additional QPath to the QueryGraph in the Message object. Currently\n subject and object QNodes must already be present in the QueryGraph. The specified type is not currently checked that it is a\n valid Translator/BioLink relationship type, but it should be."
},
"create_envelope()": {
"parameters": {},
"description": "The `create_envelope` command creates a basic empty Response object with basic boilerplate metadata\n such as resource_id, schema_version, etc. filled in. This DSL command takes no arguments. This command is not explicitly\n necessary, as it is called implicitly when needed. e.g. If a DSL program begins with add_qnode(), the\n create_envelope() will be executed automatically if there is not yet a ARAXResponse. If there is already ARAXResponse in memory,\n then this command will destroy the previous one (in memory) and begin a new envelope."
},
"expand()": {
"parameters": {
"kp": {
"is_required": false,
"examples": [
"infores:retriever, [infores:retriever]"
],
"type": "string",
"default": null,
"description": "The KP(s) to ask for answers to the given query. KPs must be referred to by their 'infores' curies. Either a single infores curie or list of infores curies is valid."
},
"edge_key": {
"is_required": false,
"examples": [
"e00",
"[e00, e01]"
],
"type": "string",
"description": "A query graph edge ID or list of such IDs to expand (default is to expand entire query graph)."
},
"node_key": {
"is_required": false,
"examples": [
"n00",
"[n00, n01]"
],
"type": "string",
"description": "A query graph node ID or list of such IDs to expand (default is to expand entire query graph)."
},
"prune_threshold": {
"is_required": false,
"type": "integer",
"default": null,
"examples": [
500,
2000
],
"description": "The max number of nodes allowed to fulfill any intermediate QNode. Nodes in excess of this threshold will be pruned, using Fisher Exact Test to rank answers."
},
"kp_timeout": {
"is_required": false,
"type": "integer",
"default": null,
"examples": [
30,
120
],
"description": "The number of seconds Expand will wait for a response from a KP before cutting the query off and proceeding without results from that KP."
},
"return_minimal_metadata": {
"is_required": false,
"examples": [
"true",
"false"
],
"type": "boolean",
"description": "Whether to omit supporting data on nodes/edges in the results (e.g., publications, description, etc.)."
}
},
"description": "This command will expand (aka, answer/fill) your query graph in an edge-by-edge fashion, intelligently selecting which KPs to use for each edge. It selects KPs from the SmartAPI Registry based on the meta information provided by their TRAPI APIs, whether they have an endpoint running a matching TRAPI version, and whether they have an endpoint with matching maturity. For each QEdge, it queries the selected KPs concurrently; it will timeout for a particular KP if it decides it's taking too long to respond (this KP timeout can be controlled by the user). You may also optionally specify a particular KP to use via the 'kp' parameter (described below).\n\nCurrent candidate KPs include (for TRAPI 1.6, maturity 'development'): \ninfores:retriever. \n\n(Note that this list of KPs may change unexpectedly based on the SmartAPI registry.)"
},
"overlay(action=add_node_pmids)": {
"parameters": {
"max_num": {
"is_required": false,
"examples": [
"all",
5,
50
],
"type": "int or string",
"description": "The maximum number of values to return. Enter 'all' to return everything",
"default": 100
}
},
"description": "\nadd_node_pmids adds PubMed PMID's as node attributes to each node in the knowledge graph.\nThis information is obtained from mapping node identifiers to MeSH terms and obtaining which PubMed articles have this MeSH term\neither labeling in the metadata or has the MeSH term occurring in the abstract of the article.\n "
},
"overlay(action=compute_jaccard)": {
"parameters": {
"start_node_key": {
"is_required": true,
"examples": [
"DOID:1872",
"CHEBI:7476",
"UMLS:C1764836"
],
"type": "string",
"description": "A curie id specifying the starting node"
},
"intermediate_node_key": {
"is_required": true,
"examples": [
"DOID:1872",
"CHEBI:7476",
"UMLS:C1764836"
],
"type": "string",
"description": "A curie id specifying the intermediate node"
},
"end_node_key": {
"is_required": true,
"examples": [
"DOID:1872",
"CHEBI:7476",
"UMLS:C1764836"
],
"type": "string",
"description": "A curie id specifying the ending node"
},
"virtual_relation_label": {
"is_required": true,
"examples": [
"N1",
"J2",
"FET"
],
"type": "string",
"description": "An optional label to help identify the virtual edge in the relation field."
}
},
"description": "\ncompute_jaccard creates virtual edges and adds an edge attribute (with the property name 'jaccard_index') containing the following information:\nThe jaccard similarity measures how many 'intermediate_node_key's are shared in common between each 'start_node_key' and 'object_node_key'.\nThis is used for purposes such as \"find me all drugs ('start_node_key') that have many proteins ('intermediate_node_key') in common with this disease ('end_node_key').\"\nThis can be used for downstream filtering to concentrate on relevant bioentities.\n "
},
"overlay(action=compute_ngd)": {
"parameters": {
"default_value": {
"is_required": false,
"examples": [
"0",
"inf"
],
"default": "inf",
"type": "string",
"description": "The default value of the normalized Google distance (if its value cannot be determined)"
},
"virtual_relation_label": {
"is_required": false,
"examples": [
"N1",
"J2"
],
"type": "string",
"description": "An optional label to help identify the virtual edge in the relation field."
},
"subject_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific subject query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
},
"object_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific object query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
}
},
"description": "\ncompute_ngd computes a metric (called the normalized Google distance) based on edge soure/object node co-occurrence in abstracts of all PubMed articles.\nThis information is then included as an edge attribute with the name normalized_google_distance.\nYou have the choice of applying this to all edges in the knowledge graph, or only between specified subject/object qnode id's. If the later, virtual edges are added with the type specified by virtual_relation_label.\n "
},
"overlay(action=fisher_exact_test)": {
"parameters": {
"subject_qnode_key": {
"is_required": true,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific subject query node id (required)"
},
"virtual_relation_label": {
"is_required": true,
"examples": [
"N1",
"J2",
"FET"
],
"type": "string",
"description": "An optional label to help identify the virtual edge in the relation field."
},
"object_qnode_key": {
"is_required": true,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific object query node id (required)"
},
"rel_edge_key": {
"is_required": false,
"examples": [
"e00",
"e01"
],
"type": "string",
"description": "A specific QEdge id of edges connected to both subject nodes and object nodes in message KG (optional, otherwise all edges connected to both subject nodes and object nodes in message KG are considered), eg. 'e01'"
},
"filter_type": {
"is_required": false,
"examples": [
"top_n",
"cutoff",
null
],
"enum": [
"top_n",
"cutoff",
null
],
"type": "string or None",
"description": "If `top_n` is set this indicate the top number (the smallest) of p-values will be returned acording to what is specified in the `value` parameter. If `cutoff` is set then this indicates the p-value cutoff should be used to return results acording to what is specified in the `value` parameter. (optional, otherwise all results returned)",
"default": null,
"depends_on": "value"
},
"value": {
"is_required": false,
"examples": [
"all",
0.05,
0.95,
5,
50
],
"type": "int or float or None",
"description": "If `top_n` is set for `filter_type` this is an int indicating the top number (the smallest) of p-values to return. If instead `cutoff` is set then this is a float indicating the p-value cutoff to return the results. (optional, otherwise all results returned)",
"default": null
}
},
"description": "\nfisher_exact_test computes the Fisher's Exact Test p-values of the connection between a list of given nodes with specified query id (subject_qnode_key eg. 'n01') to their adjacent nodes with specified query id (e.g. object_qnode_key 'n02') in the message knowledge graph. \nThis information is then added as an edge attribute to a virtual edge which is then added to the query graph and knowledge graph.\nIt can also allow you to filter out the user-defined insignificance of connections based on a specified p-value cutoff or return the top n smallest p-value of connections and only add their corresponding virtual edges to the knowledge graph.\n "
},
"overlay(action=overlay_clinical_info)": {
"parameters": {
"COHD_method": {
"is_required": false,
"enum": [
"paired_concept_frequency",
"observed_expected_ratio",
"chi_square"
],
"default": "paired_concept_frequency",
"type": "string",
"description": "Which measure from COHD should be considered."
},
"virtual_relation_label": {
"is_required": false,
"examples": [
"N1",
"J2"
],
"type": "string",
"description": "An optional label to help identify the virtual edge in the relation field."
},
"subject_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific subject query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
},
"object_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific object query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
}
},
"description": "\noverlay_clinical_info overlay edges with information obtained from the knowledge provider (KP) Columbia Open Health Data (COHD).\nThis KP has a number of different functionalities, such as 'paired_concept_frequency', 'observed_expected_ratio', etc. which are mutually exclusive DSL parameters.\nAll information is derived from a 5 year hierarchical dataset: Counts for each concept include patients from descendant concepts. \nThis includes clinical data from 2013-2017 and includes 1,731,858 different patients.\nThis information is then included as an edge attribute.\n "
},
"overlay(action=overlay_exposures_data)": {
"parameters": {
"virtual_relation_label": {
"is_required": false,
"examples": [
"N1",
"J2"
],
"type": "string",
"description": "An optional label to help identify the virtual edge in the relation field."
},
"subject_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific subject query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
},
"object_qnode_key": {
"is_required": false,
"examples": [
"n00",
"n01"
],
"type": "string",
"description": "A specific object query node id (optional, otherwise applied to all edges, must have a virtual_relation_label to use this parameter)"
}
},
"description": "\noverlay_exposures_data overlays edges with p-values obtained from the ICEES+ (Integrated Clinical and Environmental Exposures Service) knowledge provider.\nThis information is included in edge attributes with the name 'icees_p-value'.\n "
},
"filter_kg(action=remove_edges_by_continuous_attribute)": {
"parameters": {
"edge_attribute": {
"is_required": true,
"examples": [
"jaccard_index",
"observed_expected_ratio",
"normalized_google_distance"
],
"type": "string",
"description": "The name of the edge attribute to filter on."
},
"direction": {
"is_required": true,
"enum": [
"above",
"below"
],
"type": "string",
"description": "Indictes whether to remove above or below the given threshold."
},
"threshold": {
"is_required": true,
"examples": [
5,
0.45
],
"min": "-inf",
"max": "inf",
"type": "float",
"description": "The threshold to filter with."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_continuous_attribute removes edges from the knowledge graph (KG) based on a a certain edge attribute.\nEdge attributes are a list of additional attributes for an edge.\nThis action interacts particularly well with overlay() as overlay() frequently adds additional edge attributes.\n "
},
"filter_kg(action=remove_edges_by_discrete_attribute)": {
"parameters": {
"edge_attribute": {
"is_required": true,
"examples": [
"subject",
"provided_by",
"is_defined_by"
],
"type": "string",
"description": "The name of the edge property to filter on."
},
"value": {
"is_required": true,
"examples": [
"DOID:8398",
"Pharos",
"ARAX/RTX"
],
"type": "string",
"description": "The edge property value to indicate which edges to remove."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_discrete_attribute removes edges from the knowledge graph (KG) based on a given edge property.\n "
},
"filter_kg(action=remove_edges_by_percentile)": {
"parameters": {
"edge_attribute": {
"is_required": true,
"examples": [
"jaccard_index",
"observed_expected_ratio",
"normalized_google_distance"
],
"type": "string",
"description": "The name of the edge attribute to filter on."
},
"direction": {
"is_required": false,
"enum": [
"above",
"below"
],
"type": "string",
"description": "Indictes whether to remove above or below the given threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `direction` defaults to above. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `direction` defaults to below."
},
"threshold": {
"is_required": false,
"examples": [
5,
0.45
],
"min": 0,
"max": 100,
"type": "float",
"description": "95 unless `edge_attribute` is also 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `threshold` will default to 5."
},
"top": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicate whether or not the threshold should be placed in top of the list. E.g. top set as True with type set as std_dev will set the cutoff for filtering as the mean + threshold * std_dev while setting top to False will set the cutoff as the mean - std_dev * threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `top` defaults to False. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `top` defaults to True."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_percentile removes edges from the knowledge graph (KG) based on a certain edge attribute using default heuristics.\nEdge attributes are a list of additional attributes for an edge.\nThis action interacts particularly well with overlay() as overlay() frequently adds additional edge attributes.\n "
},
"filter_kg(action=remove_edges_by_predicate)": {
"parameters": {
"edge_predicate": {
"is_required": true,
"examples": [
"contraindicated_for",
"affects",
"expressed_in"
],
"type": "ARAXedge",
"description": "The name of the edge predicate to filter by."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_predicate removes edges from the knowledge graph (KG) based on a given edge predicate.\n "
},
"filter_kg(action=remove_edges_by_std_dev)": {
"parameters": {
"edge_attribute": {
"is_required": true,
"examples": [
"jaccard_index",
"observed_expected_ratio",
"normalized_google_distance"
],
"type": "string",
"description": "The name of the edge attribute to filter on."
},
"direction": {
"is_required": false,
"enum": [
"above",
"below"
],
"type": "string",
"description": "Indictes whether to remove above or below the given threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `direction` defaults to above. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `direction` defaults to below."
},
"threshold": {
"is_required": false,
"examples": [
1,
0.45
],
"min": 0,
"max": "inf",
"type": "float",
"description": "The threshold to filter with.",
"default": 1
},
"top": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicate whether or not the threshold should be placed in top of the list. E.g. top set as True with type set as std_dev will set the cutoff for filtering as the mean + threshold * std_dev while setting top to False will set the cutoff as the mean - std_dev * threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `top` defaults to False. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `top` defaults to True."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_std_dev removes edges from the knowledge graph (KG) based on a certain edge attribute using default heuristics and the standard deviation of the values.\nEdge attributes are a list of additional attributes for an edge.\nThis action interacts particularly well with overlay() as overlay() frequently adds additional edge attributes.\n "
},
"filter_kg(action=remove_edges_by_top_n)": {
"parameters": {
"edge_attribute": {
"is_required": true,
"examples": [
"jaccard_index",
"observed_expected_ratio",
"normalized_google_distance"
],
"type": "string",
"description": "The name of the edge attribute to filter on."
},
"direction": {
"is_required": false,
"enum": [
"above",
"below"
],
"type": "string",
"description": "Indictes whether to remove above or below the given threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `direction` defaults to above. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `direction` defaults to below."
},
"n": {
"is_required": false,
"examples": [
5,
10,
50
],
"min": 0,
"max": "inf",
"type": "int",
"description": "The threshold to filter with.",
"default": 50
},
"top": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicate whether or not the threshold should be placed in top of the list. E.g. top set as True with type set as std_dev will set the cutoff for filtering as the mean + threshold * std_dev while setting top to False will set the cutoff as the mean - std_dev * threshold.",
"default": "a value dictated by the `edge_attribute` parameter. If `edge attribute` is 'ngd', 'chi_square', 'fisher_exact', or 'normalized_google_distance' then `top` defaults to False. If `edge_attribute` is 'jaccard_index', 'observed_expected_ratio', 'probability_treats' or anything else not listed then `top` defaults to True."
},
"remove_connected_nodes": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicates whether or not to remove the nodes connected to the edge.",
"default": "false"
},
"qnode_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If remove_connected_nodes is set to True this indicates if you only want nodes corresponding to one of the listed qnode_keys to be removed.If not provided the qnode_key will not be considered when filtering."
},
"qedge_keys": {
"is_required": false,
"examples": [
[
"n01",
"n02"
],
[]
],
"type": "list",
"description": "If included this indicates if you only want edge with one of the listed qedge_keys to be removed.If not provided the qedge_key will not be considered when filtering."
}
},
"description": "\nremove_edges_by_top_n removes edges from the knowledge graph (KG) based on a certain edge attribute using default heuristics.\nEdge attributes are a list of additional attributes for an edge.\nThis action interacts particularly well with overlay() as overlay() frequently adds additional edge attributes.\n "
},
"filter_kg(action=remove_general_concept_nodes)": {
"parameters": {
"perform_action": {
"is_required": false,
"enum": [
"true",
"false",
"True",
"False",
"t",
"f",
"T",
"F"
],
"type": "boolean",
"description": "Indicate whether or not to remove general concept nodes",
"default": "True"
}
},
"description": "\nremove_general_concept_nodes removes nodes from the knowledge graph (KG) that are general concepts.\n "
},
"filter_kg(action=remove_nodes_by_category)": {
"parameters": {
"node_category": {
"is_required": true,
"examples": [
"chemical_substance",
"disease"
],
"type": "ARAXnode",
"description": "The name of the node category to filter by."