def setUp(self): self.alphabet = IUPAC.ambiguous_dna self.test_file = os.path.join("NeuralNetwork", "patternio.txt") #Remove any existing copy of the output file, if os.path.isfile(self.test_file): os.remove(self.test_file) self.pattern_io = Pattern.PatternIO(self.alphabet)
def test_easy_from_motifs(self): """Generating schema from a simple list of motifs.""" motif_bank = Pattern.PatternRepository(self.motifs) schema_bank = self.factory.from_motifs(motif_bank, .5, 2) if VERBOSE: print("\nSchemas:") for schema in schema_bank.get_all(): print("%s: %s" % (schema, schema_bank.count(schema)))
def setUp(self): self.motifs = {"GATC" : 30, "GGGG" : 10, "GTAG" : 0, "AAAA" : -10, "ATAT" : -20} self.repository = Pattern.PatternRepository(self.motifs)
def test_easy_from_motifs(self): """Generating schema from a simple list of motifs. """ motifs = {"GATCGAA": 20, "GATCGAT": 15, "GATTGAC": 25, "TTTTTTT": 10} motif_bank = Pattern.PatternRepository(motifs) schema_bank = self.factory.from_motifs(motif_bank, .5, 2) if VERBOSE: print "\nSchemas:" for schema in schema_bank.get_all(): print "%s: %s" % (schema, schema_bank.count(schema))
def test_no_motifs(self): """Test generating schema when no motif given.""" motif_bank = Pattern.PatternRepository({}) with self.assertRaises(ValueError): self.factory.from_motifs(motif_bank, .5, 2)