Mauricio Herrera Cuadra | 3 Mar 2007 23:32
Picon
Favicon

Re: [BioPython] [Bioperl-l] New Article on Approaches to Web Development for Bioinformatics

Hi Alex,

I think you've put a very nice & concise introductory article. I'd like 
to comment a little on some sections I've read:

* Introduction

 > "Given that you have an idea for analyzing or presenting data in a
 > particular was, a complete bioinformatics web application depends of
 > these basic pieces, which is what this article is all about:
 >
 >    1. A source of data...
 >    2. An application programming language...
 >    3. A web application platform...
 >    4. Optionally, a data store...
 >    5. Optionally, you would reuse software tools..."

Even though you do a small mention about Web Services at the very end of 
the article (under Application Integration -> Programmatic Integration), 
I believe that Web Services can be another optional (or even basic) 
piece of a web application. In fact, many web applications consist only 
of Web Services without HTML user interfaces.

* Application Development Languages

 > "There are many different programming platforms and tools available to
 > solve bioinformatics problems.  It can be bewildering at first, but it
 > makes more sense to build on top of some of these tools rather than
 > build from scratch.  Some the problems with using these tools for a
 > bioinformatics portal are
(Continue reading)

Alex Amies | 4 Mar 2007 04:09
Picon

Re: [BioPython] [Bioperl-l] New Article on Approaches to Web Development for Bioinformatics

Mauricio,

Thanks for your comments.

You are right that I could have said a lot more about web services.  I
plan on doing that but I haven't got there yet.  Actually, with all
the hype about web services I have been surprised to find the
programming model so complicated.

As you mention, I certainly could have thought out my own URL's better.

I have been surprised not to find more PHP activity in bioinformatics.
 To me, besides being a lightweight and pleasant language to program
in it is incredibly economical for hosting Internet applications and
there is a huge open source community around PHP in general.  The same
can be said of Perl.  It is because of my own ignorance and lack of
time that I have not investigated Python and Ruby.  I may do in the
future and write about them.

Alex

On 3/3/07, Mauricio Herrera Cuadra <arareko <at> campus.iztacala.unam.mx> wrote:
> Hi Alex,
>
> I think you've put a very nice & concise introductory article. I'd like
> to comment a little on some sections I've read:
>
> * Introduction
>
>  > "Given that you have an idea for analyzing or presenting data in a
(Continue reading)

Hossein Shahsavari | 4 Mar 2007 05:14
Picon
Favicon

[BioPython] IOError: [Errno 2] No such file or directory:

Hello,

I receive the following error when I am trying to access a file called HISTORY
in an another file by this command

template = '~/CSH/HISTORY'

and I get this error.

IOError: [Errno 2] No such file or directory: '~/CSH/HISTORY'

I use python in Linux environment. I appreciate any suggestions/comments.

Hossein Shahsavari
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter | 4 Mar 2007 12:58
Picon
Picon

Re: [BioPython] IOError: [Errno 2] No such file or directory:

Hossein Shahsavari wrote:
> Hello,
> 
> I receive the following error when I am trying to access a file called HISTORY
> in an another file by this command
> 
> template = '~/CSH/HISTORY'
> 
> and I get this error.
> 
> IOError: [Errno 2] No such file or directory: '~/CSH/HISTORY'
> 
> I use python in Linux environment. I appreciate any suggestions/comments.

If you have posted the python code it would be easier to guess what is 
going wrong.  What does this do?

import os
template = '~/CSH/HISTORY'
print os.path.isfile(template)

That should print either True or False.

You might also try replacing the tilde ('~') with the actual path of 
your home folder, something like this typically:

template = '/home/username/CSH/HISTORY'

P.S. Have you checked the case?  Linux and Unix are case sensitive.

(Continue reading)

Hossein Shahsavari | 4 Mar 2007 17:57
Picon
Favicon

Re: [BioPython] IOError: [Errno 2] No such file or directory:

Hi

Thanks for your guidances. The problem was the tilde ('~') which I replaced by
the correct path and now it works. I have another maybe simple question:

I have 26 files namely output1, output2,...,output26. I can read them 
one by one
but how can read them all by an easier way like a loop ? I put a "for loop" by
setting

i=1

for i in range(1,27)
template='outputi'

however, I got the same error as above IOError: [Errno 2] No such file or
directory: 'outputi'. It seems "i" can't be attached to the output.

Thanks alot

Hossein

_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

Peter | 4 Mar 2007 18:34
Picon
Picon

Re: [BioPython] IOError: [Errno 2] No such file or directory:

Hossein Shahsavari wrote:
 > I have another maybe simple question:
> 
> I have 26 files namely output1, output2,...,output26. I can read them 
> one by one but how can read them all by an easier way like a loop ?
 > I put a "for loop" by setting
> 
> i=1
> 
> for i in range(1,27)
> template='outputi'
> 
> however, I got the same error as above IOError: [Errno 2] No such file or
> directory: 'outputi'. It seems "i" can't be attached to the output.
> 
> Thanks alot
> 
> Hossein

You should really try a basic introduction to python.  There are lots of 
tutorials online, and great books too.  Your questions so far are not 
really related to BioPython at all.

Note that indentation is very important in python.  You were also 
missing the colon at the end for line.  More importantly the following 
line just sets the variable template to the string 'outputi', and 
doesn't do anything with the variable i.

template='outputi'

(Continue reading)

Julius Lucks | 5 Mar 2007 15:13
Picon

[BioPython] blast parsing errors

Hi all,

I am trying to parse a bunch of blast results that I gather via  
NCBIWWW.qblast().  I have the following code snipit:

-----------
from Bio imort Fasta
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
import StringIO
import re

#BLAST cutoff
cutoff = 1e-4

#Create a fasta record: title and seq are given

title = 'test'
seq = 'ATCG'

fasta_rec = Fasta.Record()
	
#Sanitize title - blast does not like single quotes or \n in titles
title = re.sub("'","prime",title)
title = re.sub("\n","",title)
fasta_rec.title = title
fasta_rec.sequence = seq

b_parser = NCBIXML.BlastParser()

(Continue reading)

Peter | 5 Mar 2007 15:55
Picon
Picon

Re: [BioPython] blast parsing errors

Julius Lucks wrote:
> Hi all,
> 
> I am trying to parse a bunch of blast results that I gather via  
> NCBIWWW.qblast().  I have the following code snipit:

You didn't say which version of BioPython you are using, I would guess 
1.42 - there have been some Bio.Blast changes since than.

Your example sequence was "ATCG", but you ran a "blastp" search.  Did 
you really mean the peptide Ala-Thr-Cys-Gly here?

If you meant to do a nucleotide search, try using "blastn" and "nr" 
instead.  That should work better.

However, there is still something funny going on.  I tried your example 
as is using the CVS code, and it fails before it even gets the blast 
results back...

Could you save the XML output to a file and email it to me; or even 
better file a bug an attach the XML file to the bug.

Thanks

Peter
_______________________________________________
BioPython mailing list  -  BioPython <at> lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython

(Continue reading)

Peter | 5 Mar 2007 16:12
Picon
Picon

Re: [BioPython] blast parsing errors

Julius Lucks wrote:
> Hi all,
> 
> I am trying to parse a bunch of blast results that I gather via  
> NCBIWWW.qblast().  I have the following code snipit:

I am wondering if your trivial example triggered some "unusual" error 
page from the NCBI...

I would suggest you update to CVS, as we have made a lot of changes to 
the Blast XML support.  You would probably be safe just updating the 
following  Bio.Blast files, located here on your machine:

/sw/lib/python2.5/site-packages/Bio/Blast/NCBIStandalone.py
/sw/lib/python2.5/site-packages/Bio/Blast/NCBIWWW.py
/sw/lib/python2.5/site-packages/Bio/Blast/NCBIXML.py
/sw/lib/python2.5/site-packages/Bio/Blast/Record.py

If you don't know how to use CVS, then just backup the originals, and 
replace them with the new files download one by one from here:

http://cvs.biopython.org/cgi-bin/viewcvs/viewcvs.cgi/biopython/Bio/Blast/?cvsroot=biopython

----------------------------------------------------------------------

This works for me using the CVS version of BioPython.  I have just made 
a string for rather than messing about with a fasta record object to 
keep the code short:

#Protein example, BLASTP
(Continue reading)

Favicon

Re: [BioPython] blast parsing errors

Julius Lucks wrote:
> seq = 'ATCG'
 > ...
> fasta_rec.sequence = seq
> ...
> result_handle = NCBIWWW.qblast 
> ('blastp','nr',fasta_rec,ncbi_gi=1,expect=cutoff,format_type="XML",entre 
You have a nucleotide sequence but are running a protein-protein blast 
with blastp. If you run this exact search with Blast through a browser, 
it will show you an error message. The function 
_parse_qblast_ref_page(handle), which is called from NCBIWWW.qblast, 
chokes on this error message. If you want to make this more robust, one 
solution might be to check for error messages returned by the Blast 
server in _parse_qblast_ref_page.

By the way, the code can be simplified as follows:
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML

#BLAST cutoff
cutoff = 1e-4

#Create a fasta record: title and seq are given
seq = 'ATCG'

b_parser = NCBIXML.BlastParser()

result_handle = NCBIWWW.qblast('blastn', 'nr', seq, ncbi_gi=1, 
expect=cutoff, format_type="XML", entrez_query="Viruses [ORGN]")
			
(Continue reading)


Gmane