Skip to content

Commit

Permalink
Updated SBG Manifest Cypher query
Browse files Browse the repository at this point in the history
  • Loading branch information
n2iw committed Mar 30, 2020
1 parent 20d7c8c commit c530962
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions queries/ctdc_queires.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ RETURN t.clinical_trial_id AS Trial_ID, t.clinical_trial_designation AS Trial_Co


// Final version to generate SBG manifest
MATCH (t:clinical_trial)<--(a:arm)<--(c:case)<--(s:specimen)<--(n:nucleic_acid)<-[*]-(f:file), (s)<-[*]-(ar:assignment_report)
WITH DISTINCT f, t, a, c, ar, s, n
MATCH(t:clinical_trial)<--(a:arm)<--(c:case)<--(s:specimen)<--(n:nucleic_acid)<--(sa:sequencing_assay)<--(f:file),
(s)<-[*]-(ar:assignment_report), (sa)<--(v:variant_report)
WITH DISTINCT f, t, a, c, ar, s, n, sa, v
OPTIONAL MATCH (s)<--(i_pten:ihc_assay_report)
WHERE i_pten.ihc_test_gene = 'PTEN'
WITH DISTINCT f, t, a, c, ar, s, n, i_pten
WITH DISTINCT f, t, a, c, ar, s, n, sa, v, i_pten
OPTIONAL MATCH (s)<--(i_msh2:ihc_assay_report)
WHERE i_msh2.ihc_test_gene = 'MSH2'
WITH DISTINCT f, t, a, c, ar, s, n, i_pten, i_msh2
WITH DISTINCT f, t, a, c, ar, s, n, sa, v, i_pten, i_msh2
OPTIONAL MATCH (s)<--(i_mlh1:ihc_assay_report)
WHERE i_mlh1.ihc_test_gene = 'MLH1'
WITH DISTINCT f, t, a, c, ar, s, n, i_pten, i_msh2, i_mlh1
WITH DISTINCT f, t, a, c, ar, s, n, sa, v, i_pten, i_msh2, i_mlh1
OPTIONAL MATCH (s)<--(i_rb:ihc_assay_report)
WHERE i_rb.ihc_test_gene = 'RB'
WITH DISTINCT f, t, a, c, ar, s, n, i_pten, i_msh2, i_mlh1, i_rb
WITH DISTINCT f, t, a, c, ar, s, n, sa, v, i_pten, i_msh2, i_mlh1, i_rb
RETURN t.clinical_trial_id AS Trial_ID, t.clinical_trial_designation AS Trial_Code,
a.arm_id AS Treatment_Arm,
c.case_id AS Case_ID, c.gender AS Gender, c.race AS Race, c.ethnicity AS Ethnicity, c.disease AS Diagnosis,
Expand All @@ -40,8 +41,14 @@ RETURN t.clinical_trial_id AS Trial_ID, t.clinical_trial_designation AS Trial_Co
coalesce(i_msh2.ihc_test_result, 'UNKNOWN') AS MSH2_IHC_Status,
coalesce(i_rb.ihc_test_result, 'UNKNOWN') AS RB_IHC_Status,
ar.assignment_outcome AS Assignment_Outcome,
'Targeted NGS' AS `Experimental_strategy`,
'Ion Torrent' AS Platform,
'GRCh37' AS Reference_genome,
sa.experimental_method + ':' + CASE f.file_type
WHEN 'Aligned DNA reads file' THEN ' DNA'
WHEN 'Aligned RNA reads file' THEN ' RNA'
WHEN 'Variants file' THEN ' DNA/RNA'
WHEN 'Index file' THEN ' '
END AS `Experimental_strategy`,
sa.platform AS Platform,
v.reference_genome AS Reference_genome,
f.uuid AS File_UUID, f.file_name AS File_Name, f.file_type AS File_Type, f.file_size AS File_Size,
f.md5sum AS md5sum, f.file_location AS File_Location, 'dg.4DFC/' + f.uuid AS GUID
f.md5sum AS md5sum, f.file_location AS File_Location, 'dg.4DFC/' + f.uuid AS GUID
ORDER BY Case_ID, File_Name

0 comments on commit c530962

Please sign in to comment.