Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Blast Plus help.

by Robbih (Initiate)
on Dec 18, 2014 at 11:20 UTC ( [id://1110737]=perlquestion: print w/replies, xml ) Need Help??

Robbih has asked for the wisdom of the Perl Monks concerning the following question:

Good day perl people.I have been working on some light perl projects. I have a project were i need to use the module Blast plus and i require some help.

I have this code

It is a very simple Blast Plus script which works as far as the blasting is concerned. My problem is that it also creates a lot of blast reports.

$seq = "MGPTSGPSLLLLLLTHLPLALGSP"; my ($hit, $frac, $eval) = blast($seq); print "$hit\t$frac\t$eval\n"; sub blast { use strict; use Bio::Tools::Run::StandAloneBlastPlus; use Bio::Seq; use Bio::SearchIO; my $seq = $_[0]; my $seq_obj = Bio::Seq->new(-id =>"test", -seq =>$seq); my $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'db', ); my $report = $fac->blastp( -method => 'blastp', -query => $seq_obj, ); my $hit = $report->next_hit(); my $hit_name = $hit->name(); $hit_name =~ s/\w{3}//; $hit_name; my $hsp = $hit->next_hsp(); my $frac_cons = $hsp->frac_conserved( ['query'|'hit'|'total'] ); $frac_cons = $frac_cons*100; my $evalue = $hsp->evalue(); return ($hit_name, int($frac_cons), $evalue); }

The files which are created are "somename.fas" which gives the sequence which is being blasted and a BLASTP report "somename.file". So here comes the question: Is it possible to tell Blast Plus that i don't want anyfiles created?

I will be doing allot of blasting and i don't want to end up with gazillion(estimation) files on the server. If you see some errors or mistakes i would also of course appreciate help.

I have mostly been using http://www.bioperl.org/wiki/HOWTO:BlastPlus. But i did not see anything there which helped me.

Thank you in advance.

Replies are listed 'Best First'.
Re: Blast Plus help.
by GotToBTru (Prior) on Dec 18, 2014 at 15:49 UTC

    Did you check Super Search? It looks like the answer to this will require familiarity with BioPerl, and a search might reveal who among the monks works with it.

    1 Peter 4:10

      Hi thanks for the responce. That is a good point and i will look into finding a person that is familiar with bio perl.

Re: Blast Plus help.
by biohisham (Priest) on Dec 20, 2014 at 08:14 UTC

    Hello Robbih and welcome to the Monastery. First, KUDOS for getting the standAloneBlast to run ;). I gave up on it a long time ago.

    I wonder if the files that are generated by the BLAST factory are temporary files. In that case you may simply add $fac->cleanup;. But before that you might need to register the files for deletion. You've not indicated whether you explored this option but it is mentioned in the same link you quoted. Otherwise you might consider explicitly deleting the files yourself by using the Perl unlink function.

    Asking BioPerl related questions maybe a bit tricky since not all the Monks are into bioinformatics for that me and BioLion have written Perl and Bioinformatics which you might find useful when interacting with monks in the Monastery.


    A 4 year old monk

      Hi biohisham and thanks for the replay

      Also sorry for the lateness of my replay! I was away from the internets during the holidays.

      I have looked at the $fac->cleanup and it did not work. But now i think that i need to take a look at my factory and how i create the database.

      Thank you very much for the info and the unlink i will take a look into that also.

      I look forward to read up on Perl and Bioinformatics. And if it is all right i might even be so bald and send you a PM with a question or two about bioperl if i get really stuck.

      Best regards Róbert

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1110737]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-25 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found