Back to index

python-biopython  1.60
Public Member Functions
test_BioSQL.ClosedLoopTest Class Reference

List of all members.

Public Member Functions

def test_NC_005816
def test_NC_000932
def test_NT_019265
def test_protein_refseq2
def test_no_ref
def test_one_of
def test_cor6_6
def test_arab1
def loop

Detailed Description

Test file -> BioSQL -> file.

Definition at line 450 of file test_BioSQL.py.


Member Function Documentation

def test_BioSQL.ClosedLoopTest.loop (   self,
  filename,
  format 
)

Definition at line 487 of file test_BioSQL.py.

00487 
00488     def loop(self, filename, format):
00489         original_records = list(SeqIO.parse(open(filename, "rU"), format))
00490         # now open a connection to load the database
00491         server = BioSeqDatabase.open_database(driver = DBDRIVER,
00492                                               user = DBUSER, passwd = DBPASSWD,
00493                                               host = DBHOST, db = TESTDB)
00494         db_name = "test_loop_%s" % filename #new namespace!
00495         db = server.new_database(db_name)
00496         count = db.load(original_records)
00497         self.assertEqual(count, len(original_records))
00498         server.commit()
00499         #Now read them back...
00500         biosql_records = [db.lookup(name=rec.name) \
00501                           for rec in original_records]
00502         #And check they agree
00503         self.assertTrue(compare_records(original_records, biosql_records))
00504         #Now write to a handle...
00505         handle = StringIO()
00506         SeqIO.write(biosql_records, handle, "gb")
00507         #Now read them back...
00508         handle.seek(0)
00509         new_records = list(SeqIO.parse(handle, "gb"))
00510         #And check they still agree
00511         self.assertEqual(len(new_records), len(original_records))
00512         for old, new in zip(original_records, new_records):
00513             #TODO - remove this hack because we don't yet write these (yet):
00514             for key in ["comment", "references", "db_source"]:
00515                 if key in old.annotations and key not in new.annotations:
00516                     del old.annotations[key]
00517             self.assertTrue(compare_record(old, new))
00518         #Done
00519         server.close()

Here is the call graph for this function:

Here is the caller graph for this function:

GenBank file to BioSQL and back to a GenBank file, arab1.

Definition at line 483 of file test_BioSQL.py.

00483 
00484     def test_arab1(self):
00485         """GenBank file to BioSQL and back to a GenBank file, arab1."""
00486         self.loop("GenBank/arab1.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, cor6_6.

Definition at line 479 of file test_BioSQL.py.

00479 
00480     def test_cor6_6(self):
00481         """GenBank file to BioSQL and back to a GenBank file, cor6_6."""
00482         self.loop("GenBank/cor6_6.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, NC_000932.

Definition at line 459 of file test_BioSQL.py.

00459 
00460     def test_NC_000932(self):
00461         """GenBank file to BioSQL and back to a GenBank file, NC_000932."""
00462         self.loop("GenBank/NC_000932.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, NC_005816.

Definition at line 455 of file test_BioSQL.py.

00455 
00456     def test_NC_005816(self):
00457         """GenBank file to BioSQL and back to a GenBank file, NC_005816."""
00458         self.loop("GenBank/NC_005816.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, noref.

Definition at line 471 of file test_BioSQL.py.

00471 
00472     def test_no_ref(self):
00473         """GenBank file to BioSQL and back to a GenBank file, noref."""
00474         self.loop("GenBank/noref.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, NT_019265.

Definition at line 463 of file test_BioSQL.py.

00463 
00464     def test_NT_019265(self):
00465         """GenBank file to BioSQL and back to a GenBank file, NT_019265."""
00466         self.loop("GenBank/NT_019265.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, one_of.

Definition at line 475 of file test_BioSQL.py.

00475 
00476     def test_one_of(self):
00477         """GenBank file to BioSQL and back to a GenBank file, one_of."""
00478         self.loop("GenBank/one_of.gb", "gb")

Here is the call graph for this function:

GenBank file to BioSQL and back to a GenBank file, protein_refseq2.

Definition at line 467 of file test_BioSQL.py.

00467 
00468     def test_protein_refseq2(self):
00469         """GenBank file to BioSQL and back to a GenBank file, protein_refseq2."""
00470         self.loop("GenBank/protein_refseq2.gb", "gb")

Here is the call graph for this function:


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