Standalone Blast | Newbie | | Join Date: Sep 2007
Posts: 2
| | |
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
|  | Site Moderator | | Join Date: May 2007 Location: New Hampshire
Posts: 2,565
| | | re: Standalone Blast Quote:
Originally Posted by Nandu123 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
|  | Expert | | Join Date: Jan 2007 Location: Southern California USA
Posts: 4,091
| | | re: Standalone Blast Quote:
Originally Posted by Nandu123 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
|  | Site Moderator | | Join Date: May 2007 Location: New Hampshire
Posts: 2,565
| | | re: Standalone Blast Quote:
Originally Posted by KevinADC 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.
| | Newbie | | Join Date: Sep 2007
Posts: 2
| | | re: Standalone Blast
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: -
#!/usr/bin/perl -w
-
use strict;
-
-
# Local-blast "factory object" creation and blast-parameter:
-
-
-
# initialization:
-
use Bio::Tools::Run::StandAloneBlast;
-
use Bio::SeqIO;
-
use Bio::Seq;
-
use Bio::SearchIO;
-
-
# Process Command line arguments
-
if(scalar @ARGV !=6){
-
my $usage = " ./home/blaststd.pl INPUTFILE BLASTDB PROGRAM E-CUTOFF OUTPUTFILE";
-
print "Wrong number of arguments\n";
-
die "$usage\n";
-
}
-
#the filenames containing input sequence
-
my $input_seq1 = dna.fasta;
-
my $input_seq2 = sequences.fasta;
-
$input_seq1 = $ARGV[0];
-
$input_seq2 =$ARGV[1];
-
#the database to blast against
-
my $db = $ARGV[2];
-
# the blast program to use
-
my $program = $ARGV[3];
-
#the expect value (Evalue)cutoff
-
my $cutoff = $ARGV[4];
-
#the name of the output file
-
my $output_file = $ARGV [5];
-
#blast parameters with type of programs, type of database, type of file, type of method:
-
-
my @params1= ('programs'=> 'blastn','database' => 'ecoli.nt','outfile' =>'blastn.out','e 1e-10',
-
'_READMETHOD' => 'Blast');
-
my @params2= ('programs'=> 'blastp','database' => 'ecoli.aa','outfile' =>'blastp.out','e 1e-10',
-
'_READMETHOD' => 'Blast');
-
my @params3 = ('programs'=> 'tblastx','database' => 'ecoli.nt','outfile' =>'blastx.out','e 1e-10',
-
'_READMETHOD' => 'Blast');
-
-
print "Enter the type of program";
-
-
my $factory = Bio::Tools::Run::StandAloneBlast->new(@params1, @params2, @params3);
-
-
-
# Blast a sequence against a database:
-
-
-
my $in1 = Bio::SeqIO->new(-file=>'dna.fasta' , -format =>'Fasta');
-
my $in2= Bio::SeqIO->new(-file=>'sequences.fasta',-format=>'Fasta');
-
-
# Load the sequence into a Bio::Seq obj
-
my $seq =Bio::Seq->new($in1->next_seq());
-
my $seq2 =Bio::Seq->new($in2->next_seq());
-
-
#my $input2 = $str->next_seq();
-
my $blast_report = $factory->blastall($seq,$seq2);
-
-
-
-
-
-
-
-
-
# Blast a sequence against a database:
-
# format can be , 'blast', 'exonerate', ...
-
-
my $searchio1 = new Bio::SearchIO(-format => 'blastn',
-
-file => 'dna.fasta');
-
my $searchio2= new Bio::SearchIO(-format => 'blastp',-file => 'sequences.fasta');
-
my $searchio3 = new Bio::SearchIO(-format => 'tblastx' -file => 'dna.fasta')
-
-
while (my $result = $searchio->next_result)
-
{
-
-
while(my $hit = $result->next_hit)
-
{
-
-
# process the Bio::Search::Hit::HitI object
-
while(my $hsp = $hit->next_hsp )
-
{
-
# process the Bio::Search::HSP::HSPI object
-
if($hsp->length('total') >=. 75)
-
{
-
print "Hit=", $hit->name,
-
"len=",$hsp->length('total'),
-
"percent_id=",$hsp->percent_identity,
-
"Score =", my $bitsore->bits(%s),
-
"Expected value=", my $evalue,"\n";
-
}
-
}
-
}
-
}
-
}
-
print "Thank you.\n";
-
|  | Expert | | Join Date: Jan 2007 Location: Southern California USA
Posts: 4,091
| | | re: Standalone Blast Quote:
Originally Posted by numberwhun 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.
|  | Expert | | Join Date: Jan 2007 Location: Southern California USA
Posts: 4,091
| | | re: Standalone Blast
You ned to quote barewords, like here: -
my $input_seq1 = dna.fasta;
-
my $input_seq2 = sequences.fasta;
-
should be: -
my $input_seq1 = 'dna.fasta';
-
my $input_seq2 = 'sequences.fasta';
-
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.
| | Newbie | | Join Date: Jul 2009
Posts: 2
| | | re: Standalone Blast
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;
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,223 network members.
|