def test_random_sparse_gene_strategy(self): expected = [({'gene_1', 'gene_2'}, {'gene_3', 'gene_4'}), ({'gene_1', 'gene_3'}, {'gene_2', 'gene_4'})] strategy = randomsparse.GeneDeletionStrategy(self._mm, self._assoc) essential, deleted = randomsparse.random_sparse(strategy, self._prob, self._obj_reaction, flux_threshold=100) self.assertTrue((essential, deleted) in expected)
def test_random_sparse_reaction_strategy(self): expected = [({'rxn_1', 'rxn_6', 'ex_A', 'rxn_2', 'rxn_4'}, {'rxn_3', 'rxn_5'}), ({'rxn_1', 'rxn_6', 'ex_A', 'rxn_3', 'rxn_5'}, {'rxn_2', 'rxn_4'})] strategy = randomsparse.ReactionDeletionStrategy(self._mm) essential, deleted = randomsparse.random_sparse(strategy, self._prob, self._obj_reaction, flux_threshold=100) self.assertTrue((essential, deleted) in expected)
def test_random_sparse_gene_strategy(self): expected = [ ({'gene_1', 'gene_2'}, {'gene_3', 'gene_4'}), ({'gene_1', 'gene_3'}, {'gene_2', 'gene_4'}) ] strategy = randomsparse.GeneDeletionStrategy( self._mm, self._assoc) essential, deleted = randomsparse.random_sparse( strategy, self._prob, self._obj_reaction, flux_threshold=100) self.assertTrue((essential, deleted) in expected)
def test_random_sparse_reaction_strategy(self): expected = [ ({'rxn_1', 'rxn_6', 'ex_A', 'rxn_2', 'rxn_4'}, {'rxn_3', 'rxn_5'}), ({'rxn_1', 'rxn_6', 'ex_A', 'rxn_3', 'rxn_5'}, {'rxn_2', 'rxn_4'}) ] strategy = randomsparse.ReactionDeletionStrategy(self._mm) essential, deleted = randomsparse.random_sparse( strategy, self._prob, self._obj_reaction, flux_threshold=100) self.assertTrue((essential, deleted) in expected)