-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path0180_mulGrpAg.gremlin
31 lines (28 loc) · 1.06 KB
/
0180_mulGrpAg.gremlin
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
g.V().hasLabel ( 'Concept:Path:Resource' ).as ( 'pw' )
.coalesce ( values ( 'prefName' ), constant ( '' ) ).as ( 'pwName' )
.union
(
// From pway back to enzyme
constant ( 'enz' ).as ( 'type' ).select ( 'pw' )
.in ( 'part_of' ).hasLabel ( 'Concept:Resource:Transport' ).as ( 'trn' )
.union
(
// via compound
__.in ( 'cs_by', 'pd_by' ).hasLabel ( 'Comp:Concept:Resource' ).as ( 'cmp' )
.in ( 'ac_by', 'in_by' ).hasLabel ( 'Concept:Enzyme:Resource' ),
// via transport
select ( 'trn' ).out ( 'ca_by' ).hasLabel ( 'Concept:Enzyme:Resource' )
).as ( 'enz' )
// From enzyme back to protein
.both ( 'is_a', 'ac_by' ).hasLabel ( 'Concept:Protein:Resource' ).as ( 'prot' ),
// From pway back to protein, via reaction
constant ( 'react' ).as ( 'type' ).select ( 'pw' )
.in ( 'part_of' ).hasLabel ( 'Concept:Reaction:Resource' )
.in ( 'pd_by', 'cs_by' ).hasLabel ( 'Concept:Protein:Resource' ).as ( 'prot' )
)
// count the proteins
.groupCount ()
.by ( select ( 'pwName', 'type' ) )
.limit ( 100 )
.unfold ()
// DEBUG .order ().by ( keys )