You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ppkt/ppkt_exporter.rs
+2-29Lines changed: 2 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,14 @@ use ontolius::{Identified, TermId};
9
9
use ontolius::ontology::csr::FullCsrOntology;
10
10
use ontolius::ontology::{MetadataAware,OntologyTerms};
11
11
use phenopacket_tools::builders::time_elements::time_element_from_str;
12
-
use phenopackets::ga4gh::vrsatile::v1::{Expression,GeneDescriptor,MoleculeContext,VariationDescriptor,VcfRecord};
13
-
use phenopackets::schema::v2::core::genomic_interpretation::{Call,InterpretationStatus};
14
-
use phenopackets::schema::v2::core::interpretation::ProgressStatus;
15
-
use phenopackets::schema::v2::core::{Diagnosis,KaryotypicSex,OntologyClass};
12
+
use phenopackets::schema::v2::core::{KaryotypicSex,OntologyClass};
16
13
use phenopackets::schema::v2::core::vital_status::Status;
17
-
use phenopackets::schema::v2::core::{AcmgPathogenicityClassification,Disease,ExternalReference,GenomicInterpretation,Individual,Interpretation,MetaData,PhenotypicFeature,Sex,TherapeuticActionability,VariantInterpretation,VitalStatus};
14
+
use phenopackets::schema::v2::core::{Disease,ExternalReference,Individual,MetaData,PhenotypicFeature,Sex,VitalStatus};
Copy file name to clipboardExpand all lines: src/repo/disease_qc.rs
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,19 @@ impl DiseaseQc {
46
46
for ppkt in&self.ppkt_list{
47
47
let ac = Self::get_allele_count(ppkt);
48
48
if ! allowable_allele_counts.contains(&ac){
49
-
returnSome(format!("Expected counts of {:?} but got {} for {} ({})", allowable_allele_counts, ac,self.disease_data.disease_label,self.disease_data.disease_id))
49
+
returnSome(format!("{}: Expected counts of {:?} but got {} for {}.",ppkt.id,allowable_allele_counts, ac,self.disease_data_display()))
validity_of_new_column("Strabismus", "HP:0000486", "observed", &new_matrix).expect("Strabismus observed in DTO");
203
-
// If we get here, we have passed all tests!
204
-
assert!(true);
205
-
}
206
-
207
-
208
-
///Check that all entries in a column are the same
209
-
fn check_data_entries_unique(
210
-
new_matrix: &Vec<Vec<String>>,
211
-
colname: &str,
212
-
new_entry: &str) -> Result<(), String>
213
-
{
214
-
let col = get_index_of_column(&new_matrix, colname)?;
215
-
for i in 2..new_matrix.len() {
216
-
if new_matrix[i][col] != new_entry {
217
-
return Err(format!("Expected new_matrix[{}][{}]={} but got {}",
218
-
i, col, new_entry, new_matrix[i][col]));
219
-
}
220
-
}
221
-
Ok(())
222
-
}
223
-
224
-
225
-
226
-
227
-
/// Check that all entries in the constant, disease-gene-bundle block are identical
228
-
/// If so, then the new row contains the same values for
229
-
/// disease_id, disease_label, HGNC_id, gene_symbol, and transcript
230
-
#[rstest]
231
-
fn add_new_row_check_disease_gene_bundle(
232
-
matrix: Vec<Vec<String>>,
233
-
hpo: Arc<FullCsrOntology>,
234
-
case_5_dto: CaseDto,
235
-
hpo_dto_list_1: Vec<HpoTermDto>
236
-
) {
237
-
let mut phetools = PheTools::new(hpo);
238
-
assert_eq!(6, matrix.len()); // original matrix has headers and four data rows
239
-
let original_matrix = matrix.clone();
240
-
let res = phetools.load_matrix(matrix);
241
-
assert!(res.is_ok());
242
-
let dto_cloned = case_5_dto.clone(); // needed only for testing
243
-
let res = phetools.add_row_with_hpo_data(case_5_dto, hpo_dto_list_1);
244
-
assert!(res.is_ok());
245
-
// Check that the constant items are what we want
246
-
let new_matrix = phetools.get_string_matrix().expect("Could not unwrap matrix with added row");
247
-
assert_eq!(7, new_matrix.len());
248
-
check_data_entries_unique(&new_matrix, "disease_id", "OMIM:617865").expect("Expected all entries to be 'OMIM:617865'");
249
-
check_data_entries_unique(&new_matrix, "disease_label", "Neurodevelopmental disorder with movement abnormalities, abnormal gait, and autistic features")
250
-
.expect("Expected all entries to be 'Neurodevelopmental disorder with movement abnormalities, abnormal gait, and autistic features'");
251
-
check_data_entries_unique(&new_matrix, "HGNC_id", "HGNC:29316").expect("Expected all entries to be 'HGNC:29316'");
252
-
check_data_entries_unique(&new_matrix, "gene_symbol", "ZSWIM6").expect("Expected all entries to be 'ZSWIM6'");
253
-
check_data_entries_unique(&new_matrix, "transcript", "NM_020928.2").expect("Expected all entries to be 'NM_020928.2'");
0 commit comments