473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Standalone Blast

Does anyone help me with the script of standalone blast that will execute the blastn, blastp and tblastx, with one script and e values, and hits, and score
Sep 18 '07 #1
7 5757
numberwhun
3,509 Expert Mod 2GB
Does anyone help me with the script of standalone blast that will execute the blastn, blastp and tblastx, with one script and e values, and hits, and score
This is the Perl forum. I do not know what blastn, blastp, and tblastx are and your question is extremely vague and not well worded. If you could further explain what you are looking for, that would be most helpful. At this point, I don't know how the Perl forum can further help you.

Regards,

Jeff
Sep 18 '07 #2
KevinADC
4,059 Expert 2GB
Does anyone help me with the script of standalone blast that will execute the blastn, blastp and tblastx, with one script and e values, and hits, and score
look into bioperl: www.bioperl.org

or search CPAN: search.cpan.org
Sep 19 '07 #3
numberwhun
3,509 Expert Mod 2GB
look into bioperl: www.bioperl.org

or search CPAN: search.cpan.org
You have either had exposure to that or have played with it because I hadn't a clue what they were talking about.
Sep 19 '07 #4
Hello masters!!!!!!!!!
I hope my script is a bioperl script which is related to perl of course,,,,, so should be included in the perl forum I suppose,,,,, and standalone blast is a means to use blast locally using perl/ bioperl script. So I asked it here. Again, I am facing few bugs with the "my" thus, if someone can help me,,,, to get it debug, will be great!!!!!!!

My script is as follows:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use strict;
  3.  
  4. # Local-blast "factory object" creation and blast-parameter:
  5.  
  6.  
  7.  # initialization:
  8. use Bio::Tools::Run::StandAloneBlast;
  9. use Bio::SeqIO;
  10. use Bio::Seq;
  11. use Bio::SearchIO;
  12.  
  13. # Process Command line arguments
  14. if(scalar @ARGV !=6){
  15.   my $usage = " ./home/blaststd.pl INPUTFILE BLASTDB PROGRAM E-CUTOFF OUTPUTFILE";
  16.    print  "Wrong number of arguments\n";
  17.    die "$usage\n";
  18.    }
  19. #the filenames containing input sequence
  20. my $input_seq1 = dna.fasta;
  21. my $input_seq2 = sequences.fasta;
  22.    $input_seq1 = $ARGV[0];
  23.    $input_seq2 =$ARGV[1];
  24. #the database to blast against
  25. my $db = $ARGV[2];
  26. # the blast program to use
  27. my $program = $ARGV[3];
  28. #the expect value (Evalue)cutoff
  29. my $cutoff = $ARGV[4];
  30. #the name of the output file
  31. my $output_file = $ARGV [5];
  32. #blast parameters with type of programs, type of database, type of file, type of method:
  33.  
  34. my @params1= ('programs'=> 'blastn','database' => 'ecoli.nt','outfile' =>'blastn.out','e 1e-10',
  35.     '_READMETHOD' => 'Blast');
  36. my @params2= ('programs'=> 'blastp','database' => 'ecoli.aa','outfile' =>'blastp.out','e 1e-10',
  37.    '_READMETHOD' => 'Blast');
  38. my @params3 = ('programs'=> 'tblastx','database' => 'ecoli.nt','outfile' =>'blastx.out','e 1e-10',
  39.     '_READMETHOD' => 'Blast');
  40.  
  41. print "Enter the type of program";
  42.  
  43. my $factory = Bio::Tools::Run::StandAloneBlast->new(@params1, @params2, @params3);
  44.  
  45.  
  46.  # Blast a sequence against a database:
  47.  
  48.  
  49.    my $in1 = Bio::SeqIO->new(-file=>'dna.fasta' , -format =>'Fasta');
  50.    my $in2= Bio::SeqIO->new(-file=>'sequences.fasta',-format=>'Fasta');
  51.  
  52. # Load the sequence into a Bio::Seq obj
  53.    my  $seq =Bio::Seq->new($in1->next_seq());
  54.    my $seq2 =Bio::Seq->new($in2->next_seq());
  55.  
  56. #my  $input2 = $str->next_seq();
  57. my  $blast_report = $factory->blastall($seq,$seq2);
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. # Blast a sequence against a database:
  67. # format can be , 'blast', 'exonerate', ...
  68.  
  69. my $searchio1 = new Bio::SearchIO(-format => 'blastn',
  70.                                      -file => 'dna.fasta');
  71. my $searchio2= new Bio::SearchIO(-format => 'blastp',-file => 'sequences.fasta');
  72. my $searchio3 = new Bio::SearchIO(-format => 'tblastx' -file => 'dna.fasta')
  73.  
  74. while  (my $result = $searchio->next_result)
  75.     {
  76.  
  77.        while(my $hit = $result->next_hit) 
  78.     {
  79.  
  80.         # process the Bio::Search::Hit::HitI object
  81.            while(my $hsp = $hit->next_hsp )
  82.           {
  83.         # process the Bio::Search::HSP::HSPI object
  84.           if($hsp->length('total') >=. 75) 
  85.             {
  86.              print "Hit=", $hit->name,
  87.                    "len=",$hsp->length('total'),
  88.                    "percent_id=",$hsp->percent_identity,
  89.                    "Score =", my $bitsore->bits(%s),
  90.                    "Expected value=", my $evalue,"\n";
  91.                 }
  92.                }
  93.             }
  94.        }
  95.  }
  96. print "Thank you.\n";
  97.  
Sep 19 '07 #5
KevinADC
4,059 Expert 2GB
You have either had exposure to that or have played with it because I hadn't a clue what they were talking about.

I have seen this question or similar asked on other forums so I have some knowledge of what it is. I have no practical experience with it though.
Sep 19 '07 #6
KevinADC
4,059 Expert 2GB
You ned to quote barewords, like here:

Expand|Select|Wrap|Line Numbers
  1. my $input_seq1 = dna.fasta;
  2. my $input_seq2 = sequences.fasta;
  3.  
should be:

Expand|Select|Wrap|Line Numbers
  1. my $input_seq1 = 'dna.fasta';
  2. my $input_seq2 = 'sequences.fasta';
  3.  
see if that helps gets things working. If not, post the exact error messages you are getting when trying your code. I do not have any of the modules you are using installed so I can't help debug the syntax except by "eye", which I am not prepared to do.
Sep 19 '07 #7
nb175
2
hi, I need help with my blast script. I need to specify that i need only the first ten hits, any idea how i could go about that?Thanks. here;s the script

#! /usr/bin/perl
use warnings;
use strict;

use Bio::SeqIO;
use Bio::Seq;
use Bio::Tools::Run::StandAloneBlast;

my $seqio_obj;
my $seq_obj;
my @params;
my $blast_obj;
my $result_obj;
my $report_obj;

$seqio_obj = Bio::SeqIO->new(-file => 'seq.fasta',
-format => 'fasta' );
# to wrtie the sequence to afasta file
$seq_obj = $seqio_obj->next_seq;
#print $seq_obj->seq,"\n";
@params = (program => 'blastp',
database => 'pdbaa',
outfile => 'blast1.out');
$blast_obj = Bio::Tools::Run::StandAloneBlast->new(@params);
$report_obj = $blast_obj->blastall($seq_obj);
$result_obj = $report_obj->next_result;
print $result_obj->num_hits;
Jul 14 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: FilexBB | last post by:
Currently I use jdom-b9 version to parase xml with the following xml message <?xml version="1.0" encoding="UTF-8" standalone="no"?> ...... with the code like this SAXBuilder builder = new...
2
by: Lonnie, SRC employee | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** I can figure out how to set the standalone attribute in the <? xml version="1.0 ?> tag eg <?xml version="1.0" standalone="yes" ?> ...
9
by: Dan Williams | last post by:
Hi people I'm getting a little annoyed with the way the print function always adds a space character between print statements unless there has been a new line. The manual mentions that "In some...
3
by: Isaac Gouy | last post by:
1) Running a standalone script with SpiderMonkey on Linux js -f scriptfile.js scriptarg How can I get the value of scriptarg from within the JavaScript scriptfile? 2) Running a standalone...
2
by: JohnR | last post by:
Hi all. In my program I try to handle all obvious potential errors with structured error handling (try-catch) block. What I would like to do is have an 'overall' error handler that would...
1
by: VK | last post by:
It is possibly more suitable to address this question to W3C mailing list, but I'm trying here first. Could anyone comment on <http://www.w3.org/TR/REC-xml/#sec-rmd> The first statement says:...
7
by: tah | last post by:
Hey, Can someone please clarify, confirm, or set me straight on my understanding of a standalone="yes" attribute in the xml version element? I assume it means that the xml document containing it...
7
by: khunohm | last post by:
I would like to know how to select each item of data from text file transfer to each column in excel file. source 1..159662 /organism="Candidatus...
1
by: nb175 | last post by:
hi, I need help with my blast script. I need to specify that i need only the first ten hits, any idea how i could go about that?Thanks. here;s the script #! /usr/bin/perl use warnings; use...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.