Skip to content

Commit

Permalink
add more patient clinical test data
Browse files Browse the repository at this point in the history
  • Loading branch information
onursumer committed Aug 13, 2024
1 parent 0a5dd3e commit 1369899
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ public void getClinicalDataCounts() {
assertEquals(2, findClinicaDataCount(numericalClinicalDataCounts, "4"));
assertEquals(4, findClinicaDataCount(numericalClinicalDataCounts, "2"));
assertEquals(2, findClinicaDataCount(numericalClinicalDataCounts, "1"));
// both empty string and 'NAN' count as NA
assertEquals(2, findClinicaDataCount(numericalClinicalDataCounts, "NA"));
// 1 empty string + 1 'NAN' + 11 samples with no data
assertEquals(13, findClinicaDataCount(numericalClinicalDataCounts, "NA"));

var categoricalClinicalDataCounts = studyViewMapper.getClinicalDataCounts(
studyViewFilter,
Expand All @@ -273,8 +273,8 @@ public void getClinicalDataCounts() {
assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "mda"));
assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ohsu"));
assertEquals(1, findClinicaDataCount(categoricalClinicalDataCounts, "ucsf"));
// both empty string and 'NA' count as NA
assertEquals(2, findClinicaDataCount(categoricalClinicalDataCounts, "NA"));
// 1 empty string + 1 'NA' + 11 samples with no data
assertEquals(13, findClinicaDataCount(categoricalClinicalDataCounts, "NA"));

var combinedClinicalDataCounts = studyViewMapper.getClinicalDataCounts(
studyViewFilter,
Expand All @@ -285,6 +285,32 @@ public void getClinicalDataCounts() {
);

assertEquals(13, combinedClinicalDataCounts.size());

var ageCounts = studyViewMapper.getClinicalDataCounts(
studyViewFilter,
CategorizedClinicalDataCountFilter.getBuilder().build(),
false,
List.of("age"),
Collections.emptyList()
);

assertEquals(14, ageCounts.size());
assertEquals(3, findClinicaDataCount(ageCounts, "<18"));
assertEquals(1, findClinicaDataCount(ageCounts, "18"));
assertEquals(1, findClinicaDataCount(ageCounts, "22"));
assertEquals(2, findClinicaDataCount(ageCounts, "42"));
assertEquals(1, findClinicaDataCount(ageCounts, "66"));
assertEquals(1, findClinicaDataCount(ageCounts, "66"));
assertEquals(1, findClinicaDataCount(ageCounts, "68"));
assertEquals(1, findClinicaDataCount(ageCounts, "77"));
assertEquals(1, findClinicaDataCount(ageCounts, "78"));
assertEquals(1, findClinicaDataCount(ageCounts, "79"));
assertEquals(2, findClinicaDataCount(ageCounts, "80"));
assertEquals(2, findClinicaDataCount(ageCounts, "82"));
assertEquals(1, findClinicaDataCount(ageCounts, "89"));
assertEquals(2, findClinicaDataCount(ageCounts, ">89"));
// 1 empty string + 1 'NAN' + 1 'N/A' + 1 patient without data
assertEquals(4, findClinicaDataCount(ageCounts, "NA"));
}

private int findClinicaDataCount(List<ClinicalDataCount> counts, String attrValue) {
Expand Down
45 changes: 45 additions & 0 deletions src/test/resources/clickhouse_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ insert into patient (internal_id,stable_id,cancer_study_id) values (309,'GENIE-T
insert into patient (internal_id,stable_id,cancer_study_id) values (310,'GENIE-TEST-310',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (311,'GENIE-TEST-311',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (312,'GENIE-TEST-312',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (313,'GENIE-TEST-313',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (314,'GENIE-TEST-314',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (315,'GENIE-TEST-315',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (316,'GENIE-TEST-316',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (317,'GENIE-TEST-317',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (318,'GENIE-TEST-318',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (319,'GENIE-TEST-319',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (320,'GENIE-TEST-320',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (321,'GENIE-TEST-321',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (322,'GENIE-TEST-322',3);
insert into patient (internal_id,stable_id,cancer_study_id) values (323,'GENIE-TEST-323',3);

insert into genetic_profile_samples (genetic_profile_id,ordered_sample_list) values(10,'1,2,3,4,5,6,7,8,9,10,11,');

Expand Down Expand Up @@ -149,6 +160,17 @@ insert into sample (internal_id,stable_id,sample_type,patient_id) values (309,'G
insert into sample (internal_id,stable_id,sample_type,patient_id) values (310,'GENIE-TEST-310-01','primary solid tumor',310);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (311,'GENIE-TEST-311-01','primary solid tumor',311);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (312,'GENIE-TEST-312-01','primary solid tumor',312);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (313,'GENIE-TEST-313-01','primary solid tumor',313);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (314,'GENIE-TEST-314-01','primary solid tumor',314);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (315,'GENIE-TEST-315-01','primary solid tumor',315);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (316,'GENIE-TEST-316-01','primary solid tumor',316);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (317,'GENIE-TEST-317-01','primary solid tumor',317);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (318,'GENIE-TEST-318-01','primary solid tumor',318);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (319,'GENIE-TEST-319-01','primary solid tumor',319);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (320,'GENIE-TEST-320-01','primary solid tumor',320);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (321,'GENIE-TEST-321-01','primary solid tumor',321);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (322,'GENIE-TEST-322-01','primary solid tumor',322);
insert into sample (internal_id,stable_id,sample_type,patient_id) values (323,'GENIE-TEST-323-01','primary solid tumor',323);


insert into mutation_event (mutation_event_id,entrez_gene_id,chr,start_position,end_position,reference_allele,tumor_seq_allele,protein_change,mutation_type,ncbi_build,strand,variant_type,db_snp_rs,db_snp_val_status,refseq_mrna_id,codon_change,uniprot_accession,protein_pos_start,protein_pos_end,canonical_transcript,keyword) values (2038,672,'17',41244748,41244748,'g','a','q934*','nonsense_mutation','37','+','snp','rs80357223','unknown','nm_007294','c.(2800-2802)cag>tag','p38398',934,934,1,'brca1 truncating');
Expand Down Expand Up @@ -374,6 +396,28 @@ insert into clinical_patient (internal_id,attr_id,attr_value) values (309,'cente
insert into clinical_patient (internal_id,attr_id,attr_value) values (310,'center','ucsf');
insert into clinical_patient (internal_id,attr_id,attr_value) values (311,'center','NA');
insert into clinical_patient (internal_id,attr_id,attr_value) values (312,'center','');
insert into clinical_patient (internal_id,attr_id,attr_value) values (301,'age','<18');
insert into clinical_patient (internal_id,attr_id,attr_value) values (302,'age','<18');
insert into clinical_patient (internal_id,attr_id,attr_value) values (303,'age','<18');
insert into clinical_patient (internal_id,attr_id,attr_value) values (304,'age','>89');
insert into clinical_patient (internal_id,attr_id,attr_value) values (305,'age','>89');
insert into clinical_patient (internal_id,attr_id,attr_value) values (306,'age','18');
insert into clinical_patient (internal_id,attr_id,attr_value) values (307,'age','22');
insert into clinical_patient (internal_id,attr_id,attr_value) values (308,'age','42');
insert into clinical_patient (internal_id,attr_id,attr_value) values (309,'age','42');
insert into clinical_patient (internal_id,attr_id,attr_value) values (310,'age','66');
insert into clinical_patient (internal_id,attr_id,attr_value) values (311,'age','68');
insert into clinical_patient (internal_id,attr_id,attr_value) values (312,'age','77');
insert into clinical_patient (internal_id,attr_id,attr_value) values (313,'age','78');
insert into clinical_patient (internal_id,attr_id,attr_value) values (314,'age','79');
insert into clinical_patient (internal_id,attr_id,attr_value) values (315,'age','80');
insert into clinical_patient (internal_id,attr_id,attr_value) values (316,'age','80');
insert into clinical_patient (internal_id,attr_id,attr_value) values (317,'age','82');
insert into clinical_patient (internal_id,attr_id,attr_value) values (318,'age','82');
insert into clinical_patient (internal_id,attr_id,attr_value) values (319,'age','89');
insert into clinical_patient (internal_id,attr_id,attr_value) values (320,'age','N/A');
insert into clinical_patient (internal_id,attr_id,attr_value) values (321,'age','');
insert into clinical_patient (internal_id,attr_id,attr_value) values (322,'age','NAN');

insert into clinical_sample (internal_id,attr_id,attr_value) values (1,'other_sample_id','5c631ce8-f96a-4c35-a459-556fc4ab21e1');
insert into clinical_sample (internal_id,attr_id,attr_value) values (1,'days_to_collection','276');
Expand Down Expand Up @@ -428,6 +472,7 @@ insert into clinical_attribute_meta (attr_id,display_name,description,datatype,p
insert into clinical_attribute_meta (attr_id,display_name,description,datatype,patient_attribute,priority,cancer_study_id) values ('pathology_report_file_name','pathology report file name','pathology report file name','string',0,'1',2);
insert into clinical_attribute_meta (attr_id,display_name,description,datatype,patient_attribute,priority,cancer_study_id) values ('sample_type','sample type','the type of sample (i.e.,normal,primary,met,recurrence).','string',0,'1',2);
insert into clinical_attribute_meta (attr_id,display_name,description,datatype,patient_attribute,priority,cancer_study_id) values ('mutation_count','mutaiton count','mutation count','number',0,'30',3);
insert into clinical_attribute_meta (attr_id,display_name,description,datatype,patient_attribute,priority,cancer_study_id) values ('age','age at metastatic diagnosis (years)','age at metastatic diagnosis (years)','number',1,'3',3);
insert into clinical_attribute_meta (attr_id,display_name,description,datatype,patient_attribute,priority,cancer_study_id) values ('center','center','center of sequencing','string',1,'1',3);

-- add genes, genetic entities and structural variants for structural_variant
Expand Down

0 comments on commit 1369899

Please sign in to comment.