/** * Test importing of Clinical Data File. * * @throws DaoException Database Access Error. * @throws IOException IO Error. */ @Test @Ignore("To be fixed") public void testImportClinicalDataSurvival() throws Exception { // TBD: change this to use getResourceAsStream() File clinicalFile = new File("target/test-classes/clinical_data.txt"); ImportClinicalData importClinicalData = new ImportClinicalData(study, clinicalFile); importClinicalData.importData(); LinkedHashSet<String> caseSet = new LinkedHashSet<String>(); caseSet.add("TCGA-A1-A0SB"); caseSet.add("TCGA-A1-A0SI"); caseSet.add("TCGA-A1-A0SE"); List<Patient> clinicalCaseList = DaoClinicalData.getSurvivalData(study.getInternalId(), caseSet); assertEquals(3, clinicalCaseList.size()); Patient clinical0 = clinicalCaseList.get(0); assertEquals(new Double(79.04), clinical0.getAgeAtDiagnosis()); assertEquals("DECEASED", clinical0.getOverallSurvivalStatus()); assertEquals("Recurred/Progressed", clinical0.getDiseaseFreeSurvivalStatus()); assertEquals(new Double(43.8), clinical0.getOverallSurvivalMonths()); assertEquals(new Double(15.05), clinical0.getDiseaseFreeSurvivalMonths()); Patient clinical1 = clinicalCaseList.get(1); assertEquals(new Double(55.53), clinical1.getAgeAtDiagnosis()); assertEquals("LIVING", clinical1.getOverallSurvivalStatus()); assertEquals("DiseaseFree", clinical1.getDiseaseFreeSurvivalStatus()); assertEquals(new Double(49.02), clinical1.getOverallSurvivalMonths()); assertEquals(new Double(49.02), clinical1.getDiseaseFreeSurvivalMonths()); Patient clinical2 = clinicalCaseList.get(2); assertEquals(null, clinical2.getDiseaseFreeSurvivalMonths()); }
/** * Test importing of Clinical Data File. * * @throws DaoException Database Access Error. * @throws IOException IO Error. */ @Test @Ignore("To be fixed") public void testImportClinicalDataSlice() throws Exception { // TBD: change this to use getResourceAsStream() File clinicalFile = new File("target/test-classes/clinical_data.txt"); ImportClinicalData importClinicalData = new ImportClinicalData(study, clinicalFile); importClinicalData.importData(); List<ClinicalParameterMap> slice = DaoClinicalData.getDataSlice(study.getInternalId(), Arrays.asList("PLATINUMSTATUS")); assertTrue(slice.size() >= 1); ClinicalParameterMap paramMap = slice.get(0); assertEquals("PLATINUMSTATUS", paramMap.getName()); assertEquals("Sensitive", paramMap.getValue("TCGA-A1-A0SD")); assertEquals("NA", paramMap.getValue("TCGA-A1-A0SE")); assertEquals(2, paramMap.getDistinctCategories().size()); }