[BioPython] Re: BioPython Digest, Vol 26, Issue 3

Sameet Mehta sameet at nccs.res.in
Thu Feb 17 03:01:02 EST 2005


Dear all,

I wanted to ask if there are MAST and MEME Output parser(s) avilable in python, and where can those be found.

regards

sameet

--
National Centre for Cell Science, Pune

---------- Original Message -----------
From: biopython-request at portal.open-bio.org
To: biopython at biopython.org
Sent: Wed, 16 Feb 2005 18:46:52 -0500
Subject: BioPython Digest, Vol 26, Issue 3

> Send BioPython mailing list submissions to
>     biopython at biopython.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://biopython.org/mailman/listinfo/biopython
> or, via email, send a message with subject or body 'help' to
>     biopython-request at biopython.org
>
> You can reach the person managing the list at
>     biopython-owner at biopython.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of BioPython digest..."
>
> Today's Topics:
>
>   1. Re: Installing Biopython (Emmanuel Talla)
>   2. BLAST Parser query  (kumar s)
>   3. Re: BLAST Parser query (Peter)
>   4. WWW Blast (Eirik S?nneland)
>   5. Re: [Biopython-dev] [Fwd: Question to code] (Frank Kauff)
>   6. Re: [Biopython-dev] [Fwd: Question to code] (Iddo Friedberg)
>   7. Re: [Biopython-dev] [Fwd: Question to code] (Iddo Friedberg)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 14 Feb 2005 17:44:59 +0100
> From: Emmanuel Talla <talla at ibsm.cnrs-mrs.fr>
> Subject: Re: [BioPython] Installing Biopython
> To: biopython at biopython.org
> Message-ID: <5.0.2.1.2.20050214162630.00a9c790 at ibsm.cnrs-mrs.fr>
> Content-Type: text/plain; charset="iso-8859-1"; format=flowed
>
> Thanks !!!!!
>
> Python-devel was installed and egenix-mx-base  as well as Numeric tools
> 23.4 were installed  correctly.
>
> Thanks again for your help!!!!
>
> Manu
>
> A 14:44 14/02/2005 +0100, Frederic Sohm a écrit :
> >Hi,
> >
> >You certainly do not have installed the python-devel package.
> >Mandrake keep the python header files in this package.
> >
> >Try this before installing :
> >
> >$ urpmi python-devel
> >
> >This will install the header files needed for the compilation.
> >Then you can start again the installation has you did before.
> >
> >Fred
>
> >On Monday 14 February 2005 14:37, Emmanuel Talla wrote:
> > > Dear all,
> > >
> > > I have tryed to install biopython and dependencies (Numeric and mxText
> > > modules), following the installation instructions:
> > >
> > > ==================
> > > 3.1.1 UNIX and Mac OS X systems
> > > For UNIX and UNIX-like systems you should download the tar.gz file from the
> > > page listed above. At the current time, this is
> > > egenix-mx-base-2.0.4.tar.gz.
> > >
> > > Once you download this, unpack it and change into the created directory:
> > > $ gunzip egenix-mx-base-2.0.4.tar.gz
> > > $ tar -xvpf egenix-mx-base-2.0.4.tar
> > > $ cd egenix-mx-base-2.0.4
> > > To build it, use the standard python build procedure:
> > > $ python setup.py build
> > > Then become root, and install it, again using the standard python
> > > mechanism: # python setup.py install
> > > ====================
> > >
> > > In the "python setup.py build" step, il have this message:
> > >
> > > error: Invalid Python installation: Unable to open
> > > /usr/lib/python2.3/config/Makefile (no such file or directory)
> > >
> > >
> > >
> > > That right, I checked myself and there is no such file related to python on
> > > my disk.
> > > OS is Mandrake 10.1.
> > > Python 2.3 version (obtained from the Mandrake package)
> > >
> > >
> > > Any help would be appreciated
> > >
> > > Manu
> > > _______________________________________________
> > > BioPython mailing list  -  BioPython at biopython.org
> > > http://biopython.org/mailman/listinfo/biopython
> >
> >--
> >Frédéric Sohm
> >Equipe INRA U1126 "Morphogenèse du système nerveux des Chordés"
> >UPR 2197 DEPSN, CNRS
> >Institut de Neurosciences A. Fessard
> >1 Avenue de la Terrasse
> >91 198 GIF-SUR-YVETTE
> >FRANCE
> >Phone: +33 (0) 1 69 82 34 12
> >Fax:+33 (0) 1 69 82 34 47
>
> ------------------------------
>
> Message: 2
> Date: Mon, 14 Feb 2005 12:28:01 -0800 (PST)
> From: kumar s <ps_python at yahoo.com>
> Subject: [BioPython] BLAST Parser query
> To: biopython at biopython.org
> Message-ID: <20050214202801.10354.qmail at web53702.mail.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi group,
>
> I used standalone BLAST to align my sequences to
> RefSeq database.
>
> I followed the sample code given in the cookbook.
>
> Here is my code:
>
> from string import split
> from Bio.Blast import NCBIStandalone
> b_out = open('xxx_blast.out','r')
> b_parser = NCBIStandalone.BlastParser()
> b_iterator = NCBIStandalone.Iterator(b_out,b_parser)
> b_record = b_iterator.next()
> while 1:
>    b_record = b_iterator.next()
>
>    if b_record is None:
>        break
>
>    E_VALUE_THRESH = 0.4
>    for alignment in b_record.alignments:
>         for que in b_record.query:
>           for hsp in alignment.hsps:
>          if hsp.expect < E_VALUE_THRESH:
>                   print '****Alignment****'
>          print 'sequence:', alignment.title
>     print 'length:', alignment.length
>     print 'e value:', hsp.expectprint
>     print alignment.query
>
> I want to print my query along with my
> alignment.title, because I am blasting 1000 sequences
> against RefSeq and I want to know what the query.
>
> After gawking the class diagram for 40 min.
> I tried this:
>
> while 1:
>    b_record = b_iterator.next()
>
>    if b_record is None:
>        break
>
>    E_VALUE_THRESH = 0.4
>    for alignment in b_record.alignments:
>     for que in b_record.query:
>        for hsp in alignment.hsps:
>            if hsp.expect < E_VALUE_THRESH:
>          print '****Alignment****'
>          print 'sequence:', alignment.title
>          print 'length:', alignment.length
>          print 'e value:', hsp.expectprint
>          print b_record.query
>
> Considering b_record object will have the query
> attribute, I incorported in here. It fails.
> Can any one please help printing the query for each
> alignment.
>
> Thank you
>
> K
>
>          
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
>
> ------------------------------
>
> Message: 3
> Date: Mon, 14 Feb 2005 21:22:26 +0000
> From: Peter <biopython at maubp.freeserve.co.uk>
> Subject: Re: [BioPython] BLAST Parser query
> To: biopython at biopython.org
> Message-ID: <42111692.1060505 at maubp.freeserve.co.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> kumar s wrote:
> > Hi group,
>
> Hello!
>
> > I used standalone BLAST to align my sequences to
> > RefSeq database.
> >
> > I followed the sample code given in the cookbook.
> >
> > Here is my code:
>
> (code removed)
>
> I would suggest "while True" rather than "while 1" to take advantage
> of the definition of these booleans in Python 2.3, but that is a
> style point.
>
> You also call b_iterator.next() twice at the start of the program
> (once outside the loop, once on the first time through the loop) so
> you will waste/ignore the first result.
>
> i.e. You should comment out the line "b_record = b_iterator.next()"
> before the while loop.
>
> > I want to print my query along with my
> > alignment.title, because I am blasting 1000 sequences
> > against RefSeq and I want to know what the query.
>
> I assume you are blasting with an input FASTA file with 1000
> sequences it it.
>
> When you say "query" what do you mean?  I can think of three answers:
>
> (a) The name of the original query:
>
> b_record.query
>
> (b) The ENTIRE original query (i.e. a complete sequence of
> nucleotides or amino acids) is not included in the blast output
> (look inside your file 'xxx_blast.out').
>
> You will have to use the query name (i.e. b_record.query) to work
> this out, for example by searching your FASTA input file.
>
> (c) The FRAGMENT of the original query (i.e. a sequence of
> nucleotides or amino acids) that was matched to the Blast database
> is available, as:
>
> hsp.query.replace('-','')
>
> Here hsp.query gives the string including gap characters '-' to show
> how this fragment of the query string aligns with the database match
> (see also the hsp.match and hsp.sbjct properties).
>
> Doing hsp.query.replace('-','') gives the fragment of the query
> string without the gap characters.
>
> e.g.
>
> from Bio.Blast import NCBIStandalone
> b_out = open('xxx_blast.out','r')
> b_parser = NCBIStandalone.BlastParser()
> b_iterator = NCBIStandalone.Iterator(b_out,b_parser)
>
> #Do use the following line, as you end up calling
> #next twice and never look at the first result!
> #b_record = b_iterator.next()
>
> #You only need to define the threshold once
> E_VALUE_THRESH = 0.4
>
> while True:
>     b_record = b_iterator.next()
>
>     if b_record is None:
>         break
>
>     print "The following results are for query " + b_record.query
>
>     for alignment in b_record.alignments:
>         for que in b_record.query:
>             for hsp in alignment.hsps:
>                 if hsp.expect < E_VALUE_THRESH:
>                     print '****Alignment****'
>                     print 'title:', alignment.title
>                     print 'length:', alignment.length
>                     print 'e value:', hsp.expect
>                     print 'fragment of query matched:'
>                     print hsp.query.replace('-','')
>
> I hope the indentation survives being emailed!
>
> Peter
>
> ------------------------------
>
> Message: 4
> Date: Tue, 15 Feb 2005 10:47:38 +0100
> From: Eirik S?nneland <eirik.sonneland at student.umb.no>
> Subject: [BioPython] WWW Blast
> To: biopython at portal.open-bio.org
> Message-ID: <4211C53A.9030903 at student.umb.no>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I am new to biopython and trying to implement the BLAST example in the
> Cookbook(WWW Blast and parsing results). Can't figure out the error
> message(my code and error message attached). Is there anyone who knows
> how to solve this/what is wrong in the cookbook?
>
> Code:
>
> from Bio import Fasta
>
> file_for_blast = open('Fastaformat.txt', 'r')
> f_iterator = Fasta.Iterator(file_for_blast)
>
> f_record = f_iterator.next()
>
> from Bio.Blast import NCBIWWW
> b_results = NCBIWWW.blast('blastn', 'nr', f_record)
>
> ## save the results for later
>
> save_file = open('my_blast.txt', 'w')
> blast_results =b_results.read()
> save_file.write(blast_results)
> save_file.close()
>
> import cStringIO
> string_result_handle = cStringIO.StringIO(blast_results)
>
> blast_results = open('my_blast.txt', 'r')
>
> b_parser = NCBIWWW.BlastParser()
>
> b_record = b_parser.parse(string_result_handle)
>
> this gives the error message:
>
> Traceback (most recent call last):
>  File "C:\Python24\MyWorkspace.py", line 51, in -toplevel-
>    b_record = b_parser.parse(string_result_handle)
>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in
> parse
>    self._scanner.feed(handle, self._consumer)
>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 96, in
> feed
>    has_re=re.compile(r'<b>.?BLAST'))
>  File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 335,
> in read_and_call_until
>    line = safe_readline(uhandle)
>  File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 411,
> in safe_readline
>    raise SyntaxError, "Unexpected end of stream."
> SyntaxError: Unexpected end of stream.
>
> Advice will be higly appreciated!
> Cheers,
> Eirik
>
> ------------------------------
>
> Message: 5
> Date: Wed, 16 Feb 2005 17:23:32 -0500
> From: Frank Kauff <fkauff at duke.edu>
> Subject: [BioPython] Re: [Biopython-dev] [Fwd: Question to code]
> To: biopython-dev at biopython.org, biopython at biopython.org
> Message-ID: <1108592612.5091.32.camel at osiris.biology.duke.edu>
> Content-Type: text/plain; charset=UTF-8
>
> Eirik,
>
> Try if the code works with
>
> b_results = NCBIWWW.qblast('blastn', 'nr', f_record).read()
>
> instead of
>
> > b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >
>
> I think that issue appeared a couple of months ago on the biopython list, essentially saying that
> qblast is the blast NCBI wants people to use for blast scripts? After that, qblast method was added
> to NCBIWWW, and it's what I'm using in my blast scripts.
>
> Hope this helps,
> Frank
>
> On Wed, 2005-02-16 at 14:02 -0800, Iddo Friedberg wrote:
> > OK, this is a real bug. NCBIWWW seems to be broken.
> >
> > I'm having a looksee, but I'd like someone more versed in this than me
> > to do so.
> >
> > Thanks,
> >
> > Iddo
> >
> >
> >
> > -------- Original Message --------
> > Subject:     Question to code
> > Date:     Wed, 16 Feb 2005 15:19:57 +0100
> > From:     Eirik Sønneland <eirik.sonneland at student.umb.no>
> > To:     idoerg
> >
> >
> >
> > Dear Freidberg,
> >
> > I've been having problems parsing my output from NCBI using the example
> > code given in Biopython Cookbook. Therefore I tried to follow your code
> > described in "Genome Informatics 14(2003). Still I get an error message
> > connected to the parsing. Could you please give a hint on what is wrong?
> > Is this a bug?? Code and output as follows:
> >
> > Code:
> >
> > from Bio.Blast import NCBIWWW
> > from Bio import Fasta
> >
> > file_for_blast = open('Fastaformat.txt', 'r')
> > f_iterator = Fasta.Iterator(file_for_blast)
> > f_record = f_iterator.next()
> >
> > b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >
> > b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >
> > Output(Have cut out the beginning, only pasted the last part of output):
> >
> >
> >  Score = 40.1 bits (20), Expect = 6.3
> >  Identities = 20/20 (100%)
> >  Strand = Plus / Minus
> >
> >                                  
> > Query: 29     ctgcagctcgggctcctgcc 48
> >               ||||||||||||||||||||
> > Sbjct: 150928 ctgcagctcgggctcctgcc 150909
> > </PRE>
> >
> >
> > <form>
> >
> > <PRE>
> > Lambda     K      H
> >     1.37    0.711     1.31
> >
> > Gapped
> > Lambda     K      H
> >     1.37    0.711     1.31
> >
> > Matrix: blastn matrix:1 -3
> > Gap Penalties: Existence: 5, Extension: 2
> > Number of Sequences: 2894376
> > Number of Hits to DB: 6,089,259
> > Number of extensions: 328661
> > Number of successful extensions: 6259
> > Number of sequences better than 10.0: 2
> > Number of HSP's better than 10.0 without gapping: 2
> > Number of HSP's gapped: 6259
> > Number of HSP's successfully gapped: 2
> > Number of extra gapped extensions for HSPs above 10.0: 6255
> > Length of query: 600
> > Length of database: 13,294,103,689
> > Length adjustment: 22
> > Effective length of query: 578
> > Effective length of database: 13,230,427,417
> > Effective search space: 7647187047026
> > Effective search space used: 7647187047026
> > A: 0
> > X1: 11 (21.8 bits)
> > X2: 15 (30.0 bits)
> > X3: 25 (50.0 bits)
> > S1: 14 (25.0 bits)
> > S2: 20 (40.1 bits)
> >
> >
> > </form>
> >
> > Traceback (most recent call last):
> >   File "C:\Python24\MyWorkspace.py", line 50, in -toplevel-
> >     b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >   File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 52, in
> > parse_str
> >     return self.parse(File.StringHandle(string))
> >   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in
> > parse
> >     self._scanner.feed(handle, self._consumer)
> >   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 99, in
> > feed
> >     self._scan_rounds(uhandle, consumer)
> >   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 242,
> > in _scan_rounds
> >     self._scan_alignments(uhandle, consumer)
> >   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 322,
> > in _scan_alignments
> >     raise SyntaxError, "Cannot resolve location at line:\n%s" % line1
> > SyntaxError: Cannot resolve location at line:
> > </form>
> >
> >  >>>
> >
> > Thanks!
> >
> > Regards,
> > Eirik
> >
> >
> --
> Frank Kauff
> Dept. of Biology
> Duke University
> Box 90338
> Durham, NC 27708
> USA
>
> Phone 919-660-7382
> Fax 919-660-7293
> Web http://www.lutzonilab.net/member/frankkauff.shtml
>
> ------------------------------
>
> Message: 6
> Date: Wed, 16 Feb 2005 14:34:17 -0800
> From: Iddo Friedberg <idoerg at burnham.org>
> Subject: [BioPython] Re: [Biopython-dev] [Fwd: Question to code]
> To: Frank Kauff <fkauff at duke.edu>
> Cc: biopython-dev at biopython.org, biopython at biopython.org
> Message-ID: <4213CA69.5020105 at burnham.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> I tried qblast with blastp, didn't work.
>
> Didn't try with blastn, though, but that's moot.
>
> Cheers,
>
> ./I
>
> Frank Kauff wrote:
>
> >Eirik,
> >
> >Try if the code works with
> >
> >b_results = NCBIWWW.qblast('blastn', 'nr', f_record).read()
> >
> >instead of
> >
> >  
> >
> >>b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >>
> >>    
> >>
> >
> >I think that issue appeared a couple of months ago on the biopython list, essentially saying that
> >qblast is the blast NCBI wants people to use for blast scripts? After that, qblast method was added
> >to NCBIWWW, and it's what I'm using in my blast scripts.
> >
> >Hope this helps,
> >Frank
> >
> >On Wed, 2005-02-16 at 14:02 -0800, Iddo Friedberg wrote:
> >  
> >
> >>OK, this is a real bug. NCBIWWW seems to be broken.
> >>
> >>I'm having a looksee, but I'd like someone more versed in this than me
> >>to do so.
> >>
> >>Thanks,
> >>
> >>Iddo
> >>
> >>
> >>
> >>-------- Original Message --------
> >>Subject:     Question to code
> >>Date:     Wed, 16 Feb 2005 15:19:57 +0100
> >>From:     Eirik Sønneland <eirik.sonneland at student.umb.no>
> >>To:     idoerg
> >>
> >>
> >>
> >>Dear Freidberg,
> >>
> >>I've been having problems parsing my output from NCBI using the example
> >>code given in Biopython Cookbook. Therefore I tried to follow your code
> >>described in "Genome Informatics 14(2003). Still I get an error message
> >>connected to the parsing. Could you please give a hint on what is wrong?
> >>Is this a bug?? Code and output as follows:
> >>
> >>Code:
> >>
> >>from Bio.Blast import NCBIWWW
> >>from Bio import Fasta
> >>
> >>file_for_blast = open('Fastaformat.txt', 'r')
> >>f_iterator = Fasta.Iterator(file_for_blast)
> >>f_record = f_iterator.next()
> >>
> >>b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >>
> >>b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >>
> >>Output(Have cut out the beginning, only pasted the last part of output):
> >>
> >>
> >> Score = 40.1 bits (20), Expect = 6.3
> >> Identities = 20/20 (100%)
> >> Strand = Plus / Minus
> >>
> >>                                
> >>Query: 29     ctgcagctcgggctcctgcc 48
> >>              ||||||||||||||||||||
> >>Sbjct: 150928 ctgcagctcgggctcctgcc 150909
> >></PRE>
> >>
> >>
> >><form>
> >>
> >><PRE>
> >>Lambda     K      H
> >>    1.37    0.711     1.31
> >>
> >>Gapped
> >>Lambda     K      H
> >>    1.37    0.711     1.31
> >>
> >>Matrix: blastn matrix:1 -3
> >>Gap Penalties: Existence: 5, Extension: 2
> >>Number of Sequences: 2894376
> >>Number of Hits to DB: 6,089,259
> >>Number of extensions: 328661
> >>Number of successful extensions: 6259
> >>Number of sequences better than 10.0: 2
> >>Number of HSP's better than 10.0 without gapping: 2
> >>Number of HSP's gapped: 6259
> >>Number of HSP's successfully gapped: 2
> >>Number of extra gapped extensions for HSPs above 10.0: 6255
> >>Length of query: 600
> >>Length of database: 13,294,103,689
> >>Length adjustment: 22
> >>Effective length of query: 578
> >>Effective length of database: 13,230,427,417
> >>Effective search space: 7647187047026
> >>Effective search space used: 7647187047026
> >>A: 0
> >>X1: 11 (21.8 bits)
> >>X2: 15 (30.0 bits)
> >>X3: 25 (50.0 bits)
> >>S1: 14 (25.0 bits)
> >>S2: 20 (40.1 bits)
> >>
> >>
> >></form>
> >>
> >>Traceback (most recent call last):
> >>  File "C:\Python24\MyWorkspace.py", line 50, in -toplevel-
> >>    b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >>  File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 52, in
> >>parse_str
> >>    return self.parse(File.StringHandle(string))
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in
> >>parse
> >>    self._scanner.feed(handle, self._consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 99, in
> >>feed
> >>    self._scan_rounds(uhandle, consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 242,
> >>in _scan_rounds
> >>    self._scan_alignments(uhandle, consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 322,
> >>in _scan_alignments
> >>    raise SyntaxError, "Cannot resolve location at line:\n%s" % line1
> >>SyntaxError: Cannot resolve location at line:
> >></form>
> >>
> >> >>>
> >>
> >>Thanks!
> >>
> >>Regards,
> >>Eirik
> >>
> >>
> >>    
> >>
>
> --
> Iddo Friedberg, Ph.D.
> The Burnham Institute
> 10901 N. Torrey Pines Rd.
> La Jolla, CA 92037 USA
> Tel: +1 (858) 646 3100 x3516
> Fax: +1 (858) 713 9930
> http://ffas.ljcrf.edu/~iddo
> ==========================
> The First Automated Protein Function Prediction SIG
> Detroit, MI June 24, 2005
> http://ffas.burnham.org/AFP
>
> ------------------------------
>
> Message: 7
> Date: Wed, 16 Feb 2005 15:49:49 -0800
> From: Iddo Friedberg <idoerg at burnham.org>
> Subject: [BioPython] Re: [Biopython-dev] [Fwd: Question to code]
> Cc: biopython-dev at biopython.org, biopython at biopython.org
> Message-ID: <4213DC1D.9070306 at burnham.org>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> OK, I fixed that.
>
> Eirik, you can check out a copy fom CVS, or wait for the Friday release.
>
> ./I
>
> Frank Kauff wrote:
>
> >Eirik,
> >
> >Try if the code works with
> >
> >b_results = NCBIWWW.qblast('blastn', 'nr', f_record).read()
> >
> >instead of
> >
> >  
> >
> >>b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >>
> >>    
> >>
> >
> >I think that issue appeared a couple of months ago on the biopython list, essentially saying that
> >qblast is the blast NCBI wants people to use for blast scripts? After that, qblast method was added
> >to NCBIWWW, and it's what I'm using in my blast scripts.
> >
> >Hope this helps,
> >Frank
> >
> >On Wed, 2005-02-16 at 14:02 -0800, Iddo Friedberg wrote:
> >  
> >
> >>OK, this is a real bug. NCBIWWW seems to be broken.
> >>
> >>I'm having a looksee, but I'd like someone more versed in this than me
> >>to do so.
> >>
> >>Thanks,
> >>
> >>Iddo
> >>
> >>
> >>
> >>-------- Original Message --------
> >>Subject:     Question to code
> >>Date:     Wed, 16 Feb 2005 15:19:57 +0100
> >>From:     Eirik Sønneland <eirik.sonneland at student.umb.no>
> >>To:     idoerg
> >>
> >>
> >>
> >>Dear Freidberg,
> >>
> >>I've been having problems parsing my output from NCBI using the example
> >>code given in Biopython Cookbook. Therefore I tried to follow your code
> >>described in "Genome Informatics 14(2003). Still I get an error message
> >>connected to the parsing. Could you please give a hint on what is wrong?
> >>Is this a bug?? Code and output as follows:
> >>
> >>Code:
> >>
> >>from Bio.Blast import NCBIWWW
> >>from Bio import Fasta
> >>
> >>file_for_blast = open('Fastaformat.txt', 'r')
> >>f_iterator = Fasta.Iterator(file_for_blast)
> >>f_record = f_iterator.next()
> >>
> >>b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> >>
> >>b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >>
> >>Output(Have cut out the beginning, only pasted the last part of output):
> >>
> >>
> >> Score = 40.1 bits (20), Expect = 6.3
> >> Identities = 20/20 (100%)
> >> Strand = Plus / Minus
> >>
> >>                                
> >>Query: 29     ctgcagctcgggctcctgcc 48
> >>              ||||||||||||||||||||
> >>Sbjct: 150928 ctgcagctcgggctcctgcc 150909
> >></PRE>
> >>
> >>
> >><form>
> >>
> >><PRE>
> >>Lambda     K      H
> >>    1.37    0.711     1.31
> >>
> >>Gapped
> >>Lambda     K      H
> >>    1.37    0.711     1.31
> >>
> >>Matrix: blastn matrix:1 -3
> >>Gap Penalties: Existence: 5, Extension: 2
> >>Number of Sequences: 2894376
> >>Number of Hits to DB: 6,089,259
> >>Number of extensions: 328661
> >>Number of successful extensions: 6259
> >>Number of sequences better than 10.0: 2
> >>Number of HSP's better than 10.0 without gapping: 2
> >>Number of HSP's gapped: 6259
> >>Number of HSP's successfully gapped: 2
> >>Number of extra gapped extensions for HSPs above 10.0: 6255
> >>Length of query: 600
> >>Length of database: 13,294,103,689
> >>Length adjustment: 22
> >>Effective length of query: 578
> >>Effective length of database: 13,230,427,417
> >>Effective search space: 7647187047026
> >>Effective search space used: 7647187047026
> >>A: 0
> >>X1: 11 (21.8 bits)
> >>X2: 15 (30.0 bits)
> >>X3: 25 (50.0 bits)
> >>S1: 14 (25.0 bits)
> >>S2: 20 (40.1 bits)
> >>
> >>
> >></form>
> >>
> >>Traceback (most recent call last):
> >>  File "C:\Python24\MyWorkspace.py", line 50, in -toplevel-
> >>    b_record = NCBIWWW.BlastParser().parse_str(b_results)
> >>  File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 52, in
> >>parse_str
> >>    return self.parse(File.StringHandle(string))
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in
> >>parse
> >>    self._scanner.feed(handle, self._consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 99, in
> >>feed
> >>    self._scan_rounds(uhandle, consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 242,
> >>in _scan_rounds
> >>    self._scan_alignments(uhandle, consumer)
> >>  File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 322,
> >>in _scan_alignments
> >>    raise SyntaxError, "Cannot resolve location at line:\n%s" % line1
> >>SyntaxError: Cannot resolve location at line:
> >></form>
> >>
> >> >>>
> >>
> >>Thanks!
> >>
> >>Regards,
> >>Eirik
> >>
> >>
> >>    
> >>
>
> --
> Iddo Friedberg, Ph.D.
> The Burnham Institute
> 10901 N. Torrey Pines Rd.
> La Jolla, CA 92037 USA
> Tel: +1 (858) 646 3100 x3516
> Fax: +1 (858) 713 9930
> http://ffas.ljcrf.edu/~iddo
> ==========================
> The First Automated Protein Function Prediction SIG
> Detroit, MI June 24, 2005
> http://ffas.burnham.org/AFP
>
> ------------------------------
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython
>
> End of BioPython Digest, Vol 26, Issue 3
> ****************************************
------- End of Original Message -------




More information about the BioPython mailing list