Back to index

python-biopython  1.60
test_TogoWS.py
Go to the documentation of this file.
00001 # Copyright 2010-2011 by Peter Cock.  All rights reserved.
00002 # This code is part of the Biopython distribution and governed by its
00003 # license.  Please see the LICENSE file that should have been included
00004 # as part of this package.
00005 
00006 """Testing Bio.TogoWS online code.
00007 """
00008 import sys
00009 import unittest
00010 import urllib
00011 from StringIO import StringIO
00012 
00013 import requires_internet
00014 requires_internet.check()
00015 
00016 #We want to test these:
00017 from Bio import TogoWS
00018 
00019 #In order to check any sequences returned
00020 from Bio import SeqIO
00021 from Bio.SeqUtils.CheckSum import seguid
00022 from Bio import Medline
00023 
00024 #####################################################################
00025 
00026 class TogoFields(unittest.TestCase):
00027     def test_invalid_database(self):
00028         """Check asking for fields of invalid database fails"""
00029         self.assertRaises(IOError, TogoWS._get_fields,
00030                           "http://togows.dbcls.jp/entry/invalid?fields")
00031 
00032     def test_databases(self):
00033         """Check supported databases"""
00034         dbs = set(TogoWS._get_entry_dbs())
00035         self.assert_(dbs.issuperset(['nuccore', 'nucest', 'nucgss',
00036                                      'nucleotide', 'protein', 'gene',
00037                                      'omim', 'homologene', 'snp',
00038                                      'mesh', 'pubmed', 'embl',
00039                                      'uniprot', 'uniparc', 'uniref100',
00040                                      'uniref90', 'uniref50', 'ddbj',
00041                                      'dad', 'pdb', 'compound', 'drug',
00042                                      'enzyme', 'genes', 'glycan',
00043                                      'orthology', 'reaction', 'module',
00044                                      'pathway']), dbs)
00045 
00046     def test_pubmed(self):
00047         """Check supported fields for pubmed database"""
00048         fields = set(TogoWS._get_entry_fields("pubmed"))
00049         self.assert_(fields.issuperset(['abstract', 'au', 'authors',
00050                                         'doi', 'mesh', 'so', 'ti',
00051                                         'title']), fields)
00052 
00053     def test_ncbi_protein(self):
00054         """Check supported fields for NCBI protein database"""
00055         fields = set(TogoWS._get_entry_fields("ncbi-protein"))
00056         self.assert_(fields.issuperset(['entry_id', 'length', 'strand',
00057                                         'moltype', 'linearity', 'division',
00058                                         'date', 'definition', 'accession',
00059                                         'accessions', 'version', 'versions',
00060                                         'acc_version', 'gi', 'keywords',
00061                                         'organism', 'common_name',
00062                                         'taxonomy', 'comment', 'seq']),
00063                                         fields)
00064 
00065     def test_ddbj(self):
00066         """Check supported fields for ddbj database"""
00067         fields = set(TogoWS._get_entry_fields("ddbj"))
00068         self.assert_(fields.issuperset(['entry_id', 'length', 'strand',
00069                                         'moltype', 'linearity', 'division',
00070                                         'date', 'definition', 'accession',
00071                                         'accessions', 'version', 'versions',
00072                                         'acc_version', 'gi', 'keywords',
00073                                         'organism', 'common_name',
00074                                         'taxonomy', 'comment', 'seq']),
00075                                         fields)
00076 
00077     def test_embl(self):
00078         """Check supported fields for embl database"""
00079         fields = set(TogoWS._get_entry_fields("embl"))
00080         self.assert_(fields.issuperset(["definition", "entry_id", "seq"]),
00081                      fields)
00082 
00083     def test_uniprot(self):
00084         """Check supported fields for uniprot database"""
00085         fields = set(TogoWS._get_entry_fields("uniprot"))
00086         self.assert_(fields.issuperset(["definition", "entry_id", "seq"]),
00087                      fields)
00088 
00089     def test_pdb(self):
00090         """Check supported fields for pdb database"""
00091         fields = set(TogoWS._get_entry_fields("pdb"))
00092         self.assert_(fields.issuperset(["accession", "chains", "keywords",
00093                                         "models"]), fields)
00094 
00095 
00096 class TogoEntry(unittest.TestCase):
00097     def test_pubmed_16381885(self):
00098         """Bio.TogoWS.entry("pubmed", "16381885")"""
00099         #Gives Medline plain text
00100         handle = TogoWS.entry("pubmed", "16381885")
00101         data = Medline.read(handle)
00102         handle.close()
00103         self.assertEqual(data["TI"],
00104              'From genomics to chemical genomics: new developments in KEGG.')
00105         self.assertEqual(data["AU"], ['Kanehisa M', 'Goto S', 'Hattori M',
00106                                       'Aoki-Kinoshita KF', 'Itoh M',
00107                                       'Kawashima S', 'Katayama T', 'Araki M',
00108                                       'Hirakawa M'])
00109 
00110     def test_pubmed_16381885_ti(self):
00111         """Bio.TogoWS.entry("pubmed", "16381885", field="ti")"""
00112         handle = TogoWS.entry("pubmed", "16381885", field="ti")
00113         data = handle.read().strip()
00114         handle.close()
00115         self.assertEqual(data,
00116              'From genomics to chemical genomics: new developments in KEGG.')
00117     
00118     def test_pubmed_16381885_title(self):
00119         """Bio.TogoWS.entry("pubmed", "16381885", field="title")"""
00120         handle = TogoWS.entry("pubmed", "16381885", field="title")
00121         data = handle.read().strip()
00122         handle.close()
00123         self.assertEqual(data,
00124              'From genomics to chemical genomics: new developments in KEGG.')
00125     
00126     def test_pubmed_16381885_au(self):
00127         """Bio.TogoWS.entry("pubmed", "16381885", field="au")"""
00128         #Gives one name per line (i.e. \n separated), no dots
00129         handle = TogoWS.entry("pubmed", "16381885", field="au")
00130         data = handle.read().strip().split("\n")
00131         handle.close()
00132         self.assertEqual(data, ['Kanehisa M', 'Goto S', 'Hattori M',
00133                                 'Aoki-Kinoshita KF', 'Itoh M',
00134                                 'Kawashima S', 'Katayama T', 'Araki M',
00135                                 'Hirakawa M'])
00136 
00137     def test_pubmed_16381885_authors(self):
00138         """Bio.TogoWS.entry("pubmed", "16381885", field="authors")"""
00139         #Gives names tab separated (i.e. \t separated)
00140         handle = TogoWS.entry("pubmed", "16381885", field="authors")
00141         data = handle.read().strip().split("\t")
00142         handle.close()
00143         self.assertEqual(data, ['Kanehisa, M.', 'Goto, S.', 'Hattori, M.',
00144                                 'Aoki-Kinoshita, K. F.', 'Itoh, M.',
00145                                 'Kawashima, S.', 'Katayama, T.', 'Araki, M.',
00146                                 'Hirakawa, M.'])
00147 
00148     def test_pubmed_16381885_invalid_field(self):
00149         """Bio.TogoWS.entry("pubmed", "16381885", field="invalid_for_testing")"""
00150         self.assertRaises(ValueError, TogoWS.entry,
00151                           "pubmed", "16381885", field="invalid_for_testing")
00152 
00153     def test_pubmed_16381885_invalid_format(self):
00154         """Bio.TogoWS.entry("pubmed", "16381885", format="invalid_for_testing")"""
00155         self.assertRaises(ValueError, TogoWS.entry,
00156                           "pubmed", "16381885", format="invalid_for_testing")
00157 
00158     def test_pubmed_invalid_id(self):
00159         """Bio.TogoWS.entry("pubmed", "invalid_for_testing")"""
00160         self.assertRaises(IOError, TogoWS.entry,
00161                           "pubmed", "invalid_for_testing")
00162 
00163     def test_pubmed_16381885_and_19850725(self):
00164         """Bio.TogoWS.entry("pubmed", "16381885,19850725")"""
00165         handle = TogoWS.entry("pubmed", "16381885,19850725")
00166         records = list(Medline.parse(handle))
00167         handle.close()
00168         self.assertEqual(len(records), 2)
00169         self.assertEqual(records[0]["TI"],
00170              'From genomics to chemical genomics: new developments in KEGG.')
00171         self.assertEqual(records[0]["AU"], ['Kanehisa M', 'Goto S',
00172                                             'Hattori M', 'Aoki-Kinoshita KF',
00173                                             'Itoh M', 'Kawashima S',
00174                                             'Katayama T', 'Araki M',
00175                                             'Hirakawa M'])
00176         self.assertEqual(records[1]["TI"],
00177              'DDBJ launches a new archive database with analytical tools ' + \
00178              'for next-generation sequence data.')
00179         self.assertEqual(records[1]["AU"], ['Kaminuma E', 'Mashima J',
00180                                             'Kodama Y', 'Gojobori T',
00181                                             'Ogasawara O', 'Okubo K',
00182                                             'Takagi T', 'Nakamura Y'])
00183 
00184     def test_pubmed_16381885_and_19850725_authors(self):
00185         """Bio.TogoWS.entry("pubmed", "16381885,19850725", field="authors")"""
00186         handle = TogoWS.entry("pubmed", "16381885,19850725", field="authors")
00187         #Little hack to remove blank lines...
00188         #names = handle.read().replace("\n\n", "\n").strip().split("\n")
00189         names = handle.read().strip().split("\n")
00190         handle.close()
00191         self.assertEqual(2, len(names))
00192         names1, names2 = names
00193         self.assertEqual(names1.split("\t"),
00194                          ['Kanehisa, M.', 'Goto, S.', 'Hattori, M.',
00195                           'Aoki-Kinoshita, K. F.', 'Itoh, M.',
00196                           'Kawashima, S.', 'Katayama, T.',
00197                           'Araki, M.', 'Hirakawa, M.'])
00198         self.assertEqual(names2.split("\t"),
00199                          ['Kaminuma, E.', 'Mashima, J.', 'Kodama, Y.',
00200                           'Gojobori, T.', 'Ogasawara, O.', 'Okubo, K.',
00201                           'Takagi, T.', 'Nakamura, Y.'])
00202 
00203     def test_invalid_db(self):
00204         """Bio.TogoWS.entry("invalid_db", "invalid_id")"""
00205         self.assertRaises(ValueError, TogoWS.entry,
00206                           "invalid_db", "invalid_id")
00207 
00208     def test_nucleotide_genbank(self):
00209         """Bio.TogoWS.entry("nucleotide", "X52960")"""
00210         handle = TogoWS.entry("nucleotide", "X52960") #Returns "genbank" format
00211         record  = SeqIO.read(handle, "gb")
00212         handle.close()
00213         self.assertEqual(record.id, "X52960.1")
00214         self.assertEqual(record.name, "X52960")
00215         self.assertEqual(len(record), 248)
00216         self.assertEqual(seguid(record.seq), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")
00217 
00218     def test_nucleotide_genbank_length(self):
00219         """Bio.TogoWS.entry("nucleotide", "X52960", field="length")"""
00220         handle = TogoWS.entry("nucleotide", "X52960", field="length")
00221         data = handle.read().strip() #ignore trailing \n
00222         handle.close()
00223         self.assertEqual(data, "248")
00224 
00225     def test_nucleotide_genbank_seq(self):
00226         """Bio.TogoWS.entry("nucleotide", "X52960", field="seq")"""
00227         handle = TogoWS.entry("nucleotide", "X52960", field="seq")
00228         data = handle.read().strip() #ignore trailing \n
00229         handle.close()
00230         self.assertEqual(seguid(data), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")
00231 
00232     def test_nucleotide_genbank_definition(self):
00233         """Bio.TogoWS.entry("nucleotide", "X52960", field="definition")"""
00234         handle = TogoWS.entry("nucleotide", "X52960", field="definition")
00235         data = handle.read().strip() #ignore trailing \n
00236         handle.close()
00237         self.assertEqual(data, "Coleus blumei viroid 1 (CbVd) RNA.")
00238 
00239     def test_nucleotide_genbank_accession(self):
00240         """Bio.TogoWS.entry("nucleotide", "X52960", field="accession")"""
00241         handle = TogoWS.entry("nucleotide", "X52960", field="accession")
00242         data = handle.read().strip() #ignore trailing \n
00243         handle.close()
00244         self.assertEqual(data, "X52960")
00245 
00246     def test_nucleotide_genbank_accession(self):
00247         """Bio.TogoWS.entry("nucleotide", "X52960", field="version")"""
00248         handle = TogoWS.entry("nucleotide", "X52960", field="version")
00249         data = handle.read().strip() #ignore trailing \n
00250         handle.close()
00251         self.assertEqual(data, "1")
00252 
00253     def test_nucleotide_genbank_acc_version(self):
00254         """Bio.TogoWS.entry("nucleotide", "X52960", field="acc_version")"""
00255         handle = TogoWS.entry("nucleotide", "X52960", field="acc_version")
00256         data = handle.read().strip() #ignore trailing \n
00257         handle.close()
00258         self.assertEqual(data, "X52960.1")
00259 
00260     def test_nucleotide_genbank_organism(self):
00261         """Bio.TogoWS.entry("nucleotide", "X52960", field="organism")"""
00262         handle = TogoWS.entry("nucleotide", "X52960", field="organism")
00263         data = handle.read().strip() #ignore trailing \n
00264         handle.close()
00265         self.assertEqual(data, "Coleus blumei viroid 1")
00266         
00267     def test_ddbj_genbank_invalid_field(self):
00268         """Bio.TogoWS.entry("nucleotide", "X52960", field="invalid_for_testing")"""
00269         self.assertRaises(ValueError, TogoWS.entry,
00270                           "nucleotide", "X52960", field="invalid_for_testing")
00271 
00272     def test_nucleotide_invalid_format(self):
00273         """Bio.TogoWS.entry("nucleotide", "X52960", format="invalid_for_testing")"""
00274         self.assertRaises(ValueError, TogoWS.entry,
00275                           "nucleotide", "X52960", format="invalid_for_testing")
00276 
00277     #def test_ddbj_gff3(self):
00278     #    """Bio.TogoWS.entry("ddbj", "X52960", format="gff")"""
00279     #    handle = TogoWS.entry("ddbj", "X52960", format="gff")
00280     #    data = handle.read()
00281     #    handle.close()
00282     #    self.assert_(data.startswith("##gff-version 3\nX52960\tDDBJ\t"), data)
00283 
00284     def test_genbank_gff3(self):
00285         """Bio.TogoWS.entry("nucleotide", "X52960", format="gff")"""
00286         #Note - Using manual URL with genbank instead of nucleotide works
00287         handle = TogoWS.entry("nucleotide", "X52960", format="gff")
00288         data = handle.read()
00289         handle.close()
00290         self.assert_(data.startswith("##gff-version 3\nX52960\tGenbank\t"), data)
00291 
00292     def test_embl_AM905444_gff3(self):
00293         """Bio.TogoWS.entry("embl", "AM905444", format="gff")"""
00294         handle = TogoWS.entry("embl", "AM905444", format="gff")
00295         data = handle.read()
00296         handle.close()
00297         self.assert_(data.startswith("##gff-version 3\nAM905444\tembl\t"), data)
00298 
00299     def test_embl_AM905444_seq(self):
00300         """Bio.TogoWS.entry("embl", "AM905444", field="seq")"""
00301         handle = TogoWS.entry("embl", "AM905444", field="seq")
00302         data = handle.read().strip() #ignore any trailing \n
00303         handle.close()
00304         self.assertEqual(seguid(data), "G0HtLpwF7i4FXUaUjDUPTjok79c")
00305 
00306     def test_embl_AM905444_definition(self):
00307         """Bio.TogoWS.entry("embl", "AM905444", field="definition")"""
00308         handle = TogoWS.entry("embl", "AM905444", field="definition")
00309         data = handle.read().strip() #ignore any trailing \n
00310         handle.close()
00311         self.assertEqual(data, "Herbaspirillum seropedicae locus tag HS193.0074 for porin")
00312 
00313     def test_embl_AM905444(self):
00314         """Bio.TogoWS.entry("embl", "AM905444")"""
00315         handle = TogoWS.entry("embl", "AM905444")
00316         record = SeqIO.read(handle, "embl")
00317         handle.close()
00318         self.assert_("AM905444" in record.id, record.id)
00319         self.assert_("AM905444" in record.name, record.name)
00320         self.assert_("porin" in record.description, record.description)
00321         self.assertEqual(len(record), 1164)
00322         self.assertEqual(seguid(record.seq), "G0HtLpwF7i4FXUaUjDUPTjok79c")
00323 
00324     def test_nucleotide_fasta(self):
00325         """Bio.TogoWS.entry("nucleotide", "X52960", "fasta")"""
00326         handle = TogoWS.entry("nucleotide", "X52960", "fasta")
00327         record = SeqIO.read(handle, "fasta")
00328         handle.close()
00329         self.assert_("X52960" in record.id, record.id)
00330         self.assert_("X52960" in record.name, record.name)
00331         self.assertEqual(len(record), 248)
00332         self.assertEqual(seguid(record.seq), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")
00333 
00334     def test_uniprot_swiss(self):
00335         """Bio.TogoWS.entry("uniprot", ["A1AG1_HUMAN","A1AG1_MOUSE"])"""
00336         #Returns "swiss" format:
00337         handle = TogoWS.entry("uniprot", ["A1AG1_HUMAN","A1AG1_MOUSE"])
00338         record1, record2  = SeqIO.parse(handle, "swiss")
00339         handle.close()
00340 
00341         self.assertEqual(record1.id, "P02763")
00342         self.assertEqual(record1.name, "A1AG1_HUMAN")
00343         self.assertEqual(len(record1), 201)
00344         self.assertEqual(seguid(record1.seq), "LHDJJ6oC7gUXo8CC7Xn6EUeA8Gk")
00345 
00346         self.assertEqual(record2.id, "Q60590")
00347         self.assertEqual(record2.name, "A1AG1_MOUSE")
00348         self.assertEqual(len(record2), 207)
00349         self.assertEqual(seguid(record2.seq), "FGcj+RFQhP2gRusCmwPFty5PJT0")
00350 
00351     def test_nucleotide_fasta(self):
00352         """Bio.TogoWS.entry("nucleotide", "6273291", "fasta")"""
00353         handle = TogoWS.entry("nucleotide", "6273291", "fasta")
00354         record  = SeqIO.read(handle, "fasta")
00355         handle.close()
00356         self.assert_("6273291" in record.id, record.id)
00357         self.assert_("6273291" in record.name, record.name)
00358         self.assertEqual(len(record), 902)
00359         self.assertEqual(seguid(record.seq), "bLhlq4mEFJOoS9PieOx4nhGnjAQ")
00360 
00361     def test_protein_fasta(self):
00362         """Bio.TogoWS.entry("protein", "16130152", "fasta")"""
00363         handle = TogoWS.entry("protein", "16130152", "fasta")
00364         record  = SeqIO.read(handle, "fasta")
00365         handle.close()
00366         #Could use assertIn but requires Python 2.7+
00367         self.assert_("16130152" in record.id, record.id)
00368         self.assert_("16130152" in record.name, record.name)
00369         self.assert_("porin protein" in record.description, record.description)
00370         self.assertEqual(len(record), 367)
00371         self.assertEqual(seguid(record.seq), "fCjcjMFeGIrilHAn6h+yju267lg")
00372 
00373 class TogoSearch(unittest.TestCase):
00374     """Search tests."""
00375 
00376     def test_bad_args_just_limit(self):
00377         """Reject Bio.TogoWS.search(...) with just limit"""
00378         self.assertRaises(ValueError, TogoWS.search,
00379                           "pubmed", "lung+cancer", limit=10)
00380 
00381     def test_bad_args_just_offset(self):
00382         """Reject Bio.TogoWS.search(...) with just offset"""
00383         self.assertRaises(ValueError, TogoWS.search,
00384                           "pubmed", "lung+cancer", offset=10)
00385 
00386     def test_bad_args_zero_limit(self):
00387         """Reject Bio.TogoWS.search(...) with zero limit"""
00388         self.assertRaises(ValueError, TogoWS.search,
00389                           "pubmed", "lung+cancer", offset=1, limit=0)
00390 
00391     def test_bad_args_zero_offset(self):
00392         """Reject Bio.TogoWS.search(...) with zero offset"""
00393         self.assertRaises(ValueError, TogoWS.search,
00394                           "pubmed", "lung+cancer", offset=0, limit=10)
00395 
00396     def test_bad_args_non_int_offset(self):
00397         """Reject Bio.TogoWS.search(...) with non-integer offset"""
00398         self.assertRaises(ValueError, TogoWS.search,
00399                           "pubmed", "lung+cancer", offset="test", limit=10)
00400 
00401     def test_bad_args_non_int_limit(self):
00402         """Reject Bio.TogoWS.search(...) with non-integer limit"""
00403         self.assertRaises(ValueError, TogoWS.search,
00404                           "pubmed", "lung+cancer", offset=1, limit="lots")
00405 
00406     def test_pubmed_search_togows(self):
00407         """Bio.TogoWS.search_iter("pubmed", "TogoWS") etc"""
00408         self.check("pubmed", "TogoWS", ["20472643"])
00409 
00410     def test_pubmed_search_bioruby(self):
00411         """Bio.TogoWS.search_iter("pubmed", "BioRuby") etc"""
00412         self.check("pubmed", "BioRuby", ["20739307", "20015970", "14693808"])
00413 
00414     def test_pubmed_search_porin(self):
00415         """Bio.TogoWS.search_iter("pubmed", "human porin") etc
00416 
00417         Count was 339 at time of writing, this was choosen to
00418         be larger than the default chunk size for iteration,
00419         but still not too big to download the full list.
00420         """
00421         self.check("pubmed", "human porin", ["21189321", "21835183"])
00422 
00423     def test_pdb_search_porin(self):
00424         """Bio.TogoWS.search_iter("pdb", "porin") etc
00425 
00426         Count was about 130 at time of writing.
00427         """
00428         self.check("pdb", "porin", ["2j1n", "2vqg", "3m8b", "2k0l"])
00429 
00430     def test_embl_search_porin(self):
00431         """Bio.TogoWS.search_iter("embl", "human pore", limit=200) etc
00432 
00433         Count was about 255 at time of writing.
00434         """
00435         self.check("embl", "human pore", limit=200)
00436 
00437     def test_uniprot_search_lung_cancer(self):
00438         """Bio.TogoWS.search_iter("uniprot", "lung+cancer", limit=150) etc
00439 
00440         Search count was 1327 at time of writing, a bit large to
00441         download all the results in a unit test. Want to use a limit
00442         larger than the batch size (100) to ensure at least two
00443         batches.
00444         """
00445         self.check("uniprot", "lung+cancer", limit=150)
00446 
00447     def check(self, database, search_term, expected_matches=[], limit=None):
00448         if expected_matches and limit:
00449             raise ValueError("Bad test - TogoWS makes no promises about order")
00450         search_count = TogoWS.search_count(database, search_term)
00451         if expected_matches and search_count < len(expected_matches):
00452             raise ValueError("Only %i matches, expected at least %i" \
00453                              % (search_count, len(expected_matches)))
00454         if search_count > 5000 and not limit:
00455             print "%i results, skipping" % search_count
00456             return
00457         if limit:
00458             count = min(search_count, limit)
00459         else:
00460             count = search_count
00461 
00462         #Iteration should find everything... unless a limit is used
00463         search_iter = list(TogoWS.search_iter(database, search_term, limit))
00464         self.assertEqual(count, len(search_iter))
00465         for match in expected_matches:
00466             self.assert_(match in search_iter,
00467                          "Expected %s in results but not" % match)
00468 
00469 
00470 class TogoConvert(unittest.TestCase):
00471     """Conversion tests."""
00472 
00473     def test_invalid_format(self):
00474         """Check convert file format checking."""
00475         self.assertRaises(ValueError, TogoWS.convert,
00476                           StringIO("PLACEHOLDER"),
00477                           "genbank", "invalid_for_testing")
00478         self.assertRaises(ValueError, TogoWS.convert,
00479                           StringIO("PLACEHOLDER"),
00480                           "invalid_for_testing", "fasta")
00481 
00482     def test_genbank_to_fasta(self):
00483         """Conversion of GenBank to FASTA."""
00484         filename = "GenBank/NC_005816.gb"
00485         old = SeqIO.read(filename, "gb")
00486         new = SeqIO.read(TogoWS.convert(open(filename), "genbank", "fasta"), "fasta")
00487         self.assertEqual(str(old.seq), str(new.seq))
00488 
00489     def test_genbank_to_embl(self):
00490         """Conversion of GenBank to EMBL."""
00491         filename = "GenBank/NC_005816.gb"
00492         old = SeqIO.read(filename, "gb")
00493         new = SeqIO.read(TogoWS.convert(open(filename), "genbank", "embl"), "embl")
00494         self.assertEqual(str(old.seq), str(new.seq))
00495 
00496 if __name__ == "__main__":
00497     runner = unittest.TextTestRunner(verbosity = 2)
00498     unittest.main(testRunner=runner)
00499 
00500