Back to index

python-biopython  1.60
Public Member Functions
test_Entrez.EFetchTest Class Reference

List of all members.

Public Member Functions

def test_pubmed1
def test_pubmed2
def test_omim
def test_taxonomy
def test_nucleotide1
def test_nucleotide2
def test_nucleotide2
def test_genbank
def test_fasta
def test_pubmed_html
def test_xml_without_declaration

Detailed Description

Tests for parsing XML output returned by EFetch

Definition at line 3770 of file test_Entrez.py.


Member Function Documentation

Test error handling when presented with Fasta non-XML data

Definition at line 4738 of file test_Entrez.py.

04738 
04739     def test_fasta(self):
04740         '''Test error handling when presented with Fasta non-XML data
04741         '''
04742         from Bio.Entrez import Parser
04743         handle = open('Fasta/wisteria.nu', "rb")
04744         self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
04745         handle.close()
04746         handle = open('Fasta/wisteria.nu', "rb")
04747         iterator = Entrez.parse(handle)
04748         self.assertRaises(Parser.NotXMLError, iterator.next)
04749         handle.close()

Here is the call graph for this function:

Test error handling when presented with GenBank non-XML data

Definition at line 4722 of file test_Entrez.py.

04722 
04723     def test_genbank(self):
04724         '''Test error handling when presented with GenBank non-XML data
04725         '''
04726         # Access the nucleotide database using efetch, but return the data
04727         # in GenBank format.
04728         # To create the GenBank file, use
04729         # >>> Bio.Entrez.efetch(db='nucleotide', id='NT_019265', rettype='gb')
04730         from Bio.Entrez import Parser
04731         handle = open('GenBank/NT_019265.gb', "rb")
04732         self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
04733         handle.close()
04734         handle = open('GenBank/NT_019265.gb', "rb")
04735         iterator = Entrez.parse(handle)
04736         self.assertRaises(Parser.NotXMLError, iterator.next)
04737         handle.close()

Here is the call graph for this function:

Test parsing XML returned by EFetch, Nucleotide database (first test)

Definition at line 4478 of file test_Entrez.py.

04478 
04479     def test_nucleotide1(self):
04480         '''Test parsing XML returned by EFetch, Nucleotide database (first test)
04481         '''
04482         # Access the nucleotide database using efetch.
04483         # To create the XML file, use
04484         # >>> Bio.Entrez.efetch(db='nucleotide', id=5, retmode='xml')
04485         handle = open('Entrez/nucleotide1.xml', "rb")
04486         record = Entrez.read(handle)
04487         handle.close()
04488         self.assertEqual(record[0]["GBSeq_locus"], "X60065")
04489         self.assertEqual(record[0]["GBSeq_length"], "1136")
04490         self.assertEqual(record[0]["GBSeq_strandedness"], "single")
04491         self.assertEqual(record[0]["GBSeq_moltype"], "mRNA")
04492         self.assertEqual(record[0]["GBSeq_topology"], "linear")
04493         self.assertEqual(record[0]["GBSeq_division"], "MAM")
04494         self.assertEqual(record[0]["GBSeq_update-date"], "14-NOV-2006")
04495         self.assertEqual(record[0]["GBSeq_create-date"], "05-MAY-1992")
04496         self.assertEqual(record[0]["GBSeq_definition"], "B.bovis beta-2-gpI mRNA for beta-2-glycoprotein I")
04497         self.assertEqual(record[0]["GBSeq_primary-accession"], "X60065")
04498         self.assertEqual(record[0]["GBSeq_accession-version"], "X60065.1")
04499         self.assertEqual(record[0]["GBSeq_other-seqids"][0], "emb|X60065.1|")
04500         self.assertEqual(record[0]["GBSeq_other-seqids"][1], "gi|5")
04501         self.assertEqual(record[0]["GBSeq_keywords"][0], "beta-2 glycoprotein I")
04502         self.assertEqual(record[0]["GBSeq_source"], "Bos taurus (cattle)")
04503         self.assertEqual(record[0]["GBSeq_organism"], "Bos taurus")
04504         self.assertEqual(record[0]["GBSeq_taxonomy"], "Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; Mammalia; Eutheria; Laurasiatheria; Cetartiodactyla; Ruminantia; Pecora; Bovidae; Bovinae; Bos")
04505         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_reference"], "1")
04506         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][0], "Bendixen,E.")
04507         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][1], "Halkier,T.")
04508         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][2], "Magnusson,S.")
04509         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][3], "Sottrup-Jensen,L.")
04510         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][4], "Kristensen,T.")
04511         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_title"], "Complete primary structure of bovine beta 2-glycoprotein I: localization of the disulfide bridges")
04512         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_journal"], "Biochemistry 31 (14), 3611-3617 (1992)")
04513         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_pubmed"], "1567819")
04514         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_reference"], "2")
04515         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_position"], "1..1136")
04516         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_authors"][0], "Kristensen,T.")
04517         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_title"], "Direct Submission")
04518         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_journal"], "Submitted (11-JUN-1991) T. Kristensen, Dept of Mol Biology, University of Aarhus, C F Mollers Alle 130, DK-8000 Aarhus C, DENMARK")
04519         self.assertEqual(len(record[0]["GBSeq_feature-table"]), 7)
04520         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_key"], "source")
04521         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_location"], "1..1136")
04522         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04523         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_to"], "1136")
04524         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04525         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][0]["GBQualifier_name"], "organism")
04526         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][0]["GBQualifier_value"], "Bos taurus")
04527         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][1]["GBQualifier_name"], "mol_type")
04528         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][1]["GBQualifier_value"], "mRNA")
04529         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][2]["GBQualifier_name"], "db_xref")
04530         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][2]["GBQualifier_value"], "taxon:9913")
04531         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][3]["GBQualifier_name"], "clone")
04532         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][3]["GBQualifier_value"], "pBB2I")
04533         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][4]["GBQualifier_name"], "tissue_type")
04534         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][4]["GBQualifier_value"], "liver")
04535         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_key"], "gene")
04536         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_location"], "<1..1136")
04537         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04538         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_to"], "1136")
04539         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04540         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_partial5"], "")
04541         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_partial5"].attributes["value"], "true")
04542         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04543         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04544         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_key"], "CDS")
04545         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_location"], "<1..1029")
04546         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04547         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_to"], "1029")
04548         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04549         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_partial5"], "")
04550         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_partial5"].attributes["value"], "true")
04551         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04552         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04553         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][1]["GBQualifier_name"], "codon_start")
04554         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][1]["GBQualifier_value"], "1")
04555         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][2]["GBQualifier_name"], "transl_table")
04556         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][2]["GBQualifier_value"], "1")
04557         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][3]["GBQualifier_name"], "product")
04558         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][3]["GBQualifier_value"], "beta-2-glycoprotein I")
04559         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][4]["GBQualifier_name"], "protein_id")
04560         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][4]["GBQualifier_value"], "CAA42669.1")
04561         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][5]["GBQualifier_name"], "db_xref")
04562         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][5]["GBQualifier_value"], "GI:6")
04563         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][6]["GBQualifier_name"], "db_xref")
04564         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][6]["GBQualifier_value"], "GOA:P17690")
04565         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][7]["GBQualifier_name"], "db_xref")
04566         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][7]["GBQualifier_value"], "UniProtKB/Swiss-Prot:P17690")
04567         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][8]["GBQualifier_name"], "translation")
04568         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][8]["GBQualifier_value"], "PALVLLLGFLCHVAIAGRTCPKPDELPFSTVVPLKRTYEPGEQIVFSCQPGYVSRGGIRRFTCPLTGLWPINTLKCMPRVCPFAGILENGTVRYTTFEYPNTISFSCHTGFYLKGASSAKCTEEGKWSPDLPVCAPITCPPPPIPKFASLSVYKPLAGNNSFYGSKAVFKCLPHHAMFGNDTVTCTEHGNWTQLPECREVRCPFPSRPDNGFVNHPANPVLYYKDTATFGCHETYSLDGPEEVECSKFGNWSAQPSCKASCKLSIKRATVIYEGERVAIQNKFKNGMLHGQKVSFFCKHKEKKCSYTEDAQCIDGTIEIPKCFKEHSSLAFWKTDASDVKPC")
04569         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_key"], "sig_peptide")
04570         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_location"], "<1..48")
04571         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04572         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_to"], "48")
04573         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04574         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_partial5"], "")
04575         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_partial5"].attributes["value"], "true")
04576         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04577         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04578         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_key"], "mat_peptide")
04579         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_location"], "49..1026")
04580         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_intervals"][0]["GBInterval_from"], "49")
04581         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_intervals"][0]["GBInterval_to"], "1026")
04582         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04583         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04584         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04585         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_quals"][1]["GBQualifier_name"], "product")
04586         self.assertEqual(record[0]["GBSeq_feature-table"][4]["GBFeature_quals"][1]["GBQualifier_value"], "beta-2-glycoprotein I")
04587         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_key"], "polyA_signal")
04588         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_location"], "1101..1106")
04589         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_intervals"][0]["GBInterval_from"], "1101")
04590         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_intervals"][0]["GBInterval_to"], "1106")
04591         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04592         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04593         self.assertEqual(record[0]["GBSeq_feature-table"][5]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04594         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_key"], "polyA_site")
04595         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_location"], "1130")
04596         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_intervals"][0]["GBInterval_point"], "1130")
04597         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_intervals"][0]["GBInterval_accession"], "X60065.1")
04598         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_quals"][0]["GBQualifier_name"], "gene")
04599         self.assertEqual(record[0]["GBSeq_feature-table"][6]["GBFeature_quals"][0]["GBQualifier_value"], "beta-2-gpI")
04600         self.assertEqual(record[0]["GBSeq_sequence"], "ccagcgctcgtcttgctgttggggtttctctgccacgttgctatcgcaggacgaacctgccccaagccagatgagctaccgttttccacggtggttccactgaaacggacctatgagcccggggagcagatagtcttctcctgccagccgggctacgtgtcccggggagggatccggcggtttacatgcccgctcacaggactctggcccatcaacacgctgaaatgcatgcccagagtatgtccttttgctgggatcttagaaaacggaacggtacgctatacaacgtttgagtatcccaacaccatcagcttttcttgccacacggggttttatctgaaaggagctagttctgcaaaatgcactgaggaagggaagtggagcccagaccttcctgtctgtgcccctataacctgccctccaccacccatacccaagtttgcaagtctcagcgtttacaagccgttggctgggaacaactccttctatggcagcaaggcagtctttaagtgcttgccacaccacgcgatgtttggaaatgacaccgttacctgcacggaacatgggaactggacgcagttgccagaatgcagggaagtaagatgcccattcccatcaagaccagacaatgggtttgtgaaccatcctgcaaatccagtgctctactataaggacaccgccacctttggctgccatgaaacgtattccttggatggaccggaagaagtagaatgcagcaaattcggaaactggtctgcacagccaagctgtaaagcatcttgtaagttatctattaaaagagctactgtgatatatgaaggagagagagtagctatccagaacaaatttaagaatggaatgctgcatggccaaaaggtttctttcttctgcaagcataaggaaaagaagtgcagctacacagaagatgctcagtgcatagacggcaccatcgagattcccaaatgcttcaaggagcacagttctttagctttctggaaaacggatgcatctgacgtaaaaccatgctaagctggttttcacactgaaaattaaatgtcatgcttatatgtgtctgtctgagaatctgatggaaacggaaaaataaagagactgaatttaccgtgtcaagaaaaaaa")

Here is the call graph for this function:

Test parsing XML returned by EFetch, Nucleotide database (second test)

Definition at line 4601 of file test_Entrez.py.

04601 
04602     def test_nucleotide2(self):
04603         '''Test parsing XML returned by EFetch, Nucleotide database (second test)
04604         '''
04605         # Access the nucleotide database using efetch.
04606         # To create the XML file, use
04607         # >>> Bio.Entrez.efetch(db='nucleotide', id=5,
04608         #                       rettype='fasta', complexity=0, retmode='xml')
04609         handle = open('Entrez/nucleotide2.xml', "rb")
04610         record = Entrez.read(handle)
04611         handle.close()
04612         self.assertEqual(record[0]["TSeq_seqtype"], "")
04613         self.assertEqual(record[0]["TSeq_seqtype"].attributes["value"], "nucleotide")
04614         self.assertEqual(record[0]["TSeq_gi"], "5")
04615         self.assertEqual(record[0]["TSeq_accver"], "X60065.1")
04616         self.assertEqual(record[0]["TSeq_taxid"], "9913")
04617         self.assertEqual(record[0]["TSeq_orgname"], "Bos taurus")
04618         self.assertEqual(record[0]["TSeq_defline"], "B.bovis beta-2-gpI mRNA for beta-2-glycoprotein I")
04619         self.assertEqual(record[0]["TSeq_length"], "1136")
04620         self.assertEqual(record[0]["TSeq_sequence"], "CCAGCGCTCGTCTTGCTGTTGGGGTTTCTCTGCCACGTTGCTATCGCAGGACGAACCTGCCCCAAGCCAGATGAGCTACCGTTTTCCACGGTGGTTCCACTGAAACGGACCTATGAGCCCGGGGAGCAGATAGTCTTCTCCTGCCAGCCGGGCTACGTGTCCCGGGGAGGGATCCGGCGGTTTACATGCCCGCTCACAGGACTCTGGCCCATCAACACGCTGAAATGCATGCCCAGAGTATGTCCTTTTGCTGGGATCTTAGAAAACGGAACGGTACGCTATACAACGTTTGAGTATCCCAACACCATCAGCTTTTCTTGCCACACGGGGTTTTATCTGAAAGGAGCTAGTTCTGCAAAATGCACTGAGGAAGGGAAGTGGAGCCCAGACCTTCCTGTCTGTGCCCCTATAACCTGCCCTCCACCACCCATACCCAAGTTTGCAAGTCTCAGCGTTTACAAGCCGTTGGCTGGGAACAACTCCTTCTATGGCAGCAAGGCAGTCTTTAAGTGCTTGCCACACCACGCGATGTTTGGAAATGACACCGTTACCTGCACGGAACATGGGAACTGGACGCAGTTGCCAGAATGCAGGGAAGTAAGATGCCCATTCCCATCAAGACCAGACAATGGGTTTGTGAACCATCCTGCAAATCCAGTGCTCTACTATAAGGACACCGCCACCTTTGGCTGCCATGAAACGTATTCCTTGGATGGACCGGAAGAAGTAGAATGCAGCAAATTCGGAAACTGGTCTGCACAGCCAAGCTGTAAAGCATCTTGTAAGTTATCTATTAAAAGAGCTACTGTGATATATGAAGGAGAGAGAGTAGCTATCCAGAACAAATTTAAGAATGGAATGCTGCATGGCCAAAAGGTTTCTTTCTTCTGCAAGCATAAGGAAAAGAAGTGCAGCTACACAGAAGATGCTCAGTGCATAGACGGCACCATCGAGATTCCCAAATGCTTCAAGGAGCACAGTTCTTTAGCTTTCTGGAAAACGGATGCATCTGACGTAAAACCATGCTAAGCTGGTTTTCACACTGAAAATTAAATGTCATGCTTATATGTGTCTGTCTGAGAATCTGATGGAAACGGAAAAATAAAGAGACTGAATTTACCGTGTCAAGAAAAAAA")
04621         self.assertEqual(record[1]["TSeq_seqtype"], "")
04622         self.assertEqual(record[1]["TSeq_seqtype"].attributes["value"], "protein")
04623         self.assertEqual(record[1]["TSeq_gi"], "6")
04624         self.assertEqual(record[1]["TSeq_accver"], "CAA42669.1")
04625         self.assertEqual(record[1]["TSeq_taxid"], "9913")
04626         self.assertEqual(record[1]["TSeq_orgname"], "Bos taurus")
04627         self.assertEqual(record[1]["TSeq_defline"], "beta-2-glycoprotein I [Bos taurus]")
04628         self.assertEqual(record[1]["TSeq_length"], "342")
04629         self.assertEqual(record[1]["TSeq_sequence"], "PALVLLLGFLCHVAIAGRTCPKPDELPFSTVVPLKRTYEPGEQIVFSCQPGYVSRGGIRRFTCPLTGLWPINTLKCMPRVCPFAGILENGTVRYTTFEYPNTISFSCHTGFYLKGASSAKCTEEGKWSPDLPVCAPITCPPPPIPKFASLSVYKPLAGNNSFYGSKAVFKCLPHHAMFGNDTVTCTEHGNWTQLPECREVRCPFPSRPDNGFVNHPANPVLYYKDTATFGCHETYSLDGPEEVECSKFGNWSAQPSCKASCKLSIKRATVIYEGERVAIQNKFKNGMLHGQKVSFFCKHKEKKCSYTEDAQCIDGTIEIPKCFKEHSSLAFWKTDASDVKPC")

Here is the call graph for this function:

Here is the caller graph for this function:

Test parsing XML returned by EFetch, Protein database

Definition at line 4630 of file test_Entrez.py.

04630 
04631     def test_nucleotide2(self):
04632         '''Test parsing XML returned by EFetch, Protein database
04633         '''
04634         # Access the protein database using efetch.
04635         # To create the XML file, use
04636         # >>> Bio.Entrez.efetch(db='protein', id=8, rettype='gp', retmode='xml')
04637         handle = open('Entrez/protein.xml', "rb")
04638         record = Entrez.read(handle)
04639         handle.close()
04640         self.assertEqual(record[0]["GBSeq_locus"], "CAA35997")
04641         self.assertEqual(record[0]["GBSeq_length"], "100")
04642         self.assertEqual(record[0]["GBSeq_moltype"], "AA")
04643         self.assertEqual(record[0]["GBSeq_topology"], "linear")
04644         self.assertEqual(record[0]["GBSeq_division"], "MAM")
04645         self.assertEqual(record[0]["GBSeq_update-date"], "12-SEP-1993")
04646         self.assertEqual(record[0]["GBSeq_create-date"], "03-APR-1990")
04647         self.assertEqual(record[0]["GBSeq_definition"], "unnamed protein product [Bos taurus]")
04648         self.assertEqual(record[0]["GBSeq_primary-accession"], "CAA35997")
04649         self.assertEqual(record[0]["GBSeq_accession-version"], "CAA35997.1")
04650         self.assertEqual(record[0]["GBSeq_other-seqids"][0], "emb|CAA35997.1|")
04651         self.assertEqual(record[0]["GBSeq_other-seqids"][1], "gi|8")
04652         self.assertEqual(record[0]["GBSeq_source"], "Bos taurus (cattle)")
04653         self.assertEqual(record[0]["GBSeq_organism"], "Bos taurus")
04654         self.assertEqual(record[0]["GBSeq_taxonomy"], "Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; Mammalia; Eutheria; Laurasiatheria; Cetartiodactyla; Ruminantia; Pecora; Bovidae; Bovinae; Bos")
04655         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_reference"], "1")
04656         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_position"], "1..100")
04657         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][0], "Kiefer,M.C.")
04658         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][1], "Saphire,A.C.S.")
04659         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][2], "Bauer,D.M.")
04660         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_authors"][3], "Barr,P.J.")
04661         self.assertEqual(record[0]["GBSeq_references"][0]["GBReference_journal"], "Unpublished")
04662         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_reference"], "2")
04663         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_position"], "1..100")
04664         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_authors"][0], "Kiefer,M.C.")
04665         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_title"], "Direct Submission")
04666         self.assertEqual(record[0]["GBSeq_references"][1]["GBReference_journal"], "Submitted (30-JAN-1990) Kiefer M.C., Chiron Corporation, 4560 Hortom St, Emeryville CA 94608-2916, U S A")
04667         self.assertEqual(record[0]["GBSeq_comment"], "See <X15699> for Human sequence.~Data kindly reviewed (08-MAY-1990) by Kiefer M.C.")
04668         self.assertEqual(record[0]["GBSeq_source-db"], "embl accession X51700.1")
04669         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_key"], "source")
04670         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_location"], "1..100")
04671         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04672         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_to"], "100")
04673         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_intervals"][0]["GBInterval_accession"], "CAA35997.1")
04674         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][0]["GBQualifier_name"], "organism")
04675         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][0]["GBQualifier_value"], "Bos taurus")
04676         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][1]["GBQualifier_name"], "db_xref")
04677         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][1]["GBQualifier_value"], "taxon:9913")
04678         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][2]["GBQualifier_name"], "clone")
04679         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][2]["GBQualifier_value"], "bBGP-3")
04680         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][3]["GBQualifier_name"], "tissue_type")
04681         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][3]["GBQualifier_value"], "bone matrix")
04682         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][4]["GBQualifier_name"], "clone_lib")
04683         self.assertEqual(record[0]["GBSeq_feature-table"][0]["GBFeature_quals"][4]["GBQualifier_value"], "Zap-bb")
04684         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_key"], "Protein")
04685         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_location"], "1..100")
04686         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04687         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_to"], "100")
04688         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_intervals"][0]["GBInterval_accession"], "CAA35997.1")
04689         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_quals"][0]["GBQualifier_name"], "name")
04690         self.assertEqual(record[0]["GBSeq_feature-table"][1]["GBFeature_quals"][0]["GBQualifier_value"], "unnamed protein product")
04691         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_key"], "Region")
04692         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_location"], "33..97")
04693         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_from"], "33")
04694         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_to"], "97")
04695         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_intervals"][0]["GBInterval_accession"], "CAA35997.1")
04696         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][0]["GBQualifier_name"], "region_name")
04697         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][0]["GBQualifier_value"], "Gla")
04698         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][1]["GBQualifier_name"], "note")
04699         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][1]["GBQualifier_value"], "Vitamin K-dependent carboxylation/gamma-carboxyglutamic (GLA) domain. This domain is responsible for the high-affinity binding of calcium ions. This domain contains post-translational modifications of many glutamate residues by Vitamin K-dependent...; cl02449")
04700         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][2]["GBQualifier_name"], "db_xref")
04701         self.assertEqual(record[0]["GBSeq_feature-table"][2]["GBFeature_quals"][2]["GBQualifier_value"], "CDD:92835")
04702         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_key"], "CDS")
04703         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_location"], "1..100")
04704         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_from"], "1")
04705         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_to"], "100")
04706         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_intervals"][0]["GBInterval_accession"], "CAA35997.1")
04707         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][0]["GBQualifier_name"], "coded_by")
04708         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][0]["GBQualifier_value"], "X51700.1:28..330")
04709         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][1]["GBQualifier_name"], "note")
04710         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][1]["GBQualifier_value"], "bone Gla precursor (100 AA)")
04711         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][2]["GBQualifier_name"], "db_xref")
04712         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][2]["GBQualifier_value"], "GOA:P02820")
04713         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][3]["GBQualifier_name"], "db_xref")
04714         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][3]["GBQualifier_value"], "InterPro:IPR000294")
04715         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][4]["GBQualifier_name"], "db_xref")
04716         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][4]["GBQualifier_value"], "InterPro:IPR002384")
04717         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][5]["GBQualifier_name"], "db_xref")
04718         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][5]["GBQualifier_value"], "PDB:1Q3M")
04719         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][6]["GBQualifier_name"], "db_xref")
04720         self.assertEqual(record[0]["GBSeq_feature-table"][3]["GBFeature_quals"][6]["GBQualifier_value"], "UniProtKB/Swiss-Prot:P02820")
04721         self.assertEqual(record[0]["GBSeq_sequence"], "mrtpmllallalatlclagradakpgdaesgkgaafvskqegsevvkrlrryldhwlgapapypdplepkrevcelnpdcdeladhigfqeayrrfygpv")

Here is the call graph for this function:

Test parsing XML returned by EFetch, OMIM database

Definition at line 4191 of file test_Entrez.py.

04191 
04192     def test_omim(self):
04193         '''Test parsing XML returned by EFetch, OMIM database
04194         '''
04195         # In OMIM show the full record for MIM number 601100 as XML
04196         # To create the XML file, use
04197         # >>> Bio.Entrez.efetch(db="omim", id="601100", retmode='xml',
04198         #                       rettype='full')
04199         handle = open('Entrez/ncbi_mim.xml', "rb")
04200         record = Entrez.read(handle)
04201         handle.close()
04202         self.assertEqual(len(record), 1)
04203         self.assertEqual(record[0]["Mim-entry_mimNumber"], "601100")
04204         self.assertEqual(record[0]["Mim-entry_mimType"], "1")
04205         self.assertEqual(record[0]["Mim-entry_mimType"].attributes["value"], "star")
04206         self.assertEqual(record[0]["Mim-entry_title"], "STRESS 70 PROTEIN CHAPERONE, MICROSOME-ASSOCIATED, 60-KD; STCH")
04207         self.assertEqual(record[0]["Mim-entry_copyright"], "Copyright (c) 1966-2008 Johns Hopkins University")
04208         self.assertEqual(record[0]["Mim-entry_symbol"], "STCH")
04209         self.assertEqual(record[0]["Mim-entry_locus"], "21q11.1")
04210         self.assertEqual(len(record[0]["Mim-entry_text"]), 2)
04211         self.assertEqual(record[0]["Mim-entry_text"][0]["Mim-text_label"], "TEXT")
04212         self.assertEqual(record[0]["Mim-entry_text"][0]["Mim-text_text"], "The stress-70 chaperone family consists of proteins that bind to denatured or incorrectly folded polypeptides and play a major role in the processing of cytosolic and secretory proteins. {2:Otterson et al. (1994)} cloned a human cDNA encoding a predicted 471-amino acid protein (60 kD) which they designated STCH. {1:Brodsky et al. (1995)} stated that the protein sequence is very similar to that of HSP70 ({140550}) and BiP ({138120}). As with other members of the family, the STCH protein contains an ATPase domain at the amino terminus whose activity was shown to be independent of peptide stimulation. The protein was found to be microsome-associated and constitutively expressed in all cell types examined.")
04213         self.assertEqual(len(record[0]["Mim-entry_text"][0]["Mim-text_neighbors"]), 1)
04214         self.assertEqual(record[0]["Mim-entry_text"][0]["Mim-text_neighbors"]["Mim-link"]["Mim-link_num"], "30")
04215         self.assertEqual(record[0]["Mim-entry_text"][0]["Mim-text_neighbors"]["Mim-link"]["Mim-link_uids"], "8131751,9358068,10675567,9488737,8757872,11048651,2559088,10982831,2105497,16572726,9083109,17181539,14508011,15028727,10651811,9108392,11599566,2661019,11836248,7594475,12406544,8536694,12389629,10430932,9177027,9837933,8522346,2928112,12834280,8702658")
04216         self.assertEqual(record[0]["Mim-entry_text"][0]["Mim-text_neighbors"]["Mim-link"]["Mim-link_numRelevant"], "0")
04217         self.assertEqual(record[0]["Mim-entry_text"][1]["Mim-text_label"], "TEXT")
04218         self.assertEqual(record[0]["Mim-entry_text"][1]["Mim-text_text"], "{1:Brodsky et al. (1995)} mapped the STCH gene to chromosome 21q11.1 with a high-resolution somatic cell hybrid panel for chromosome 21 and by fluorescence in situ hybridization with a YAC containing the gene. By interspecific backcross analysis, {3:Reeves et al. (1998)} mapped the mouse Stch gene to chromosome 16.")
04219         self.assertEqual(len(record[0]["Mim-entry_text"][1]["Mim-text_neighbors"]), 1)
04220         self.assertEqual(record[0]["Mim-entry_text"][1]["Mim-text_neighbors"]["Mim-link"]["Mim-link_num"], "30")
04221         self.assertEqual(record[0]["Mim-entry_text"][1]["Mim-text_neighbors"]["Mim-link"]["Mim-link_uids"], "1354597,8244375,8597637,8838809,9143508,1427875,7806216,9852683,7835904,11060461,10083745,7789175,7806232,7513297,8020937,12014109,1769649,2045096,9747039,8034329,8088815,1783375,8275716,8020959,7956352,8020952,10198174,7655454,8750197,11272792")
04222         self.assertEqual(record[0]["Mim-entry_text"][1]["Mim-text_neighbors"]["Mim-link"]["Mim-link_numRelevant"], "0")
04223         self.assertEqual(record[0]["Mim-entry_hasSummary"], "")
04224         self.assertEqual(record[0]["Mim-entry_hasSummary"].attributes["value"], "false")
04225         self.assertEqual(record[0]["Mim-entry_hasSynopsis"], "")
04226         self.assertEqual(record[0]["Mim-entry_hasSynopsis"].attributes["value"], "false")
04227         self.assertEqual(len(record[0]["Mim-entry_editHistory"]), 6)
04228         self.assertEqual(record[0]["Mim-entry_editHistory"][0]["Mim-edit-item_author"], "terry")
04229         self.assertEqual(record[0]["Mim-entry_editHistory"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1999")
04230         self.assertEqual(record[0]["Mim-entry_editHistory"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04231         self.assertEqual(record[0]["Mim-entry_editHistory"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "9")
04232         self.assertEqual(record[0]["Mim-entry_editHistory"][1]["Mim-edit-item_author"], "carol")
04233         self.assertEqual(record[0]["Mim-entry_editHistory"][1]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1999")
04234         self.assertEqual(record[0]["Mim-entry_editHistory"][1]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04235         self.assertEqual(record[0]["Mim-entry_editHistory"][1]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "7")
04236         self.assertEqual(record[0]["Mim-entry_editHistory"][2]["Mim-edit-item_author"], "carol")
04237         self.assertEqual(record[0]["Mim-entry_editHistory"][2]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1998")
04238         self.assertEqual(record[0]["Mim-entry_editHistory"][2]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "7")
04239         self.assertEqual(record[0]["Mim-entry_editHistory"][2]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "8")
04240         self.assertEqual(record[0]["Mim-entry_editHistory"][3]["Mim-edit-item_author"], "terry")
04241         self.assertEqual(record[0]["Mim-entry_editHistory"][3]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1996")
04242         self.assertEqual(record[0]["Mim-entry_editHistory"][3]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "5")
04243         self.assertEqual(record[0]["Mim-entry_editHistory"][3]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "24")
04244         self.assertEqual(record[0]["Mim-entry_editHistory"][4]["Mim-edit-item_author"], "mark")
04245         self.assertEqual(record[0]["Mim-entry_editHistory"][4]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1996")
04246         self.assertEqual(record[0]["Mim-entry_editHistory"][4]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04247         self.assertEqual(record[0]["Mim-entry_editHistory"][4]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "1")
04248         self.assertEqual(record[0]["Mim-entry_editHistory"][5]["Mim-edit-item_author"], "mark")
04249         self.assertEqual(record[0]["Mim-entry_editHistory"][5]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1996")
04250         self.assertEqual(record[0]["Mim-entry_editHistory"][5]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04251         self.assertEqual(record[0]["Mim-entry_editHistory"][5]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "1")
04252         self.assertEqual(record[0]["Mim-entry_creationDate"]["Mim-edit-item"]["Mim-edit-item_author"], "Alan F. Scott")
04253         self.assertEqual(record[0]["Mim-entry_creationDate"]["Mim-edit-item"]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1996")
04254         self.assertEqual(record[0]["Mim-entry_creationDate"]["Mim-edit-item"]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04255         self.assertEqual(record[0]["Mim-entry_creationDate"]["Mim-edit-item"]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "1")
04256         self.assertEqual(len(record[0]["Mim-entry_references"]), 3)
04257         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_number"], "1")
04258         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_origNumber"], "1")
04259         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_type"], "")
04260         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_type"].attributes["value"], "citation")
04261         self.assertEqual(len(record[0]["Mim-entry_references"][0]["Mim-reference_authors"]), 6)
04262         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][0]["Mim-author_name"], "Brodsky, G.")
04263         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][0]["Mim-author_index"], "1")
04264         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][1]["Mim-author_name"], "Otterson, G. A.")
04265         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][1]["Mim-author_index"], "1")
04266         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][2]["Mim-author_name"], "Parry, B. B.")
04267         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][2]["Mim-author_index"], "1")
04268         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][3]["Mim-author_name"], "Hart, I.")
04269         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][3]["Mim-author_index"], "1")
04270         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][4]["Mim-author_name"], "Patterson, D.")
04271         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][4]["Mim-author_index"], "1")
04272         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][5]["Mim-author_name"], "Kaye, F. J.")
04273         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_authors"][5]["Mim-author_index"], "1")
04274         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_primaryAuthor"], "Brodsky")
04275         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_otherAuthors"], "et al.")
04276         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_citationTitle"], "Localization of STCH to human chromosome 21q11.1.")
04277         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_citationType"], "0")
04278         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_volume"], "30")
04279         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_journal"], "Genomics")
04280         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_year"], "1995")
04281         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_month"], "0")
04282         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_day"], "0")
04283         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pages"][0]["Mim-page_from"], "627")
04284         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pages"][0]["Mim-page_to"], "628")
04285         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_pubmedUID"], "8825657")
04286         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_ambiguous"], "")
04287         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_ambiguous"].attributes["value"], "false")
04288         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_noLink"], "")
04289         self.assertEqual(record[0]["Mim-entry_references"][0]["Mim-reference_noLink"].attributes["value"], "false")
04290         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_number"], "2")
04291         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_origNumber"], "2")
04292         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_type"], "")
04293         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_type"].attributes["value"], "citation")
04294         self.assertEqual(len(record[0]["Mim-entry_references"][1]["Mim-reference_authors"]), 6)
04295         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][0]["Mim-author_name"], "Otterson, G. A.")
04296         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][0]["Mim-author_index"], "1")
04297         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][1]["Mim-author_name"], "Flynn, G. C.")
04298         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][1]["Mim-author_index"], "1")
04299         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][2]["Mim-author_name"], "Kratzke, R. A.")
04300         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][2]["Mim-author_index"], "1")
04301         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][3]["Mim-author_name"], "Coxon, A.")
04302         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][3]["Mim-author_index"], "1")
04303         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][4]["Mim-author_name"], "Johnston, P. G.")
04304         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][4]["Mim-author_index"], "1")
04305         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][5]["Mim-author_name"], "Kaye, F. J.")
04306         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_authors"][5]["Mim-author_index"], "1")
04307         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_primaryAuthor"], "Otterson")
04308         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_otherAuthors"], "et al.")
04309         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_citationTitle"], "Stch encodes the 'ATPase core' of a microsomal stress70 protein.")
04310         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_citationType"], "0")
04311         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_volume"], "13")
04312         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_journal"], "EMBO J.")
04313         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_year"], "1994")
04314         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_month"], "0")
04315         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_day"], "0")
04316         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pages"][0]["Mim-page_from"], "1216")
04317         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pages"][0]["Mim-page_to"], "1225")
04318         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_pubmedUID"], "8131751")
04319         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_ambiguous"], "")
04320         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_ambiguous"].attributes["value"], "false")
04321         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_noLink"], "")
04322         self.assertEqual(record[0]["Mim-entry_references"][1]["Mim-reference_noLink"].attributes["value"], "false")
04323         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_number"], "3")
04324         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_origNumber"], "3")
04325         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_type"], "")
04326         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_type"].attributes["value"], "citation")
04327         self.assertEqual(len(record[0]["Mim-entry_references"][2]["Mim-reference_authors"]), 4)
04328         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][0]["Mim-author_name"], "Reeves, R. H.")
04329         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][0]["Mim-author_index"], "1")
04330         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][1]["Mim-author_name"], "Rue, E.")
04331         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][1]["Mim-author_index"], "1")
04332         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][2]["Mim-author_name"], "Yu, J.")
04333         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][2]["Mim-author_index"], "1")
04334         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][3]["Mim-author_name"], "Kao, F.-T.")
04335         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_authors"][3]["Mim-author_index"], "1")
04336         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_primaryAuthor"], "Reeves")
04337         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_otherAuthors"], "et al.")
04338         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_citationTitle"], "Stch maps to mouse chromosome 16, extending the conserved synteny with human chromosome 21.")
04339         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_citationType"], "0")
04340         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_volume"], "49")
04341         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_journal"], "Genomics")
04342         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_year"], "1998")
04343         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_month"], "0")
04344         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pubDate"]["Mim-date"]["Mim-date_day"], "0")
04345         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pages"][0]["Mim-page_from"], "156")
04346         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pages"][0]["Mim-page_to"], "157")
04347         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_pubmedUID"], "9570963")
04348         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_ambiguous"], "")
04349         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_ambiguous"].attributes["value"], "false")
04350         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_noLink"], "")
04351         self.assertEqual(record[0]["Mim-entry_references"][2]["Mim-reference_noLink"].attributes["value"], "false")
04352         self.assertEqual(record[0]["Mim-entry_attribution"][0]["Mim-edit-item_author"], "Carol A. Bocchini - updated")
04353         self.assertEqual(record[0]["Mim-entry_attribution"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_year"], "1999")
04354         self.assertEqual(record[0]["Mim-entry_attribution"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_month"], "3")
04355         self.assertEqual(record[0]["Mim-entry_attribution"][0]["Mim-edit-item_modDate"]["Mim-date"]["Mim-date_day"], "7")
04356         self.assertEqual(record[0]["Mim-entry_numGeneMaps"], "1")
04357         self.assertEqual(len(record[0]["Mim-entry_medlineLinks"]), 1)
04358         self.assertEqual(record[0]["Mim-entry_medlineLinks"]["Mim-link"]["Mim-link_num"], "3")
04359         self.assertEqual(record[0]["Mim-entry_medlineLinks"]["Mim-link"]["Mim-link_uids"], "8825657,8131751,9570963")
04360         self.assertEqual(record[0]["Mim-entry_medlineLinks"]["Mim-link"]["Mim-link_numRelevant"], "0")
04361         self.assertEqual(len(record[0]["Mim-entry_proteinLinks"]), 1)
04362         self.assertEqual(record[0]["Mim-entry_proteinLinks"]["Mim-link"]["Mim-link_num"], "7")
04363         self.assertEqual(record[0]["Mim-entry_proteinLinks"]["Mim-link"]["Mim-link_uids"], "148747550,67461586,48928056,30089677,2352621,1351125,460148")
04364         self.assertEqual(record[0]["Mim-entry_proteinLinks"]["Mim-link"]["Mim-link_numRelevant"], "0")
04365         self.assertEqual(len(record[0]["Mim-entry_nucleotideLinks"]), 1)
04366         self.assertEqual(record[0]["Mim-entry_nucleotideLinks"]["Mim-link"]["Mim-link_num"], "5")
04367         self.assertEqual(record[0]["Mim-entry_nucleotideLinks"]["Mim-link"]["Mim-link_uids"], "148747549,55741785,48928055,2352620,460147")
04368         self.assertEqual(record[0]["Mim-entry_nucleotideLinks"]["Mim-link"]["Mim-link_numRelevant"], "0")

Here is the call graph for this function:

Test parsing XML returned by EFetch, PubMed database (first test)

Definition at line 3773 of file test_Entrez.py.

03773 
03774     def test_pubmed1(self):
03775         '''Test parsing XML returned by EFetch, PubMed database (first test)
03776         '''
03777         # In PubMed display PMIDs 12091962 and 9997 in xml retrieval mode
03778         # and abstract retrieval type.
03779         # To create the XML file, use
03780         # >>> Bio.Entrez.efetch(db='pubmed', id='12091962,9997',
03781         #                       retmode='xml', rettype='abstract')
03782         handle = open('Entrez/pubmed1.xml', "rb")
03783         record = Entrez.read(handle)
03784         handle.close()
03785         self.assertEqual(record[0]["MedlineCitation"].attributes["Owner"], "KIE")
03786         self.assertEqual(record[0]["MedlineCitation"].attributes["Status"], "MEDLINE")
03787         self.assertEqual(record[0]["MedlineCitation"]["PMID"], "12091962")
03788         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Year"], "1991")
03789         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Month"], "01")
03790         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Day"], "22")
03791         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Year"], "1991")
03792         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Month"], "01")
03793         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Day"], "22")
03794         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Year"], "2007")
03795         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Month"], "11")
03796         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Day"], "15")
03797         self.assertEqual(record[0]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
03798         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "1043-1578")
03799         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
03800         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
03801         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "17")
03802         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "1")
03803         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "1990")
03804         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Season"], "Spring")
03805         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["Title"], "Social justice (San Francisco, Calif.)")
03806         self.assertEqual(record[0]["MedlineCitation"]["Article"]["ArticleTitle"], "The treatment of AIDS behind the walls of correctional facilities.")
03807         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "113-25")
03808         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], 'Y')
03809         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
03810         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Olivero")
03811         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "J Michael")
03812         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "JM")
03813         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Language"], ["eng"])
03814         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"], ["Journal Article", "Review"])
03815         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "United States")
03816         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Soc Justice")
03817         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "9891830")
03818         self.assertEqual(record[0]["MedlineCitation"]["CitationSubset"], ["E"])
03819         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "AIDS Serodiagnosis")
03820         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
03821         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Acquired Immunodeficiency Syndrome")
03822         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03823         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Civil Rights")
03824         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "N")
03825         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "HIV Seropositivity")
03826         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03827         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Humans")
03828         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
03829         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Jurisprudence")
03830         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03831         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Law Enforcement")
03832         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
03833         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Mass Screening")
03834         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
03835         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Minority Groups")
03836         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
03837         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Organizational Policy")
03838         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "N")
03839         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Patient Care")
03840         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
03841         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"], "Prejudice")
03842         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"].attributes["MajorTopicYN"], "N")
03843         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"], "Prisoners")
03844         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03845         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][13]["DescriptorName"], "Public Policy")
03846         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][13]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03847         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][14]["DescriptorName"], "Quarantine")
03848         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][14]["DescriptorName"].attributes["MajorTopicYN"], "N")
03849         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][15]["DescriptorName"], "Social Control, Formal")
03850         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][15]["DescriptorName"].attributes["MajorTopicYN"], "N")
03851         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][16]["DescriptorName"], "Statistics as Topic")
03852         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][16]["DescriptorName"].attributes["MajorTopicYN"], "N")
03853         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][17]["DescriptorName"], "Stereotyping")
03854         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][17]["DescriptorName"].attributes["MajorTopicYN"], "N")
03855         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][18]["DescriptorName"], "United States")
03856         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][18]["DescriptorName"].attributes["MajorTopicYN"], "N")
03857         self.assertEqual(record[0]["MedlineCitation"]["NumberOfReferences"], "63")
03858         self.assertEqual(record[0]["MedlineCitation"]["OtherID"][0], "31840")
03859         self.assertEqual(record[0]["MedlineCitation"]["OtherID"][0].attributes["Source"], "KIE")
03860         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0].attributes["Owner"], "KIE")
03861         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][0], "Health Care and Public Health")
03862         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][0].attributes["MajorTopicYN"], "N")
03863         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][1], "Legal Approach")
03864         self.assertEqual(record[0]["MedlineCitation"]["KeywordList"][0][1].attributes["MajorTopicYN"], "N")
03865         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][0], "14 fn.")
03866         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][0].attributes["Owner"], "KIE")
03867         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][1], "KIE BoB Subject Heading: AIDS")
03868         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][1].attributes["Owner"], "KIE")
03869         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][2], "63 refs.")
03870         self.assertEqual(record[0]["MedlineCitation"]["GeneralNote"][2].attributes["Owner"], "KIE")
03871         self.assertEqual(record[0]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
03872         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Year"], "1990")
03873         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Month"], "4")
03874         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Day"], "1")
03875         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Hour"], "0")
03876         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Minute"], "0")
03877         self.assertEqual(record[0]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
03878         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Year"], "2002")
03879         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Month"], "7")
03880         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Day"], "16")
03881         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Hour"], "10")
03882         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Minute"], "1")
03883         self.assertEqual(record[0]["PubmedData"]["PublicationStatus"], "ppublish")
03884         self.assertEqual(len(record[0]["PubmedData"]["ArticleIdList"]), 1)
03885         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0], "12091962")
03886         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
03887         self.assertEqual(record[1]["MedlineCitation"].attributes["Owner"], "NLM")
03888         self.assertEqual(record[1]["MedlineCitation"].attributes["Status"], "MEDLINE")
03889         self.assertEqual(record[1]["MedlineCitation"]["PMID"], "9997")
03890         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Year"], "1976")
03891         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Month"], "12")
03892         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Day"], "30")
03893         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Year"], "1976")
03894         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Month"], "12")
03895         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Day"], "30")
03896         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Year"], "2003")
03897         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Month"], "11")
03898         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Day"], "14")
03899         self.assertEqual(record[1]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
03900         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "0006-3002")
03901         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
03902         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
03903         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "446")
03904         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "1")
03905         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "1976")
03906         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Month"], "Sep")
03907         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Day"], "28")
03908         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["Title"], "Biochimica et biophysica acta")
03909         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISOAbbreviation"], "Biochim. Biophys. Acta")
03910         self.assertEqual(record[1]["MedlineCitation"]["Article"]["ArticleTitle"], "Magnetic studies of Chromatium flavocytochrome C552. A mechanism for heme-flavin interaction.")
03911         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "179-91")
03912         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Abstract"]["AbstractText"], "Electron paramagnetic resonance and magnetic susceptibility studies of Chromatium flavocytochrome C552 and its diheme flavin-free subunit at temperatures below 45 degrees K are reported. The results show that in the intact protein and the subunit the two low-spin (S = 1/2) heme irons are distinguishable, giving rise to separate EPR signals. In the intact protein only, one of the heme irons exists in two different low spin environments in the pH range 5.5 to 10.5, while the other remains in a constant environment. Factors influencing the variable heme iron environment also influence flavin reactivity, indicating the existence of a mechanism for heme-flavin interaction.")
03913         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], "Y")
03914         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
03915         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Strekas")
03916         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "T C")
03917         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "TC")
03918         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Language"], ["eng"])
03919         self.assertEqual(record[1]["MedlineCitation"]["Article"]["PublicationTypeList"], ["Journal Article"])
03920         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "NETHERLANDS")
03921         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Biochim Biophys Acta")
03922         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "0217513")
03923         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][0]["RegistryNumber"], "0")
03924         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][0]["NameOfSubstance"], "Cytochrome c Group")
03925         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][1]["RegistryNumber"], "0")
03926         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][1]["NameOfSubstance"], "Flavins")
03927         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][2]["RegistryNumber"], "14875-96-8")
03928         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][2]["NameOfSubstance"], "Heme")
03929         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][3]["RegistryNumber"], "7439-89-6")
03930         self.assertEqual(record[1]["MedlineCitation"]["ChemicalList"][3]["NameOfSubstance"], "Iron")
03931         self.assertEqual(record[1]["MedlineCitation"]["CitationSubset"], ["IM"])
03932         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "Binding Sites")
03933         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
03934         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Chromatium")
03935         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "N")
03936         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0], "enzymology")
03937         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
03938         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Cytochrome c Group")
03939         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "Y")
03940         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "Electron Spin Resonance Spectroscopy")
03941         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "N")
03942         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Flavins")
03943         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
03944         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Heme")
03945         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "N")
03946         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Hydrogen-Ion Concentration")
03947         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
03948         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Iron")
03949         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
03950         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0], "analysis")
03951         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0].attributes["MajorTopicYN"], "N")
03952         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Magnetics")
03953         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
03954         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Oxidation-Reduction")
03955         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "N")
03956         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Protein Binding")
03957         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
03958         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"], "Protein Conformation")
03959         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][11]["DescriptorName"].attributes["MajorTopicYN"], "N")
03960         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"], "Temperature")
03961         self.assertEqual(record[1]["MedlineCitation"]["MeshHeadingList"][12]["DescriptorName"].attributes["MajorTopicYN"], "N")
03962         self.assertEqual(record[1]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
03963         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Year"], "1976")
03964         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Month"], "9")
03965         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Day"], "28")
03966         self.assertEqual(record[1]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
03967         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Year"], "1976")
03968         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Month"], "9")
03969         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Day"], "28")
03970         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Hour"], "0")
03971         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Minute"], "1")
03972         self.assertEqual(record[1]["PubmedData"]["PublicationStatus"], "ppublish")
03973         self.assertEqual(len(record[1]["PubmedData"]["ArticleIdList"]), 1)
03974         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0], "9997")
03975         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
03976 

Here is the call graph for this function:

Test parsing XML returned by EFetch, PubMed database (second test)

Definition at line 3977 of file test_Entrez.py.

03977 
03978     def test_pubmed2(self):
03979         '''Test parsing XML returned by EFetch, PubMed database (second test)
03980         '''
03981         # In PubMed display PMIDs in xml retrieval mode.
03982         # To create the XML file, use
03983         # >>> Bio.Entrez.efetch(db='pubmed', id="11748933,11700088",
03984         #                       retmode="xml")
03985         handle = open('Entrez/pubmed2.xml', "rb")
03986         record = Entrez.read(handle)
03987         handle.close()
03988         self.assertEqual(record[0]["MedlineCitation"].attributes["Owner"], "NLM")
03989         self.assertEqual(record[0]["MedlineCitation"].attributes["Status"], "MEDLINE")
03990         self.assertEqual(record[0]["MedlineCitation"]["PMID"], "11748933")
03991         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Year"], "2001")
03992         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Month"], "12")
03993         self.assertEqual(record[0]["MedlineCitation"]["DateCreated"]["Day"], "25")
03994         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Year"], "2002")
03995         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Month"], "03")
03996         self.assertEqual(record[0]["MedlineCitation"]["DateCompleted"]["Day"], "04")
03997         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Year"], "2006")
03998         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Month"], "11")
03999         self.assertEqual(record[0]["MedlineCitation"]["DateRevised"]["Day"], "15")
04000         self.assertEqual(record[0]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
04001         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "0011-2240")
04002         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
04003         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
04004         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "42")
04005         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "4")
04006         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "2001")
04007         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Month"], "Jun")
04008         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["Title"], "Cryobiology")
04009         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Journal"]["ISOAbbreviation"], "Cryobiology")
04010         self.assertEqual(record[0]["MedlineCitation"]["Article"]["ArticleTitle"], "Is cryopreservation a homogeneous process? Ultrastructure and motility of untreated, prefreezing, and postthawed spermatozoa of Diplodus puntazzo (Cetti).")
04011         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "244-55")
04012         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Abstract"]["AbstractText"], "This study subdivides the cryopreservation procedure for Diplodus puntazzo spermatozoa into three key phases, fresh, prefreezing (samples equilibrated in cryosolutions), and postthawed stages, and examines the ultrastructural anomalies and motility profiles of spermatozoa in each stage, with different cryodiluents. Two simple cryosolutions were evaluated: 0.17 M sodium chloride containing a final concentration of 15% dimethyl sulfoxide (Me(2)SO) (cryosolution A) and 0.1 M sodium citrate containing a final concentration of 10% Me(2)SO (cryosolution B). Ultrastructural anomalies of the plasmatic and nuclear membranes of the sperm head were common and the severity of the cryoinjury differed significantly between the pre- and the postfreezing phases and between the two cryosolutions. In spermatozoa diluted with cryosolution A, during the prefreezing phase, the plasmalemma of 61% of the cells was absent or damaged compared with 24% in the fresh sample (P < 0.001). In spermatozoa diluted with cryosolution B, there was a pronounced increase in the number of cells lacking the head plasmatic membrane from the prefreezing to the postthawed stages (from 32 to 52%, P < 0.01). In both cryosolutions, damages to nuclear membrane were significantly higher after freezing (cryosolution A: 8 to 23%, P < 0.01; cryosolution B: 5 to 38%, P < 0.001). With cryosolution A, the after-activation motility profile confirmed a consistent drop from fresh at the prefreezing stage, whereas freezing and thawing did not affect the motility much further and 50% of the cells were immotile by 60-90 s after activation. With cryosolution B, only the postthawing stage showed a sharp drop of motility profile. This study suggests that the different phases of the cryoprocess should be investigated to better understand the process of sperm damage.")
04013         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Abstract"]["CopyrightInformation"], "Copyright 2001 Elsevier Science.")
04014         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Affiliation"], u'Dipartimento di Scienze Ambientali, Universit\xe0 degli Studi della Tuscia, 01100 Viterbo, Italy.')
04015         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], "Y")
04016         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
04017         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Taddei")
04018         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "A R")
04019         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "AR")
04020         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1].attributes["ValidYN"], "Y")
04021         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["LastName"], "Barbato")
04022         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["ForeName"], "F")
04023         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][1]["Initials"], "F")
04024         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2].attributes["ValidYN"], "Y")
04025         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["LastName"], "Abelli")
04026         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["ForeName"], "L")
04027         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][2]["Initials"], "L")
04028         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3].attributes["ValidYN"], "Y")
04029         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["LastName"], "Canese")
04030         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["ForeName"], "S")
04031         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][3]["Initials"], "S")
04032         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4].attributes["ValidYN"], "Y")
04033         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["LastName"], "Moretti")
04034         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["ForeName"], "F")
04035         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][4]["Initials"], "F")
04036         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5].attributes["ValidYN"], "Y")
04037         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["LastName"], "Rana")
04038         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["ForeName"], "K J")
04039         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][5]["Initials"], "KJ")
04040         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6].attributes["ValidYN"], "Y")
04041         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["LastName"], "Fausto")
04042         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["ForeName"], "A M")
04043         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][6]["Initials"], "AM")
04044         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7].attributes["ValidYN"], "Y")
04045         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["LastName"], "Mazzini")
04046         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["ForeName"], "M")
04047         self.assertEqual(record[0]["MedlineCitation"]["Article"]["AuthorList"][7]["Initials"], "M")
04048         self.assertEqual(record[0]["MedlineCitation"]["Article"]["Language"], ["eng"])
04049         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"][0], "Journal Article")
04050         self.assertEqual(record[0]["MedlineCitation"]["Article"]["PublicationTypeList"][1], "Research Support, Non-U.S. Gov't")
04051         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "United States")
04052         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "Cryobiology")
04053         self.assertEqual(record[0]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "0006252")
04054         self.assertEqual(record[0]["MedlineCitation"]["CitationSubset"], ["IM"])
04055         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"], "Animals")
04056         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][0]["DescriptorName"].attributes["MajorTopicYN"], "N")
04057         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"], "Cell Membrane")
04058         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["DescriptorName"].attributes["MajorTopicYN"], "N")
04059         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0], "ultrastructure")
04060         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][1]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04061         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"], "Cryopreservation")
04062         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["DescriptorName"].attributes["MajorTopicYN"], "N")
04063         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["QualifierName"][0], "methods")
04064         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][2]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
04065         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"], "Male")
04066         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][3]["DescriptorName"].attributes["MajorTopicYN"], "N")
04067         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"], "Microscopy, Electron")
04068         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][4]["DescriptorName"].attributes["MajorTopicYN"], "N")
04069         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"], "Microscopy, Electron, Scanning")
04070         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][5]["DescriptorName"].attributes["MajorTopicYN"], "N")
04071         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"], "Nuclear Envelope")
04072         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["DescriptorName"].attributes["MajorTopicYN"], "N")
04073         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["QualifierName"][0], "ultrastructure")
04074         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][6]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04075         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"], "Sea Bream")
04076         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["DescriptorName"].attributes["MajorTopicYN"], "N")
04077         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0], "anatomy & histology")
04078         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][0].attributes["MajorTopicYN"], "Y")
04079         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][1], "physiology")
04080         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][7]["QualifierName"][1].attributes["MajorTopicYN"], "N")
04081         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"], "Semen Preservation")
04082         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["DescriptorName"].attributes["MajorTopicYN"], "N")
04083         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][0], "adverse effects")
04084         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04085         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][1], "methods")
04086         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][8]["QualifierName"][1].attributes["MajorTopicYN"], "Y")
04087         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"], "Sperm Motility")
04088         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][9]["DescriptorName"].attributes["MajorTopicYN"], "Y")
04089         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"], "Spermatozoa")
04090         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["DescriptorName"].attributes["MajorTopicYN"], "N")
04091         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][0], "physiology")
04092         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][0].attributes["MajorTopicYN"], "N")
04093         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][1], "ultrastructure")
04094         self.assertEqual(record[0]["MedlineCitation"]["MeshHeadingList"][10]["QualifierName"][1].attributes["MajorTopicYN"], "Y")
04095         self.assertEqual(record[0]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
04096         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Year"], "2001")
04097         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Month"], "12")
04098         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Day"], "26")
04099         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Hour"], "10")
04100         self.assertEqual(record[0]["PubmedData"]["History"][0][0]["Minute"], "0")
04101         self.assertEqual(record[0]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
04102         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Year"], "2002")
04103         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Month"], "3")
04104         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Day"], "5")
04105         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Hour"], "10")
04106         self.assertEqual(record[0]["PubmedData"]["History"][0][1]["Minute"], "1")
04107         self.assertEqual(record[0]["PubmedData"]["PublicationStatus"], "ppublish")
04108         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0], "11748933")
04109         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
04110         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][1], "10.1006/cryo.2001.2328")
04111         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][1].attributes["IdType"], "doi")
04112         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][2], "S0011-2240(01)92328-4")
04113         self.assertEqual(record[0]["PubmedData"]["ArticleIdList"][2].attributes["IdType"], "pii")
04114 
04115         self.assertEqual(record[1]["MedlineCitation"].attributes["Owner"], "NLM")
04116         self.assertEqual(record[1]["MedlineCitation"].attributes["Status"], "PubMed-not-MEDLINE")
04117         self.assertEqual(record[1]["MedlineCitation"]["PMID"], "11700088")
04118         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Year"], "2001")
04119         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Month"], "11")
04120         self.assertEqual(record[1]["MedlineCitation"]["DateCreated"]["Day"], "08")
04121         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Year"], "2001")
04122         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Month"], "12")
04123         self.assertEqual(record[1]["MedlineCitation"]["DateCompleted"]["Day"], "20")
04124         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Year"], "2003")
04125         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Month"], "10")
04126         self.assertEqual(record[1]["MedlineCitation"]["DateRevised"]["Day"], "31")
04127         self.assertEqual(record[1]["MedlineCitation"]["Article"].attributes["PubModel"], "Print")
04128         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"], "1090-7807")
04129         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISSN"].attributes["IssnType"], "Print")
04130         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"].attributes["CitedMedium"], "Print")
04131         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Volume"], "153")
04132         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["Issue"], "1")
04133         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Year"], "2001")
04134         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["JournalIssue"]["PubDate"]["Month"], "Nov")
04135         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["Title"], "Journal of magnetic resonance (San Diego, Calif. : 1997)")
04136         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Journal"]["ISOAbbreviation"], "J. Magn. Reson.")
04137         self.assertEqual(record[1]["MedlineCitation"]["Article"]["ArticleTitle"], "Proton MRI of (13)C distribution by J and chemical shift editing.")
04138         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Pagination"]["MedlinePgn"], "117-23")
04139         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Abstract"]["AbstractText"], "The sensitivity of (13)C NMR imaging can be considerably favored by detecting the (1)H nuclei bound to (13)C nuclei via scalar J-interaction (X-filter). However, the J-editing approaches have difficulty in discriminating between compounds with similar J-constant as, for example, different glucose metabolites. In such cases, it is almost impossible to get J-edited images of a single-compound distribution, since the various molecules are distinguishable only via their chemical shift. In a recent application of J-editing to high-resolution spectroscopy, it has been shown that a more efficient chemical selectivity could be obtained by utilizing the larger chemical shift range of (13)C. This has been made by introducing frequency-selective (13)C pulses that allow a great capability of indirect chemical separation. Here a double-resonance imaging approach is proposed, based on both J-editing and (13)C chemical shift editing, which achieves a powerful chemical selectivity and is able to produce full maps of specific chemical compounds. Results are presented on a multicompartments sample containing solutions of glucose and lactic and glutamic acid in water.")
04140         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Abstract"]["CopyrightInformation"], "Copyright 2001 Academic Press.")
04141         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Affiliation"], "INFM and Department of Physics, University of L'Aquila, I-67100 L'Aquila, Italy.")
04142         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"].attributes["CompleteYN"], "Y")
04143         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0].attributes["ValidYN"], "Y")
04144         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["LastName"], "Casieri")
04145         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["ForeName"], "C")
04146         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][0]["Initials"], "C")
04147         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][1].attributes["ValidYN"], "Y")
04148         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][1]["LastName"], "Testa")
04149         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][1]["ForeName"], "C")
04150         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][1]["Initials"], "C")
04151         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][2].attributes["ValidYN"], "Y")
04152         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][2]["LastName"], "Carpinelli")
04153         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][2]["ForeName"], "G")
04154         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][2]["Initials"], "G")
04155         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][3].attributes["ValidYN"], "Y")
04156         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][3]["LastName"], "Canese")
04157         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][3]["ForeName"], "R")
04158         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][3]["Initials"], "R")
04159         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][4].attributes["ValidYN"], "Y")
04160         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][4]["LastName"], "Podo")
04161         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][4]["ForeName"], "F")
04162         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][4]["Initials"], "F")
04163         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][5].attributes["ValidYN"], "Y")
04164         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][5]["LastName"], "De Luca")
04165         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][5]["ForeName"], "F")
04166         self.assertEqual(record[1]["MedlineCitation"]["Article"]["AuthorList"][5]["Initials"], "F")
04167         self.assertEqual(record[1]["MedlineCitation"]["Article"]["Language"], ["eng"])
04168         self.assertEqual(record[1]["MedlineCitation"]["Article"]["PublicationTypeList"][0], "Journal Article")
04169         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["Country"], "United States")
04170         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["MedlineTA"], "J Magn Reson")
04171         self.assertEqual(record[1]["MedlineCitation"]["MedlineJournalInfo"]["NlmUniqueID"], "9707935")
04172         self.assertEqual(record[1]["PubmedData"]["History"][0][0].attributes["PubStatus"], "pubmed")
04173         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Year"], "2001")
04174         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Month"], "11")
04175         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Day"], "9")
04176         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Hour"], "10")
04177         self.assertEqual(record[1]["PubmedData"]["History"][0][0]["Minute"], "0")
04178         self.assertEqual(record[1]["PubmedData"]["History"][0][1].attributes["PubStatus"], "medline")
04179         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Year"], "2001")
04180         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Month"], "11")
04181         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Day"], "9")
04182         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Hour"], "10")
04183         self.assertEqual(record[1]["PubmedData"]["History"][0][1]["Minute"], "1")
04184         self.assertEqual(record[1]["PubmedData"]["PublicationStatus"], "ppublish")
04185         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0], "11700088")
04186         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][0].attributes["IdType"], "pubmed")
04187         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][1], "10.1006/jmre.2001.2429")
04188         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][1].attributes["IdType"], "doi")
04189         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][2], "S1090-7807(01)92429-2")
04190         self.assertEqual(record[1]["PubmedData"]["ArticleIdList"][2].attributes["IdType"], "pii")

Here is the call graph for this function:

Test error handling when presented with HTML (so XML-like) data

Definition at line 4750 of file test_Entrez.py.

04750 
04751     def test_pubmed_html(self):
04752         '''Test error handling when presented with HTML (so XML-like) data
04753         '''
04754         # To create the HTML file, use
04755         # >>> Bio.Entrez.efetch(db="pubmed", id="19304878")
04756         from Bio.Entrez import Parser
04757         handle = open('Entrez/pubmed3.html', "rb")
04758         self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
04759         handle.close()
04760         # Test if the error is also raised with Entrez.parse
04761         handle = open('Entrez/pubmed3.html', "rb")
04762         records = Entrez.parse(handle)
04763         self.assertRaises(Parser.NotXMLError, records.next)
04764         handle.close()

Here is the call graph for this function:

Test parsing XML returned by EFetch, Taxonomy database

Definition at line 4369 of file test_Entrez.py.

04369 
04370     def test_taxonomy(self):
04371         '''Test parsing XML returned by EFetch, Taxonomy database
04372         '''
04373         # Access the Taxonomy database using efetch.
04374         # To create the XML file, use
04375         # >>> Bio.Entrez.efetch(db="taxonomy", id="9685", retmode="xml")
04376         handle = open('Entrez/taxonomy.xml', "rb")
04377         record = Entrez.read(handle)
04378         handle.close()
04379         self.assertEqual(len(record), 1)
04380         self.assertEqual(record[0]["TaxId"], "9685")
04381         self.assertEqual(record[0]["ScientificName"], "Felis catus")
04382         self.assertEqual(record[0]["OtherNames"]["GenbankCommonName"], "domestic cat")
04383         self.assertEqual(record[0]["OtherNames"]["Synonym"][0], "Felis silvestris catus")
04384         self.assertEqual(record[0]["OtherNames"]["Synonym"][1], "Felis domesticus")
04385         self.assertEqual(record[0]["OtherNames"]["CommonName"][0], "cat")
04386         self.assertEqual(record[0]["OtherNames"]["CommonName"][1], "cats")
04387         self.assertEqual(record[0]["OtherNames"]["Includes"][0], "Korat cats")
04388         self.assertEqual(record[0]["ParentTaxId"], "9682")
04389         self.assertEqual(record[0]["Rank"], "species")
04390         self.assertEqual(record[0]["Division"], "Mammals")
04391         self.assertEqual(record[0]["GeneticCode"]["GCId"], "1")
04392         self.assertEqual(record[0]["GeneticCode"]["GCName"], "Standard")
04393         self.assertEqual(record[0]["MitoGeneticCode"]["MGCId"], "2")
04394         self.assertEqual(record[0]["MitoGeneticCode"]["MGCName"], "Vertebrate Mitochondrial")
04395         self.assertEqual(record[0]["Lineage"], "cellular organisms; Eukaryota; Fungi/Metazoa group; Metazoa; Eumetazoa; Bilateria; Coelomata; Deuterostomia; Chordata; Craniata; Vertebrata; Gnathostomata; Teleostomi; Euteleostomi; Sarcopterygii; Tetrapoda; Amniota; Mammalia; Theria; Eutheria; Laurasiatheria; Carnivora; Feliformia; Felidae; Felinae; Felis")
04396 
04397         self.assertEqual(record[0]["LineageEx"][0]["TaxId"], "131567")
04398         self.assertEqual(record[0]["LineageEx"][0]["ScientificName"], "cellular organisms")
04399         self.assertEqual(record[0]["LineageEx"][0]["Rank"], "no rank")
04400         self.assertEqual(record[0]["LineageEx"][1]["TaxId"], "2759")
04401         self.assertEqual(record[0]["LineageEx"][1]["ScientificName"], "Eukaryota")
04402         self.assertEqual(record[0]["LineageEx"][1]["Rank"], "superkingdom")
04403         self.assertEqual(record[0]["LineageEx"][2]["TaxId"], "33154")
04404         self.assertEqual(record[0]["LineageEx"][2]["ScientificName"], "Fungi/Metazoa group")
04405         self.assertEqual(record[0]["LineageEx"][2]["Rank"], "no rank")
04406         self.assertEqual(record[0]["LineageEx"][3]["TaxId"], "33208")
04407         self.assertEqual(record[0]["LineageEx"][3]["ScientificName"], "Metazoa")
04408         self.assertEqual(record[0]["LineageEx"][3]["Rank"], "kingdom")
04409         self.assertEqual(record[0]["LineageEx"][4]["TaxId"], "6072")
04410         self.assertEqual(record[0]["LineageEx"][4]["ScientificName"], "Eumetazoa")
04411         self.assertEqual(record[0]["LineageEx"][4]["Rank"], "no rank")
04412         self.assertEqual(record[0]["LineageEx"][5]["TaxId"], "33213")
04413         self.assertEqual(record[0]["LineageEx"][5]["ScientificName"], "Bilateria")
04414         self.assertEqual(record[0]["LineageEx"][5]["Rank"], "no rank")
04415         self.assertEqual(record[0]["LineageEx"][6]["TaxId"], "33316")
04416         self.assertEqual(record[0]["LineageEx"][6]["ScientificName"], "Coelomata")
04417         self.assertEqual(record[0]["LineageEx"][6]["Rank"], "no rank")
04418         self.assertEqual(record[0]["LineageEx"][7]["TaxId"], "33511")
04419         self.assertEqual(record[0]["LineageEx"][7]["ScientificName"], "Deuterostomia")
04420         self.assertEqual(record[0]["LineageEx"][7]["Rank"], "no rank")
04421         self.assertEqual(record[0]["LineageEx"][8]["TaxId"], "7711")
04422         self.assertEqual(record[0]["LineageEx"][8]["ScientificName"], "Chordata")
04423         self.assertEqual(record[0]["LineageEx"][8]["Rank"], "phylum")
04424         self.assertEqual(record[0]["LineageEx"][9]["TaxId"], "89593")
04425         self.assertEqual(record[0]["LineageEx"][9]["ScientificName"], "Craniata")
04426         self.assertEqual(record[0]["LineageEx"][9]["Rank"], "subphylum")
04427         self.assertEqual(record[0]["LineageEx"][10]["TaxId"], "7742")
04428         self.assertEqual(record[0]["LineageEx"][10]["ScientificName"], "Vertebrata")
04429         self.assertEqual(record[0]["LineageEx"][10]["Rank"], "no rank")
04430         self.assertEqual(record[0]["LineageEx"][11]["TaxId"], "7776")
04431         self.assertEqual(record[0]["LineageEx"][11]["ScientificName"], "Gnathostomata")
04432         self.assertEqual(record[0]["LineageEx"][11]["Rank"], "superclass")
04433         self.assertEqual(record[0]["LineageEx"][12]["TaxId"], "117570")
04434         self.assertEqual(record[0]["LineageEx"][12]["ScientificName"], "Teleostomi")
04435         self.assertEqual(record[0]["LineageEx"][12]["Rank"], "no rank")
04436         self.assertEqual(record[0]["LineageEx"][13]["TaxId"], "117571")
04437         self.assertEqual(record[0]["LineageEx"][13]["ScientificName"], "Euteleostomi")
04438         self.assertEqual(record[0]["LineageEx"][13]["Rank"], "no rank")
04439         self.assertEqual(record[0]["LineageEx"][14]["TaxId"], "8287")
04440         self.assertEqual(record[0]["LineageEx"][14]["ScientificName"], "Sarcopterygii")
04441         self.assertEqual(record[0]["LineageEx"][14]["Rank"], "no rank")
04442         self.assertEqual(record[0]["LineageEx"][15]["TaxId"], "32523")
04443         self.assertEqual(record[0]["LineageEx"][15]["ScientificName"], "Tetrapoda")
04444         self.assertEqual(record[0]["LineageEx"][15]["Rank"], "no rank")
04445         self.assertEqual(record[0]["LineageEx"][16]["TaxId"], "32524")
04446         self.assertEqual(record[0]["LineageEx"][16]["ScientificName"], "Amniota")
04447         self.assertEqual(record[0]["LineageEx"][16]["Rank"], "no rank")
04448         self.assertEqual(record[0]["LineageEx"][17]["TaxId"], "40674")
04449         self.assertEqual(record[0]["LineageEx"][17]["ScientificName"], "Mammalia")
04450         self.assertEqual(record[0]["LineageEx"][17]["Rank"], "class")
04451         self.assertEqual(record[0]["LineageEx"][18]["TaxId"], "32525")
04452         self.assertEqual(record[0]["LineageEx"][18]["ScientificName"], "Theria")
04453         self.assertEqual(record[0]["LineageEx"][18]["Rank"], "no rank")
04454         self.assertEqual(record[0]["LineageEx"][19]["TaxId"], "9347")
04455         self.assertEqual(record[0]["LineageEx"][19]["ScientificName"], "Eutheria")
04456         self.assertEqual(record[0]["LineageEx"][19]["Rank"], "no rank")
04457         self.assertEqual(record[0]["LineageEx"][20]["TaxId"], "314145")
04458         self.assertEqual(record[0]["LineageEx"][20]["ScientificName"], "Laurasiatheria")
04459         self.assertEqual(record[0]["LineageEx"][20]["Rank"], "superorder")
04460         self.assertEqual(record[0]["LineageEx"][21]["TaxId"], "33554")
04461         self.assertEqual(record[0]["LineageEx"][21]["ScientificName"], "Carnivora")
04462         self.assertEqual(record[0]["LineageEx"][21]["Rank"], "order")
04463         self.assertEqual(record[0]["LineageEx"][22]["TaxId"], "379583")
04464         self.assertEqual(record[0]["LineageEx"][22]["ScientificName"], "Feliformia")
04465         self.assertEqual(record[0]["LineageEx"][22]["Rank"], "suborder")
04466         self.assertEqual(record[0]["LineageEx"][23]["TaxId"], "9681")
04467         self.assertEqual(record[0]["LineageEx"][23]["ScientificName"], "Felidae")
04468         self.assertEqual(record[0]["LineageEx"][23]["Rank"], "family")
04469         self.assertEqual(record[0]["LineageEx"][24]["TaxId"], "338152")
04470         self.assertEqual(record[0]["LineageEx"][24]["ScientificName"], "Felinae")
04471         self.assertEqual(record[0]["LineageEx"][24]["Rank"], "subfamily")
04472         self.assertEqual(record[0]["LineageEx"][25]["TaxId"], "9682")
04473         self.assertEqual(record[0]["LineageEx"][25]["ScientificName"], "Felis")
04474         self.assertEqual(record[0]["LineageEx"][25]["Rank"], "genus")
04475         self.assertEqual(record[0]["CreateDate"], "1995/02/27")
04476         self.assertEqual(record[0]["UpdateDate"], "2007/09/04")
04477         self.assertEqual(record[0]["PubDate"], "1993/07/26")

Here is the call graph for this function:

Test error handling for a missing XML declaration

Definition at line 4765 of file test_Entrez.py.

04765 
04766     def test_xml_without_declaration(self):
04767         '''Test error handling for a missing XML declaration
04768         '''
04769         # To create the XML file, use
04770         # >>> Bio.Entrez.efetch(db="journals",id="2830,6011,7473",retmode='xml')
04771         from Bio.Entrez import Parser
04772         handle = open('Entrez/journals.xml', "rb")
04773         self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
04774         handle.close()
04775         # Test if the error is also raised with Entrez.parse
04776         handle = open('Entrez/journals.xml', "rb")
04777         records = Entrez.parse(handle)
04778         self.assertRaises(Parser.NotXMLError, records.next)
04779         handle.close()
04780 

Here is the call graph for this function:


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