예제 #1
0
    def test_remove_models(self):
        """can remove a partial set of data"""

        # get an initial set of database row counts
        num_desc = self.desctab.count_rows()
        num_phens = self.phenstab.count_rows()
        num_score = self.scoretab.count_rows()
        
        # run a model removal using a small descriptions file
        config = IMPCTestConfig()
        config.model_descriptions = "prep-IMPC-descriptions-update.tsv"
        config.model_phenotypes = None
        impc = Phenoscoring(config)
        impc.remove()
        
        # the number of rows in tables should decrease
        self.assertLess(self.desctab.count_rows(), num_desc,
                        "number of models should decrease")
        self.assertLess(self.phenstab.count_rows(), num_phens,
                        "number of phenotypes should decrease")
        self.assertLess(self.scoretab.count_rows(), num_score,
                        "number of score entries should decrease")
예제 #2
0
    pipeline = Phenoscoring(config)
    if config.action == "build":
        # create a new sqlite database with references
        pipeline.build()

    if config.action == "clearmodels":
        # remove all models and model scores from the database
        pipeline.clearmodels()

    if config.action == "update":
        # add new or update existing model defintions/phenotypes
        pipeline.update()

    if config.action == "remove":
        # remove a subset of models from the database
        pipeline.remove()

    if config.action == "recompute":
        # remove all scores and re-generate them from scratch
        pipeline.recompute()

    if config.action == "export":
        # write a database table into a tsv file
        pipeline.export()

    if config.action == "representations":
        # compute complete representations for references and models
        pipeline.export_representations()

    if config.action == "explain":
        # provide step-by-step explanation of scoring