-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes_indices_ccdi_model.yml
1855 lines (1850 loc) · 90.9 KB
/
es_indices_ccdi_model.yml
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
# Indices settings
Indices:
- index_name: study_participants
type: neo4j
mapping:
id:
type: keyword
pid:
type: keyword
participant_id:
type: keyword
race:
type: keyword
sex_at_birth:
type: keyword
ethnicity:
type: keyword
diagnosis_filters:
type: nested
properties:
age_at_diagnosis:
type: integer
diagnosis_anatomic_site:
type: keyword
disease_phase:
type: keyword
diagnosis_classification_system:
type: keyword
diagnosis_verification_status:
type: keyword
diagnosis_basis:
type: keyword
diagnosis_comment:
type: keyword
diagnosis_classification:
type: keyword
vital_status:
type: keyword
sample_file_filters:
type: nested
properties:
sample_anatomic_site:
type: keyword
participant_age_at_collection:
type: integer
sample_tumor_status:
type: keyword
tumor_classification:
type: keyword
assay_method:
type: keyword
file_type:
type: keyword
library_selection:
type: keyword
library_source:
type: keyword
library_strategy:
type: keyword
study_id:
type: keyword
phs_accession:
type: keyword
grant_id:
type: keyword
institution:
type: keyword
study_acronym:
type: keyword
study_short_title:
type: keyword
# Cypher query will be used to retrieve data from Neo4j, and index into Elasticsearch
cypher_query: "
MATCH (p:participant)
optional MATCH (p)<-[:of_sample]-(sm1:sample)<--(cl)<--(sm2:sample)
WHERE (cl: cell_line or cl: pdx)
optional Match (sm2)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, case COLLECT(distinct sm1) when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm1.anatomic_site,
participant_age_at_collection: sm1.participant_age_at_collection,
sample_tumor_status: sm1.sample_tumor_status,
tumor_classification: sm1.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample1,
case COLLECT(distinct sm2)
when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm2.anatomic_site,
participant_age_at_collection: sm2.participant_age_at_collection,
sample_tumor_status: sm2.sample_tumor_status,
tumor_classification: sm2.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample2
with p, apoc.coll.union(sample1,sample2) as cell_line_pdx_file_filters
OPTIONAL MATCH (p)<-[:of_sample]-(sm:sample)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, cell_line_pdx_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array' END,
file_type: file.file_type,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) AS general_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_clinical_measure_file]-(file1:clinical_measure_file)
with p, cell_line_pdx_file_filters, general_file_filters,sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Clinical data' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_clinical_measure_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_radiology_file]-(file1:radiology_file)
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Radiology imaging' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_radiology_file_filters
OPTIONAL MATCH (p)<-[:of_diagnosis]-(dg:diagnosis)
OPTIONAL MATCH (p)<-[:of_follow_up]-(fu:follow_up)
OPTIONAL MATCH (st:study)<-[:of_participant]-(p)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, participant_radiology_file_filters, fu, st, stf, stp, dg
RETURN DISTINCT
p.id as id,
p.id as pid,
p.participant_id as participant_id,
apoc.text.split(p.race, ';') as race,
p.sex_at_birth as sex_at_birth,
apoc.text.split(p.ethnicity, ';') as ethnicity,
COLLECT(DISTINCT {
age_at_diagnosis: dg.age_at_diagnosis,
diagnosis_anatomic_site: dg.anatomic_site,
disease_phase: dg.disease_phase,
diagnosis_classification_system: dg.diagnosis_classification_system,
diagnosis_verification_status: dg.diagnosis_verification_status,
diagnosis_basis: dg.diagnosis_basis,
diagnosis_comment: dg.diagnosis_comment,
diagnosis_classification: dg.diagnosis_classification
}) AS diagnosis_filters,
COLLECT(DISTINCT fu.vital_status) as vital_status,
apoc.coll.union(cell_line_pdx_file_filters, general_file_filters) + participant_clinical_measure_file_filters + participant_radiology_file_filters AS sample_file_filters,
st.study_id as study_id,
st.phs_accession as phs_accession,
COLLECT(DISTINCT stf.grant_id) as grant_id,
COLLECT(DISTINCT stp.institution) as institution,
st.study_acronym as study_acronym,
st.study_short_title as study_short_title
Union All
MATCH (st:study)
MATCH (st)<-[:of_clinical_measure_file]-(file:clinical_measure_file)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH file, st, stf, stp
RETURN DISTINCT
null as id,
null as pid,
null as participant_id,
null as race,
null as sex_at_birth,
null as ethnicity,
[] AS diagnosis_filters,
null as vital_status,
COLLECT(DISTINCT {
sample_anatomic_site: null,
participant_age_at_collection: null,
sample_tumor_status: null,
tumor_classification: null,
assay_method: 'Clinical data',
file_type: file.file_type,
library_selection: null,
library_source: null,
library_strategy: null
}) AS sample_file_filters,
st.study_id as study_id,
st.phs_accession as phs_accession,
COLLECT(DISTINCT stf.grant_id) as grant_id,
COLLECT(DISTINCT stp.institution) as institution,
st.study_acronym as study_acronym,
st.study_short_title as study_short_title
Union All
MATCH (st:study)
MATCH (st)<-[:of_cell_line|of_pdx]-(cl)<--(sm:sample)
Where (cl: cell_line or cl: pdx)
optional Match (sm)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH file, sm, st, stf, stp
RETURN DISTINCT
null as id,
null as pid,
null as participant_id,
null as race,
null as sex_at_birth,
null as ethnicity,
[] AS diagnosis_filters,
null as vital_status,
COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
ELSE file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) AS sample_file_filters,
st.study_id as study_id,
st.phs_accession as phs_accession,
COLLECT(DISTINCT stf.grant_id) as grant_id,
COLLECT(DISTINCT stp.institution) as institution,
st.study_acronym as study_acronym,
st.study_short_title as study_short_title
"
- index_name: participants
type: neo4j
mapping:
id:
type: keyword
participant_id:
type: keyword
race:
type: keyword
race_str:
type: keyword
sex_at_birth:
type: keyword
ethnicity:
type: keyword
ethnicity_str:
type: keyword
alternate_participant_id:
type: keyword
diagnosis_filters:
type: nested
properties:
age_at_diagnosis:
type: integer
diagnosis_anatomic_site:
type: keyword
disease_phase:
type: keyword
diagnosis_classification_system:
type: keyword
diagnosis_verification_status:
type: keyword
diagnosis_basis:
type: keyword
diagnosis_comment:
type: keyword
diagnosis_classification:
type: keyword
vital_status:
type: keyword
sample_file_filters:
type: nested
properties:
sample_anatomic_site:
type: keyword
participant_age_at_collection:
type: integer
sample_tumor_status:
type: keyword
tumor_classification:
type: keyword
assay_method:
type: keyword
file_type:
type: keyword
library_selection:
type: keyword
library_source:
type: keyword
library_strategy:
type: keyword
study_id:
type: keyword
phs_accession:
type: keyword
grant_id:
type: keyword
institution:
type: keyword
study_acronym:
type: keyword
study_short_title:
type: keyword
file_count:
type: integer
files:
type: text
fields:
keyword:
type: keyword
# Cypher query will be used to retrieve data from Neo4j, and index into Elasticsearch
cypher_query: "
MATCH (p:participant)
optional MATCH (p)<-[:of_sample]-(sm1:sample)<--(cl)<--(sm2:sample)
WHERE (cl: cell_line or cl: pdx)
optional Match (sm2)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, case COLLECT(distinct sm1) when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm1.anatomic_site,
participant_age_at_collection: sm1.participant_age_at_collection,
sample_tumor_status: sm1.sample_tumor_status,
tumor_classification: sm1.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample1,
case COLLECT(distinct sm2)
when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm2.anatomic_site,
participant_age_at_collection: sm2.participant_age_at_collection,
sample_tumor_status: sm2.sample_tumor_status,
tumor_classification: sm2.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample2
with p, apoc.coll.union(sample1,sample2) as cell_line_pdx_file_filters
OPTIONAL MATCH (p)<-[:of_sample]-(sm:sample)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, cell_line_pdx_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array' END,
file_type: file.file_type,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) AS general_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_clinical_measure_file]-(file1:clinical_measure_file)
with p, cell_line_pdx_file_filters, general_file_filters,sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Clinical data' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_clinical_measure_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_radiology_file]-(file1:radiology_file)
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Radiology imaging' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_radiology_file_filters
OPTIONAL MATCH (p)<-[*..4]-(file)
WHERE (file:clinical_measure_file OR file: sequencing_file OR file:pathology_file OR file:radiology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
OPTIONAL MATCH (p)<-[:of_diagnosis]-(dg:diagnosis)
OPTIONAL MATCH (p)<-[:of_follow_up]-(fu:follow_up)
OPTIONAL MATCH (st:study)<-[:of_participant]-(p)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, participant_radiology_file_filters, file, fu, st, stf, stp, dg
RETURN DISTINCT
p.id as id,
p.participant_id as participant_id,
apoc.text.split(p.race, ';') as race,
p.race as race_str,
p.sex_at_birth as sex_at_birth,
apoc.text.split(p.ethnicity, ';') as ethnicity,
p.ethnicity as ethnicity_str,
p.alternate_participant_id as alternate_participant_id,
COLLECT(DISTINCT {
age_at_diagnosis: dg.age_at_diagnosis,
diagnosis_anatomic_site: dg.anatomic_site,
disease_phase: dg.disease_phase,
diagnosis_classification_system: dg.diagnosis_classification_system,
diagnosis_verification_status: dg.diagnosis_verification_status,
diagnosis_basis: dg.diagnosis_basis,
diagnosis_comment: dg.diagnosis_comment,
diagnosis_classification: dg.diagnosis_classification
}) AS diagnosis_filters,
COLLECT(DISTINCT fu.vital_status) as vital_status,
apoc.coll.union(cell_line_pdx_file_filters, general_file_filters) + participant_clinical_measure_file_filters + participant_radiology_file_filters AS sample_file_filters,
st.study_id as study_id,
st.phs_accession as phs_accession,
COLLECT(DISTINCT stf.grant_id) as grant_id,
COLLECT(DISTINCT stp.institution) as institution,
st.study_acronym as study_acronym,
st.study_short_title as study_short_title,
COUNT(DISTINCT file.id) as file_count,
COLLECT(DISTINCT file.id) as files
"
- index_name: diagnosis
type: neo4j
mapping:
id:
type: keyword
pid:
type: keyword
diagnosis_id:
type: keyword
participant_id:
type: keyword
diagnosis_classification:
type: keyword
disease_phase:
type: keyword
diagnosis_classification_system:
type: keyword
diagnosis_verification_status:
type: keyword
diagnosis_basis:
type: keyword
diagnosis_comment:
type: keyword
diagnosis_anatomic_site:
type: keyword
age_at_diagnosis:
type: integer
race:
type: keyword
sex_at_birth:
type: keyword
ethnicity:
type: keyword
phs_accession:
type: keyword
study_id:
type: keyword
study_acronym:
type: keyword
study_short_title:
type: keyword
last_vital_status:
type: keyword
vital_status:
type: keyword
sample_file_filters:
type: nested
properties:
sample_anatomic_site:
type: keyword
participant_age_at_collection:
type: integer
sample_tumor_status:
type: keyword
tumor_classification:
type: keyword
assay_method:
type: keyword
file_type:
type: keyword
library_selection:
type: keyword
library_source:
type: keyword
library_strategy:
type: keyword
grant_id:
type: keyword
institution:
type: keyword
files:
type: text
fields:
keyword:
type: keyword
# Cypher query will be used to retrieve data from Neo4j, and index into Elasticsearch
cypher_query: "
MATCH (p:participant)
optional MATCH (p)<-[:of_sample]-(sm1:sample)<--(cl)<--(sm2:sample)
WHERE (cl: cell_line or cl: pdx)
optional Match (sm2)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, case COLLECT(distinct sm1) when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm1.anatomic_site,
participant_age_at_collection: sm1.participant_age_at_collection,
sample_tumor_status: sm1.sample_tumor_status,
tumor_classification: sm1.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample1,
case COLLECT(distinct sm2)
when [] then []
else COLLECT(DISTINCT {
sample_anatomic_site: sm2.anatomic_site,
participant_age_at_collection: sm2.participant_age_at_collection,
sample_tumor_status: sm2.sample_tumor_status,
tumor_classification: sm2.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array'
ELSE null END,
file_type: CASE LABELS(file)[0]
When null then null
else file.file_type end,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) end AS sample2
with p, apoc.coll.union(sample1,sample2) as cell_line_pdx_file_filters
OPTIONAL MATCH (p)<-[:of_sample]-(sm:sample)<--(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
with p, cell_line_pdx_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN 'Sequencing'
WHEN 'single_cell_sequencing_file' THEN 'Single Cell Sequencing'
WHEN 'cytogenomic_file' THEN 'Cytogenomic'
WHEN 'pathology_file' THEN 'Pathology imaging'
WHEN 'methylation_array_file' THEN 'Methylation array' END,
file_type: file.file_type,
library_selection: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_selection
WHEN 'single_cell_sequencing_file' THEN file.library_selection
ELSE null END,
library_source: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_source
WHEN 'single_cell_sequencing_file' THEN file.library_source
ELSE null END,
library_strategy: CASE LABELS(file)[0]
WHEN 'sequencing_file' THEN file.library_strategy
WHEN 'single_cell_sequencing_file' THEN file.library_strategy
ELSE null END
}) AS general_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_clinical_measure_file]-(file1:clinical_measure_file)
with p, cell_line_pdx_file_filters, general_file_filters,sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Clinical data' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_clinical_measure_file_filters
OPTIONAL Match (p)<-[:of_sample]-(sm:sample)
OPTIONAL MATCH (p)<-[:of_radiology_file]-(file1:radiology_file)
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, sm, COLLECT(DISTINCT file1.file_type) as file1_types
UNWIND (case file1_types when [] then [null] else file1_types end) AS types_1
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters, COLLECT(DISTINCT {
sample_anatomic_site: sm.anatomic_site,
participant_age_at_collection: sm.participant_age_at_collection,
sample_tumor_status: sm.sample_tumor_status,
tumor_classification: sm.tumor_classification,
assay_method: CASE types_1 when null then null else 'Radiology imaging' end,
file_type: types_1,
library_selection: null,
library_source: null,
library_strategy: null
}) as participant_radiology_file_filters
MATCH (dg:diagnosis)
MATCH (p)<-[:of_diagnosis]-(dg)
OPTIONAL MATCH (p)<-[*..4]-(file)
WHERE (file:clinical_measure_file OR file: sequencing_file OR file:pathology_file OR file:radiology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
OPTIONAL MATCH (p)<-[:of_follow_up]-(fu:follow_up)
with p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters,participant_radiology_file_filters, dg, file, fu order by fu.age_at_follow_up desc
OPTIONAL MATCH (st:study)<-[:of_participant]-(p)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH p, cell_line_pdx_file_filters, general_file_filters, participant_clinical_measure_file_filters,participant_radiology_file_filters, file, fu, st, stf, stp, dg
RETURN DISTINCT
dg.id as id,
p.id as pid,
dg.diagnosis_id as diagnosis_id,
dg.diagnosis_classification as diagnosis_classification,
dg.disease_phase as disease_phase,
dg.diagnosis_classification_system as diagnosis_classification_system,
dg.diagnosis_verification_status as diagnosis_verification_status,
dg.diagnosis_basis as diagnosis_basis,
dg.diagnosis_comment as diagnosis_comment,
dg.anatomic_site as diagnosis_anatomic_site,
dg.age_at_diagnosis as age_at_diagnosis,
p.participant_id as participant_id,
apoc.text.split(p.race, ';') as race,
p.sex_at_birth as sex_at_birth,
apoc.text.split(p.ethnicity, ';') as ethnicity,
st.study_id as study_id,
st.phs_accession as phs_accession,
st.study_acronym as study_acronym,
st.study_short_title as study_short_title,
head(collect(distinct fu.vital_status)) as last_vital_status,
COLLECT(DISTINCT fu.vital_status) as vital_status,
apoc.coll.union(cell_line_pdx_file_filters, general_file_filters) + participant_clinical_measure_file_filters + participant_radiology_file_filters AS sample_file_filters,
COLLECT(DISTINCT stf.grant_id) as grant_id,
COLLECT(DISTINCT stp.institution) as institution,
COLLECT(DISTINCT file.id) as files
"
- index_name: studies
type: neo4j
mapping:
id:
type: keyword
study_id:
type: keyword
grant_id:
type: keyword
pubmed_ids:
type: keyword
phs_accession:
type: keyword
study_short_title:
type: keyword
study_acronym:
type: keyword
PIs:
type: keyword
num_of_participants:
type: integer
diagnosis_cancer:
type: text
fields:
keyword:
type: keyword
diagnosis_anatomic_site:
type: text
fields:
keyword:
type: keyword
file_types:
type: text
fields:
keyword:
type: keyword
num_of_samples:
type: integer
num_of_files:
type: integer
files:
type: text
fields:
keyword:
type: keyword
# Cypher query will be used to retrieve data from Neo4j, and index into Elasticsearch
cypher_query: "
MATCH (st:study)<-[:of_participant]-(p:participant)
with st, count(p) as num_p
MATCH (st:study)<-[:of_participant]-(participant)<-[:of_diagnosis]-(dg:diagnosis)
with st, num_p, dg.diagnosis_classification as dg_cancers, count(dg.diagnosis_classification) as num_cancers
ORDER BY num_cancers desc
with st, num_p, collect(dg_cancers + ' (' + toString(num_cancers) + ')') as cancers
MATCH (st)<-[:of_participant]-(pa:participant)<-[:of_diagnosis]-(diag:diagnosis)
with st, num_p, cancers, diag.anatomic_site as dg_sites, count(diag.anatomic_site) as num_sites
ORDER BY num_sites desc
with st, num_p, cancers, collect(dg_sites + ' (' + toString(num_sites) + ')') as sites
MATCH (st)<-[*..5]-(fl)
WHERE (fl:clinical_measure_file OR fl: sequencing_file OR fl:pathology_file OR fl:radiology_file OR fl:methylation_array_file OR fl:single_cell_sequencing_file OR fl:cytogenomic_file)
with st, num_p, cancers, sites, fl.file_type as ft, count(fl.file_type) as num_ft
ORDER BY num_ft desc
with st, num_p, cancers, sites, collect(ft + ' (' + toString(num_ft) + ')') as file_types, sum(num_ft) as num_files
OPTIONAL MATCH (st)<-[:of_participant|of_cell_line|of_pdx]-(pcp)<-[:of_sample]-(sm1:sample)
WHERE (pcp:participant or pcp:cell_line or pcp:pdx)
WITH st, num_p, cancers, sites, file_types, num_files, count(distinct sm1.sample_id) as num_samples_1
OPTIONAL MATCH (st)<-[:of_participant]-(participant)<-[:of_sample]-(sm1:sample)<--(cp)<--(sm2:sample)
WHERE (cp:cell_line or cp:pdx)
WITH st, num_p, cancers, sites, file_types, num_files, num_samples_1, count(distinct sm2.sample_id) as num_samples_2
WITH st, num_p, cancers, sites, file_types, num_files, num_samples_1 + num_samples_2 as num_samples
MATCH (st)<-[*..5]-(file)
WHERE (file:clinical_measure_file OR file: sequencing_file OR file:pathology_file OR file:radiology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
OPTIONAL MATCH (st)<-[:of_publication]-(pub:publication)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
WHERE stp.personnel_type = 'PI'
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH st, num_p, cancers, sites, file_types, num_files, num_samples, file.id as file_id, stf, stp, pub
RETURN DISTINCT
st.id as id,
st.study_id as study_id,
apoc.text.join(COLLECT(DISTINCT stf.grant_id), ';') as grant_id,
apoc.text.join(COLLECT(DISTINCT pub.pubmed_id), ';') as pubmed_ids,
st.phs_accession as phs_accession,
st.study_short_title as study_short_title,
st.study_acronym as study_acronym,
apoc.text.join(COLLECT(DISTINCT stp.personnel_name), ';') as PIs,
num_p as num_of_participants,
cancers as diagnosis_cancer,
sites as diagnosis_anatomic_site,
file_types as file_types,
num_samples as num_of_samples,
num_files as num_of_files,
COLLECT(DISTINCT file_id) as files
"
- index_name: samples
type: neo4j
mapping:
id:
type: keyword
pid:
type: keyword
sample_id:
type: keyword
participant_id:
type: keyword
race:
type: keyword
sex_at_birth:
type: keyword
ethnicity:
type: keyword
sample_anatomic_site:
type: keyword
sample_diagnosis_classification:
type: keyword
sample_diagnosis_classification_system:
type: keyword
sample_diagnosis_verification_status:
type: keyword
sample_diagnosis_basis:
type: keyword
sample_diagnosis_comment:
type: keyword
participant_age_at_collection:
type: integer
sample_tumor_status:
type: keyword
tumor_classification:
type: keyword
study_id:
type: keyword
phs_accession:
type: keyword
study_acronym:
type: keyword
study_short_title:
type: keyword
diagnosis_filters:
type: nested
properties:
age_at_diagnosis:
type: integer
diagnosis_anatomic_site:
type: keyword
disease_phase:
type: keyword
diagnosis_classification_system:
type: keyword
diagnosis_verification_status:
type: keyword
diagnosis_basis:
type: keyword
diagnosis_comment:
type: keyword
diagnosis_classification:
type: keyword
vital_status:
type: keyword
file_filters:
type: nested
properties:
assay_method:
type: keyword
file_type:
type: keyword
library_selection:
type: keyword
library_source:
type: keyword
library_strategy:
type: keyword
grant_id:
type: keyword
institution:
type: keyword
file_count:
type: integer
files:
type: text
fields:
keyword:
type: keyword
# Cypher query will be used to retrieve data from Neo4j, and index into Elasticsearch
cypher_query: "
MATCH (sm:sample)
OPTIONAL MATCH (p:participant)<-[*..3]-(sm)
optional match (sm)<-[*..3]-(file)
WHERE (file: sequencing_file OR file:pathology_file OR file:methylation_array_file OR file:single_cell_sequencing_file OR file:cytogenomic_file)
MATCH (st:study)<-[:of_participant]-(p)
OPTIONAL MATCH (p)<-[:of_diagnosis]-(dg:diagnosis)
OPTIONAL MATCH (p)<-[:of_follow_up]-(fu:follow_up)
OPTIONAL MATCH (st)<-[:of_study_personnel]-(stp:study_personnel)
OPTIONAL MATCH (st)<-[:of_study_funding]-(stf:study_funding)
WITH file, fu, p, st, sm, stf, stp, dg
RETURN DISTINCT
sm.id as id,
p.id as pid,
sm.sample_id as sample_id,
p.participant_id as participant_id,
apoc.text.split(p.race, ';') as race,
p.sex_at_birth as sex_at_birth,
apoc.text.split(p.ethnicity, ';') as ethnicity,
sm.anatomic_site as sample_anatomic_site,
sm.diagnosis_classification as sample_diagnosis_classification,
sm.diagnosis_classification_system as sample_diagnosis_classification_system,
sm.diagnosis_verification_status as sample_diagnosis_verification_status,
sm.diagnosis_basis as sample_diagnosis_basis,
sm.diagnosis_comment as sample_diagnosis_comment,