Bioperl: HTML linking into blast?

Andrew Dalke dalke@bioreason.com
Fri, 04 Dec 1998 18:50:20 -0800


Rubin Eitan <bcrubin@dapsas1.weizmann.ac.il> asked:
> I am trying to make web pages that will link to blast searches directly. 
> The idea is to put a link on each sequence, so that the user (me, and 
> only me) can pick a sequence and run it's blast in real time. Here is how 
> my links look like:
> 
> http://www.ncbi.nlm.nih.gov/cgi-bin/BLAST/nph-newblast?
> PROGRAM=blastn&DATALIB=nr&INPUT_TYPE=Accession or GI&SEQUENCE=X85404

                                                ^--^-- spaces

Not sure if this is the answer (can't test it here), but you likely
need to escape the spaces, which for URLs is a "+" or %20 (depends
on your preference, I think).  It's available automatically in
CGI.pm's "escape"

% perl
require CGI;
print CGI::escape("Accession or GI"), "\n";
Accession%20or%20GI

Or in python's urllib <wink>
% python
>>> import urllib
>>> urllib.quote("Accession or GI")
'Accession%20or%20GI'

You might also be able to get away putting the whole URL in quotes,
if you haven't already, since your browser might not be seeing the
whole URL.  Browsers usually will url encode nonstandard characters
if they see them in hrefs.

						Andrew Dalke
						dalke@bioreason.com
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================