Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(13)  |  Call(0)  |  Derive(0)  |  Import(13)

src/g/e/Geeneus-0.1.7/geeneus/backend/ProteinParser.py   Geeneus(Download)
 
# Biopython selective imports
import Bio.Entrez.Parser
from Bio import Entrez
from Bio.Seq import Seq

src/b/i/biopython-HEAD/Tests/test_Entrez.py   biopython(Download)
        # Starting some time in 2010, the results returned by Bio.Entrez
        # included some tags that are not part of the corresponding DTD.
        from Bio.Entrez import Parser
        handle = open('Entrez/einfo3.xml', "rb")
        self.assertRaises(Parser.ValidationError, Entrez.read, handle)
        # >>> Bio.Entrez.einfo()
        # and manually delete the last couple of lines
        from Bio.Entrez import Parser
        handle = open('Entrez/einfo4.xml', "rb")
        self.assertRaises(Parser.CorruptedXMLError, Entrez.read, handle)
        # To create the GenBank file, use
        # >>> Bio.Entrez.efetch(db='nucleotide', id='NT_019265', rettype='gb')
        from Bio.Entrez import Parser
        handle = open('GenBank/NT_019265.gb', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
    def test_fasta(self):
        '''Test error handling when presented with Fasta non-XML data
        '''
        from Bio.Entrez import Parser
        handle = open('Fasta/wisteria.nu', "rb")
        # To create the HTML file, use
        # >>> Bio.Entrez.efetch(db="pubmed", id="19304878")
        from Bio.Entrez import Parser
        handle = open('Entrez/pubmed3.html', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)

src/b/i/biopython-1.63/Tests/test_Entrez.py   biopython(Download)
        # Starting some time in 2010, the results returned by Bio.Entrez
        # included some tags that are not part of the corresponding DTD.
        from Bio.Entrez import Parser
        handle = open('Entrez/einfo3.xml', "rb")
        self.assertRaises(Parser.ValidationError, Entrez.read, handle)
        # >>> Bio.Entrez.einfo()
        # and manually delete the last couple of lines
        from Bio.Entrez import Parser
        handle = open('Entrez/einfo4.xml', "rb")
        self.assertRaises(Parser.CorruptedXMLError, Entrez.read, handle)
        # To create the GenBank file, use
        # >>> Bio.Entrez.efetch(db='nucleotide', id='NT_019265', rettype='gb')
        from Bio.Entrez import Parser
        handle = open('GenBank/NT_019265.gb', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)
    def test_fasta(self):
        '''Test error handling when presented with Fasta non-XML data
        '''
        from Bio.Entrez import Parser
        handle = open('Fasta/wisteria.nu', "rb")
        # To create the HTML file, use
        # >>> Bio.Entrez.efetch(db="pubmed", id="19304878")
        from Bio.Entrez import Parser
        handle = open('Entrez/pubmed3.html', "rb")
        self.assertRaises(Parser.NotXMLError, Entrez.read, handle)