Back to index

python-biopython  1.60
Public Member Functions
test_TogoWS.TogoEntry Class Reference

List of all members.

Public Member Functions

def test_pubmed_16381885
def test_pubmed_16381885_ti
def test_pubmed_16381885_title
def test_pubmed_16381885_au
def test_pubmed_16381885_authors
def test_pubmed_16381885_invalid_field
def test_pubmed_16381885_invalid_format
def test_pubmed_invalid_id
def test_pubmed_16381885_and_19850725
def test_pubmed_16381885_and_19850725_authors
def test_invalid_db
def test_nucleotide_genbank
def test_nucleotide_genbank_length
def test_nucleotide_genbank_seq
def test_nucleotide_genbank_definition
def test_nucleotide_genbank_accession
def test_nucleotide_genbank_accession
def test_nucleotide_genbank_acc_version
def test_nucleotide_genbank_organism
def test_ddbj_genbank_invalid_field
def test_nucleotide_invalid_format
def test_genbank_gff3
def test_embl_AM905444_gff3
def test_embl_AM905444_seq
def test_embl_AM905444_definition
def test_embl_AM905444
def test_nucleotide_fasta
def test_uniprot_swiss
def test_nucleotide_fasta
def test_protein_fasta

Detailed Description

Definition at line 96 of file test_TogoWS.py.


Member Function Documentation

Bio.TogoWS.entry("nucleotide", "X52960", field="invalid_for_testing")

Definition at line 267 of file test_TogoWS.py.

00267 
00268     def test_ddbj_genbank_invalid_field(self):
00269         """Bio.TogoWS.entry("nucleotide", "X52960", field="invalid_for_testing")"""
00270         self.assertRaises(ValueError, TogoWS.entry,
00271                           "nucleotide", "X52960", field="invalid_for_testing")

Bio.TogoWS.entry("embl", "AM905444")

Definition at line 313 of file test_TogoWS.py.

00313 
00314     def test_embl_AM905444(self):
00315         """Bio.TogoWS.entry("embl", "AM905444")"""
00316         handle = TogoWS.entry("embl", "AM905444")
00317         record = SeqIO.read(handle, "embl")
00318         handle.close()
00319         self.assert_("AM905444" in record.id, record.id)
00320         self.assert_("AM905444" in record.name, record.name)
00321         self.assert_("porin" in record.description, record.description)
00322         self.assertEqual(len(record), 1164)
00323         self.assertEqual(seguid(record.seq), "G0HtLpwF7i4FXUaUjDUPTjok79c")

Here is the call graph for this function:

Bio.TogoWS.entry("embl", "AM905444", field="definition")

Definition at line 306 of file test_TogoWS.py.

00306 
00307     def test_embl_AM905444_definition(self):
00308         """Bio.TogoWS.entry("embl", "AM905444", field="definition")"""
00309         handle = TogoWS.entry("embl", "AM905444", field="definition")
00310         data = handle.read().strip() #ignore any trailing \n
00311         handle.close()
00312         self.assertEqual(data, "Herbaspirillum seropedicae locus tag HS193.0074 for porin")

Bio.TogoWS.entry("embl", "AM905444", format="gff")

Definition at line 292 of file test_TogoWS.py.

00292 
00293     def test_embl_AM905444_gff3(self):
00294         """Bio.TogoWS.entry("embl", "AM905444", format="gff")"""
00295         handle = TogoWS.entry("embl", "AM905444", format="gff")
00296         data = handle.read()
00297         handle.close()
00298         self.assert_(data.startswith("##gff-version 3\nAM905444\tembl\t"), data)

Bio.TogoWS.entry("embl", "AM905444", field="seq")

Definition at line 299 of file test_TogoWS.py.

00299 
00300     def test_embl_AM905444_seq(self):
00301         """Bio.TogoWS.entry("embl", "AM905444", field="seq")"""
00302         handle = TogoWS.entry("embl", "AM905444", field="seq")
00303         data = handle.read().strip() #ignore any trailing \n
00304         handle.close()
00305         self.assertEqual(seguid(data), "G0HtLpwF7i4FXUaUjDUPTjok79c")

Here is the call graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960", format="gff")

Definition at line 284 of file test_TogoWS.py.

00284 
00285     def test_genbank_gff3(self):
00286         """Bio.TogoWS.entry("nucleotide", "X52960", format="gff")"""
00287         #Note - Using manual URL with genbank instead of nucleotide works
00288         handle = TogoWS.entry("nucleotide", "X52960", format="gff")
00289         data = handle.read()
00290         handle.close()
00291         self.assert_(data.startswith("##gff-version 3\nX52960\tGenbank\t"), data)

Bio.TogoWS.entry("invalid_db", "invalid_id")

Definition at line 203 of file test_TogoWS.py.

00203 
00204     def test_invalid_db(self):
00205         """Bio.TogoWS.entry("invalid_db", "invalid_id")"""
00206         self.assertRaises(ValueError, TogoWS.entry,
00207                           "invalid_db", "invalid_id")

Bio.TogoWS.entry("nucleotide", "X52960", "fasta")

Definition at line 324 of file test_TogoWS.py.

00324 
00325     def test_nucleotide_fasta(self):
00326         """Bio.TogoWS.entry("nucleotide", "X52960", "fasta")"""
00327         handle = TogoWS.entry("nucleotide", "X52960", "fasta")
00328         record = SeqIO.read(handle, "fasta")
00329         handle.close()
00330         self.assert_("X52960" in record.id, record.id)
00331         self.assert_("X52960" in record.name, record.name)
00332         self.assertEqual(len(record), 248)
00333         self.assertEqual(seguid(record.seq), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")

Here is the call graph for this function:

Here is the caller graph for this function:

Bio.TogoWS.entry("nucleotide", "6273291", "fasta")

Definition at line 351 of file test_TogoWS.py.

00351 
00352     def test_nucleotide_fasta(self):
00353         """Bio.TogoWS.entry("nucleotide", "6273291", "fasta")"""
00354         handle = TogoWS.entry("nucleotide", "6273291", "fasta")
00355         record  = SeqIO.read(handle, "fasta")
00356         handle.close()
00357         self.assert_("6273291" in record.id, record.id)
00358         self.assert_("6273291" in record.name, record.name)
00359         self.assertEqual(len(record), 902)
00360         self.assertEqual(seguid(record.seq), "bLhlq4mEFJOoS9PieOx4nhGnjAQ")

Here is the call graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960")

Definition at line 208 of file test_TogoWS.py.

00208 
00209     def test_nucleotide_genbank(self):
00210         """Bio.TogoWS.entry("nucleotide", "X52960")"""
00211         handle = TogoWS.entry("nucleotide", "X52960") #Returns "genbank" format
00212         record  = SeqIO.read(handle, "gb")
00213         handle.close()
00214         self.assertEqual(record.id, "X52960.1")
00215         self.assertEqual(record.name, "X52960")
00216         self.assertEqual(len(record), 248)
00217         self.assertEqual(seguid(record.seq), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")

Here is the call graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960", field="acc_version")

Definition at line 253 of file test_TogoWS.py.

00253 
00254     def test_nucleotide_genbank_acc_version(self):
00255         """Bio.TogoWS.entry("nucleotide", "X52960", field="acc_version")"""
00256         handle = TogoWS.entry("nucleotide", "X52960", field="acc_version")
00257         data = handle.read().strip() #ignore trailing \n
00258         handle.close()
00259         self.assertEqual(data, "X52960.1")

Bio.TogoWS.entry("nucleotide", "X52960", field="accession")

Definition at line 239 of file test_TogoWS.py.

00239 
00240     def test_nucleotide_genbank_accession(self):
00241         """Bio.TogoWS.entry("nucleotide", "X52960", field="accession")"""
00242         handle = TogoWS.entry("nucleotide", "X52960", field="accession")
00243         data = handle.read().strip() #ignore trailing \n
00244         handle.close()
00245         self.assertEqual(data, "X52960")

Here is the caller graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960", field="version")

Definition at line 246 of file test_TogoWS.py.

00246 
00247     def test_nucleotide_genbank_accession(self):
00248         """Bio.TogoWS.entry("nucleotide", "X52960", field="version")"""
00249         handle = TogoWS.entry("nucleotide", "X52960", field="version")
00250         data = handle.read().strip() #ignore trailing \n
00251         handle.close()
00252         self.assertEqual(data, "1")

Here is the call graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960", field="definition")

Definition at line 232 of file test_TogoWS.py.

00232 
00233     def test_nucleotide_genbank_definition(self):
00234         """Bio.TogoWS.entry("nucleotide", "X52960", field="definition")"""
00235         handle = TogoWS.entry("nucleotide", "X52960", field="definition")
00236         data = handle.read().strip() #ignore trailing \n
00237         handle.close()
00238         self.assertEqual(data, "Coleus blumei viroid 1 (CbVd) RNA.")

Bio.TogoWS.entry("nucleotide", "X52960", field="length")

Definition at line 218 of file test_TogoWS.py.

00218 
00219     def test_nucleotide_genbank_length(self):
00220         """Bio.TogoWS.entry("nucleotide", "X52960", field="length")"""
00221         handle = TogoWS.entry("nucleotide", "X52960", field="length")
00222         data = handle.read().strip() #ignore trailing \n
00223         handle.close()
00224         self.assertEqual(data, "248")

Bio.TogoWS.entry("nucleotide", "X52960", field="organism")

Definition at line 260 of file test_TogoWS.py.

00260 
00261     def test_nucleotide_genbank_organism(self):
00262         """Bio.TogoWS.entry("nucleotide", "X52960", field="organism")"""
00263         handle = TogoWS.entry("nucleotide", "X52960", field="organism")
00264         data = handle.read().strip() #ignore trailing \n
00265         handle.close()
00266         self.assertEqual(data, "Coleus blumei viroid 1")
        
Bio.TogoWS.entry("nucleotide", "X52960", field="seq")

Definition at line 225 of file test_TogoWS.py.

00225 
00226     def test_nucleotide_genbank_seq(self):
00227         """Bio.TogoWS.entry("nucleotide", "X52960", field="seq")"""
00228         handle = TogoWS.entry("nucleotide", "X52960", field="seq")
00229         data = handle.read().strip() #ignore trailing \n
00230         handle.close()
00231         self.assertEqual(seguid(data), "Ktxz0HgMlhQmrKTuZpOxPZJ6zGU")

Here is the call graph for this function:

Bio.TogoWS.entry("nucleotide", "X52960", format="invalid_for_testing")

Definition at line 272 of file test_TogoWS.py.

00272 
00273     def test_nucleotide_invalid_format(self):
00274         """Bio.TogoWS.entry("nucleotide", "X52960", format="invalid_for_testing")"""
00275         self.assertRaises(ValueError, TogoWS.entry,
00276                           "nucleotide", "X52960", format="invalid_for_testing")

Bio.TogoWS.entry("protein", "16130152", "fasta")

Definition at line 361 of file test_TogoWS.py.

00361 
00362     def test_protein_fasta(self):
00363         """Bio.TogoWS.entry("protein", "16130152", "fasta")"""
00364         handle = TogoWS.entry("protein", "16130152", "fasta")
00365         record  = SeqIO.read(handle, "fasta")
00366         handle.close()
00367         #Could use assertIn but requires Python 2.7+
00368         self.assert_("16130152" in record.id, record.id)
00369         self.assert_("16130152" in record.name, record.name)
00370         self.assert_("porin protein" in record.description, record.description)
00371         self.assertEqual(len(record), 367)
00372         self.assertEqual(seguid(record.seq), "fCjcjMFeGIrilHAn6h+yju267lg")

Here is the call graph for this function:

Bio.TogoWS.entry("pubmed", "16381885")

Definition at line 97 of file test_TogoWS.py.

00097 
00098     def test_pubmed_16381885(self):
00099         """Bio.TogoWS.entry("pubmed", "16381885")"""
00100         #Gives Medline plain text
00101         handle = TogoWS.entry("pubmed", "16381885")
00102         data = Medline.read(handle)
00103         handle.close()
00104         self.assertEqual(data["TI"],
00105              'From genomics to chemical genomics: new developments in KEGG.')
00106         self.assertEqual(data["AU"], ['Kanehisa M', 'Goto S', 'Hattori M',
00107                                       'Aoki-Kinoshita KF', 'Itoh M',
00108                                       'Kawashima S', 'Katayama T', 'Araki M',
00109                                       'Hirakawa M'])

Bio.TogoWS.entry("pubmed", "16381885,19850725")

Definition at line 163 of file test_TogoWS.py.

00163 
00164     def test_pubmed_16381885_and_19850725(self):
00165         """Bio.TogoWS.entry("pubmed", "16381885,19850725")"""
00166         handle = TogoWS.entry("pubmed", "16381885,19850725")
00167         records = list(Medline.parse(handle))
00168         handle.close()
00169         self.assertEqual(len(records), 2)
00170         self.assertEqual(records[0]["TI"],
00171              'From genomics to chemical genomics: new developments in KEGG.')
00172         self.assertEqual(records[0]["AU"], ['Kanehisa M', 'Goto S',
00173                                             'Hattori M', 'Aoki-Kinoshita KF',
00174                                             'Itoh M', 'Kawashima S',
00175                                             'Katayama T', 'Araki M',
00176                                             'Hirakawa M'])
00177         self.assertEqual(records[1]["TI"],
00178              'DDBJ launches a new archive database with analytical tools ' + \
00179              'for next-generation sequence data.')
00180         self.assertEqual(records[1]["AU"], ['Kaminuma E', 'Mashima J',
00181                                             'Kodama Y', 'Gojobori T',
00182                                             'Ogasawara O', 'Okubo K',
00183                                             'Takagi T', 'Nakamura Y'])

Bio.TogoWS.entry("pubmed", "16381885,19850725", field="authors")

Definition at line 184 of file test_TogoWS.py.

00184 
00185     def test_pubmed_16381885_and_19850725_authors(self):
00186         """Bio.TogoWS.entry("pubmed", "16381885,19850725", field="authors")"""
00187         handle = TogoWS.entry("pubmed", "16381885,19850725", field="authors")
00188         #Little hack to remove blank lines...
00189         #names = handle.read().replace("\n\n", "\n").strip().split("\n")
00190         names = handle.read().strip().split("\n")
00191         handle.close()
00192         self.assertEqual(2, len(names))
00193         names1, names2 = names
00194         self.assertEqual(names1.split("\t"),
00195                          ['Kanehisa, M.', 'Goto, S.', 'Hattori, M.',
00196                           'Aoki-Kinoshita, K. F.', 'Itoh, M.',
00197                           'Kawashima, S.', 'Katayama, T.',
00198                           'Araki, M.', 'Hirakawa, M.'])
00199         self.assertEqual(names2.split("\t"),
00200                          ['Kaminuma, E.', 'Mashima, J.', 'Kodama, Y.',
00201                           'Gojobori, T.', 'Ogasawara, O.', 'Okubo, K.',
00202                           'Takagi, T.', 'Nakamura, Y.'])

Bio.TogoWS.entry("pubmed", "16381885", field="au")

Definition at line 126 of file test_TogoWS.py.

00126 
00127     def test_pubmed_16381885_au(self):
00128         """Bio.TogoWS.entry("pubmed", "16381885", field="au")"""
00129         #Gives one name per line (i.e. \n separated), no dots
00130         handle = TogoWS.entry("pubmed", "16381885", field="au")
00131         data = handle.read().strip().split("\n")
00132         handle.close()
00133         self.assertEqual(data, ['Kanehisa M', 'Goto S', 'Hattori M',
00134                                 'Aoki-Kinoshita KF', 'Itoh M',
00135                                 'Kawashima S', 'Katayama T', 'Araki M',
00136                                 'Hirakawa M'])

Bio.TogoWS.entry("pubmed", "16381885", field="authors")

Definition at line 137 of file test_TogoWS.py.

00137 
00138     def test_pubmed_16381885_authors(self):
00139         """Bio.TogoWS.entry("pubmed", "16381885", field="authors")"""
00140         #Gives names tab separated (i.e. \t separated)
00141         handle = TogoWS.entry("pubmed", "16381885", field="authors")
00142         data = handle.read().strip().split("\t")
00143         handle.close()
00144         self.assertEqual(data, ['Kanehisa, M.', 'Goto, S.', 'Hattori, M.',
00145                                 'Aoki-Kinoshita, K. F.', 'Itoh, M.',
00146                                 'Kawashima, S.', 'Katayama, T.', 'Araki, M.',
00147                                 'Hirakawa, M.'])

Bio.TogoWS.entry("pubmed", "16381885", field="invalid_for_testing")

Definition at line 148 of file test_TogoWS.py.

00148 
00149     def test_pubmed_16381885_invalid_field(self):
00150         """Bio.TogoWS.entry("pubmed", "16381885", field="invalid_for_testing")"""
00151         self.assertRaises(ValueError, TogoWS.entry,
00152                           "pubmed", "16381885", field="invalid_for_testing")

Bio.TogoWS.entry("pubmed", "16381885", format="invalid_for_testing")

Definition at line 153 of file test_TogoWS.py.

00153 
00154     def test_pubmed_16381885_invalid_format(self):
00155         """Bio.TogoWS.entry("pubmed", "16381885", format="invalid_for_testing")"""
00156         self.assertRaises(ValueError, TogoWS.entry,
00157                           "pubmed", "16381885", format="invalid_for_testing")

Bio.TogoWS.entry("pubmed", "16381885", field="ti")

Definition at line 110 of file test_TogoWS.py.

00110 
00111     def test_pubmed_16381885_ti(self):
00112         """Bio.TogoWS.entry("pubmed", "16381885", field="ti")"""
00113         handle = TogoWS.entry("pubmed", "16381885", field="ti")
00114         data = handle.read().strip()
00115         handle.close()
00116         self.assertEqual(data,
00117              'From genomics to chemical genomics: new developments in KEGG.')
    
Bio.TogoWS.entry("pubmed", "16381885", field="title")

Definition at line 118 of file test_TogoWS.py.

00118 
00119     def test_pubmed_16381885_title(self):
00120         """Bio.TogoWS.entry("pubmed", "16381885", field="title")"""
00121         handle = TogoWS.entry("pubmed", "16381885", field="title")
00122         data = handle.read().strip()
00123         handle.close()
00124         self.assertEqual(data,
00125              'From genomics to chemical genomics: new developments in KEGG.')
    
Bio.TogoWS.entry("pubmed", "invalid_for_testing")

Definition at line 158 of file test_TogoWS.py.

00158 
00159     def test_pubmed_invalid_id(self):
00160         """Bio.TogoWS.entry("pubmed", "invalid_for_testing")"""
00161         self.assertRaises(IOError, TogoWS.entry,
00162                           "pubmed", "invalid_for_testing")

Bio.TogoWS.entry("uniprot", ["A1AG1_HUMAN","A1AG1_MOUSE"])

Definition at line 334 of file test_TogoWS.py.

00334 
00335     def test_uniprot_swiss(self):
00336         """Bio.TogoWS.entry("uniprot", ["A1AG1_HUMAN","A1AG1_MOUSE"])"""
00337         #Returns "swiss" format:
00338         handle = TogoWS.entry("uniprot", ["A1AG1_HUMAN","A1AG1_MOUSE"])
00339         record1, record2  = SeqIO.parse(handle, "swiss")
00340         handle.close()
00341 
00342         self.assertEqual(record1.id, "P02763")
00343         self.assertEqual(record1.name, "A1AG1_HUMAN")
00344         self.assertEqual(len(record1), 201)
00345         self.assertEqual(seguid(record1.seq), "LHDJJ6oC7gUXo8CC7Xn6EUeA8Gk")
00346 
00347         self.assertEqual(record2.id, "Q60590")
00348         self.assertEqual(record2.name, "A1AG1_MOUSE")
00349         self.assertEqual(len(record2), 207)
00350         self.assertEqual(seguid(record2.seq), "FGcj+RFQhP2gRusCmwPFty5PJT0")

Here is the call graph for this function:


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