def _handleMissingAnnotations(self, m): missingHeaderAnnotations = MutUtils.retrieveMissingAnnotations(m, TcgaVcfOutputRenderer.requiredHeaderAnnotations) missingMutAnnotations = MutUtils.retrieveMissingAnnotations(m, TcgaVcfOutputRenderer.requiredMutAnnotations) if len(missingHeaderAnnotations) > 0: sError = "The following annotations are required for rendering a TCGA VCF 1.1, but were not found: " + str( missingHeaderAnnotations) self.logger.error(sError) raise MissingAnnotationException(sError) if len(missingMutAnnotations) > 0: sError = "The following annotations important for rendering a TCGA VCF 1.1. Proceeding... : " + str( missingMutAnnotations) self.logger.warn(sError)
def _handleMissingAnnotations(self, m): missingHeaderAnnotations = MutUtils.retrieveMissingAnnotations( m, TcgaVcfOutputRenderer.requiredHeaderAnnotations) missingMutAnnotations = MutUtils.retrieveMissingAnnotations( m, TcgaVcfOutputRenderer.requiredMutAnnotations) if len(missingHeaderAnnotations) > 0: sError = "The following annotations are required for rendering a TCGA VCF 1.1, but were not found: " + str( missingHeaderAnnotations) self.logger.error(sError) raise MissingAnnotationException(sError) if len(missingMutAnnotations) > 0: sError = "The following annotations important for rendering a TCGA VCF 1.1. Proceeding... : " + str( missingMutAnnotations) self.logger.warn(sError)
def testRetrieveMissingAnnotations(self): """ Test simple case. """ m = MutationDataFactory.default_create() m.createAnnotation("a1", "1") m.createAnnotation("a2", "1") m.createAnnotation("a3", "1") m.createAnnotation("a4", "1") annotationNames = ["a3", "a2"] result = MutUtils.retrieveMissingAnnotations(m,annotationNames) self.assertIsNotNone(result) self.assertTrue(len(result) == 0, "Result was not empty: " + str(result)) annotationNames = ["zztop", "a1", "blah", "dummy"] result = MutUtils.retrieveMissingAnnotations(m,annotationNames) self.assertTrue(result[0] == "blah", "Result was not sorted") self.assertTrue("blah" in result and "dummy" in result and "zztop" in result, "Incorrect elements (Truth: [zztop, blah, dummy]): " + str(result))
def testRetrieveMissingAnnotations(self): """ Test simple case. """ m = MutationData() m.createAnnotation("a1", "1") m.createAnnotation("a2", "1") m.createAnnotation("a3", "1") m.createAnnotation("a4", "1") annotationNames = ["a3", "a2"] result = MutUtils.retrieveMissingAnnotations(m, annotationNames) self.assertIsNotNone(result) self.assertTrue( len(result) == 0, "Result was not empty: " + str(result)) annotationNames = ["zztop", "a1", "blah", "dummy"] result = MutUtils.retrieveMissingAnnotations(m, annotationNames) self.assertTrue(result[0] == "blah", "Result was not sorted") self.assertTrue( "blah" in result and "dummy" in result and "zztop" in result, "Incorrect elements (Truth: [zztop, blah, dummy]): " + str(result))