[BioRuby] rails blast server
Frank Schwach
fs5 at sanger.ac.uk
Thu Sep 23 12:49:29 UTC 2010
What Trever describes is how I do it too. If this is all you want then a
Rails app is a bit overkill because this is a very simple cgi script
that doesn't even connect to a database.
Basically, you just need some validation of input and then issue a
system command (blsatall ....).
As Trever pointed out, for larger databses this may be impractical
because there will be no feedback until the search has completed and if
your site is popular then many BLAST searches on a single server may
quickly become a problem. Two possible solutions:
1) automatically send the results by email and just display a page
showing that the search has been submitted. I use Perl for sending such
messages but it should be just as easy in Ruby
2) use a job queueing system and run jobs in the background. The
simplest solution is to use the Linux "batch" queue
(http://linux.about.com/library/cmd/blcmdl1_batch.htm).
You can just submit jobs to the queue and they are only run when system
resources are available. Ensure that the results are written into a file
with a unique job ID in the file name and display a results page with
some AJAX which keeps querying for the BLAST result file (by its ID) and
inserts it into the page as soon as it is available.
Hope this helps.
Frank
On Thu, 2010-09-23 at 06:20 -0500, Trevor Wennblom wrote:
> Hi Yannick,
>
> It's pretty straight-forward. Put your sequences into a blast database as usual with formatdb. Setup a page in Rails with a textarea or file upload submit form. Take the submitted text / sequence, use it to query against your blast database by saving the input to a file and running the commandline tool (such as blastn), and finally return the file containing results.
>
> This is assuming your queries run quickly since the page render will be delayed until blast is complete. If you need to search against a large database there's a bit more work to it.
>
> _______________________________________________
> BioRuby Project - http://www.bioruby.org/
> BioRuby mailing list
> BioRuby at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioruby
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
More information about the BioRuby
mailing list