File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " ga4ghphetools"
3- version = " 0.5.31 "
3+ version = " 0.5.32 "
44edition = " 2021"
55keywords = [" GA4GH" , " Phenopacket Schema" , " Human Phenotype Ontology" ]
66description = " Generate GA4GH phenopackets from tabular data"
Original file line number Diff line number Diff line change @@ -126,6 +126,20 @@ impl CohortDataQc {
126126 }
127127
128128
129+ pub fn check_metadata ( & self , cohort : & CohortData ) -> Result < ( ) , String > {
130+ let diseases = & cohort. disease_list ;
131+ if diseases. is_empty ( ) {
132+ return Err ( "Disease list empty" . to_string ( ) ) ;
133+ }
134+ for disease in diseases {
135+ if disease. mode_of_inheritance_list . is_empty ( ) {
136+ return Err ( format ! ( "No mode of inheritance provided for {} ({})" , disease. disease_label, disease. disease_id) ) ;
137+ }
138+ }
139+ Ok ( ( ) )
140+ }
141+
142+
129143 pub fn sanitize_header ( & self , duplets : & Vec < HpoTermDuplet > ) -> Result < Vec < HpoTermDuplet > , String > {
130144 let mut sanitized: Vec < HpoTermDuplet > = Vec :: new ( ) ;
131145 for duplet in duplets {
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ pub fn qc_assessment(
103103-> Result < ( ) , String > {
104104 let cohort_qc = CohortDataQc :: new ( hpo) ;
105105 cohort_qc. qc_check ( cohort_dto) ?;
106+ cohort_qc. check_metadata ( cohort_dto) ?;
106107 cohort_qc. qc_conflicting_pairs ( cohort_dto)
107108}
108109
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use std::collections::HashMap;
33use std:: sync:: Arc ;
44
55use ga4ghphetools:: dto:: cohort_dto:: GeneTranscriptData ;
6+ use ga4ghphetools:: dto:: cohort_dto:: ModeOfInheritance ;
67use ga4ghphetools:: dto:: etl_dto:: ColumnDto ;
78use ga4ghphetools:: dto:: etl_dto:: ColumnTableDto ;
89use ga4ghphetools:: dto:: etl_dto:: EtlCellValue ;
@@ -272,10 +273,15 @@ fn columns_lacking_hpo(
272273
273274#[ fixture]
274275fn disease_valid ( ) -> DiseaseData {
276+ let moi = ModeOfInheritance {
277+ hpo_id : "HP:0000006" . to_string ( ) ,
278+ hpo_label : "Autosomal dominant inheritance" . to_string ( ) ,
279+ citation : "PMID: 39471804" . to_string ( )
280+ } ;
275281 DiseaseData {
276282 disease_id : "OMIM:621016" . to_string ( ) ,
277283 disease_label : "Neurodevelopmental disorder with variable familial hypercholanemia" . to_string ( ) ,
278- mode_of_inheritance_list : vec ! [ ] ,
284+ mode_of_inheritance_list : vec ! [ moi ] ,
279285 gene_transcript_list : vec ! [ GeneTranscriptData {
280286 hgnc_id: "HGNC:30203" . to_string( ) ,
281287 gene_symbol: "WDR83OS" . to_string( ) ,
You can’t perform that action at this time.
0 commit comments