Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_NNGene.SchemaFinderTest Class Reference

List of all members.

Public Member Functions

def setUp
def test_find
def test_find_differences

Public Attributes

 test_records
 diff_records
 num_schemas
 finder

Detailed Description

Test finding schemas from a set of sequences.

Definition at line 387 of file test_NNGene.py.


Member Function Documentation

Definition at line 390 of file test_NNGene.py.

00390 
00391     def setUp(self):
00392         test_file = os.path.join('NeuralNetwork', 'enolase.fasta')
00393         diff_file = os.path.join('NeuralNetwork', 'repeat.fasta')
00394 
00395         self.test_records = []
00396         self.diff_records = []
00397 
00398         # load the records
00399         for file, records in ((test_file, self.test_records),
00400                               (diff_file, self.diff_records)):
00401 
00402             handle = open(file, 'r')
00403             records.extend(SeqIO.parse(handle, "fasta",
00404                                        alphabet=IUPAC.unambiguous_dna))
00405             handle.close()
00406 
00407         self.num_schemas = 2
00408         schema_ga = Schema.GeneticAlgorithmFinder()
00409         schema_ga.min_generations = 1
00410         self.finder = Schema.SchemaFinder(num_schemas = self.num_schemas,
00411                                           schema_finder = schema_ga)

Find schemas from sequence inputs.

Definition at line 412 of file test_NNGene.py.

00412 
00413     def test_find(self):
00414         """Find schemas from sequence inputs.
00415         """
00416         # this test takes too long
00417         if VERBOSE:
00418             repository = self.finder.find(self.test_records + self.diff_records)
00419             schemas = repository.get_all()
00420 
00421             assert len(schemas) >= self.num_schemas, "Got too few schemas."

Find schemas that differentiate between two sets of sequences.

Definition at line 422 of file test_NNGene.py.

00422 
00423     def test_find_differences(self):
00424         """Find schemas that differentiate between two sets of sequences.
00425         """
00426         # this test takes too long
00427         if VERBOSE:
00428             repository = self.finder.find_differences(self.test_records,
00429                                                       self.diff_records)
00430             schemas = repository.get_all()
00431 
00432             assert len(schemas) >= self.num_schemas, "Got too few schemas."
        

Member Data Documentation

Definition at line 395 of file test_NNGene.py.

Definition at line 409 of file test_NNGene.py.

Definition at line 406 of file test_NNGene.py.

Definition at line 394 of file test_NNGene.py.


The documentation for this class was generated from the following file: