[Bioperl-l] changing parameters in Bio::Tools::Run::RemoteBlast

Chris Fields cjfields1 at gmail.com
Mon Jun 22 14:05:56 UTC 2009


Jonas,

The best place to send questions is to the mail list (which I've  
cc'd).  If you reply make sure to keep the mail list in the reply-to.

There are two ways to set the parameters you want.  I'll show you what  
I consider the best, but I have no way to test it ATM.

$factory->submit_parameter($foo => 'bar')

is the syntax for setting PUT parameters.  Sad to see they didn't  
provide you with the exact PUT parameter names (as follows):

Max target sequences = 100 # MAX_NUM_SEQ
Expect threshold = 10  # EXPECT
Gap Costs = Existence 11 Extension 1   # GAPCOSTS
Compositional adjustments = Conditional compositional score matrix  
adjustment # COMPOSITION_BASED_STATISTICS

'Compositional adjustments' is as follows (from command-line blastall):

   -C  Use composition-based score adjustments for blastp or tblastn:
       As first character:
       D or d: default (equivalent to T)
       0 or F or f: no composition-based statistics
       2 or T or t: Composition-based score adjustments as in  
Bioinformatics 21:902-911,
       1: Composition-based statistics as in NAR 29:2994-3005, 2001
           2005, conditioned on sequence properties
       3: Composition-based score adjustment as in Bioinformatics  
21:902-911,
           2005, unconditionally
       For programs other than tblastn, must either be absent or be D,  
F or 0.
            As second character, if first character is equivalent to  
1, 2, or 3:

After the factory line and prior to the BLAST call you can add in the  
following (completely untested, excuse any possible mistakes) code:

my %put = (
    MAX_NUM_SEQ => 100,
    EXPECT      => 10,
    GAPCOSTS    => '11 1',
    COMPOSITION_BASED_STATISTICS => 2 # could be 1 as well
);

for my $putName (keys %put) {
    $self->submit_parameter($putName,$put{$putName});
}


chris

On Jun 22, 2009, at 8:14 AM, Jonas Schaer wrote:

> Hi there,
> I hope it's OK to ask you a question about the bio perl module   
> Bio::Tools::Run::RemoteBlast.
> My problem is, that I get different results using this perl-skript:
>
> #######################################################################################################################################################################################
>  use Bio::Seq::SeqFactory;
>  use Bio::Tools::Run::RemoteBlast;
>  use strict;
>  my @blast_report;
>  my $prog = 'blastp';
>  my $db   = 'nr';
>  my $e_val= '1e-10';
>  my @params = ( '-prog' => $prog,
>         '-data' => $db,
>         '-expect' => $e_val,
>         '-readmethod' => 'SearchIO' );
>  my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
>  #my $input = @_;
>  my  
> $ 
> blast_seq 
> = 
> 'MGSSSVGTYHLLLVLMGAGGEQQAVQAGAEVASTEQVDGSGMAANSRGSTSGSEQPPRDSDLGLLRSLLDVAGVDRTALEVKLLALAEAGAEMPPAQDSQATAAGVVATLTSVYRQQVARAWHERDDNAFRQAHQNTAMATGPDPDDEYE 
> ';
>  #$v is just to turn on and off the messages
>  my $v = 1;
>  my $seqbuilder = Bio::Seq::SeqFactory->new('-type' =>  
> 'Bio::PrimarySeq');
>  my $seq = $seqbuilder->create(-seq =>$blast_seq, -display_id =>  
> "$blast_seq");
>  my $filename='temp2.out';
>  my $r = $factory->submit_blast($seq);
>  print STDERR "waiting..." if( $v > 0 );
>    while ( my @rids = $factory->each_rid )
>    {
>        foreach my $rid ( @rids )
>        {
>            my $rc = $factory->retrieve_blast($rid);
>            if( !ref($rc) )
>            {
>                if( $rc < 0 )
>                {
>                    $factory->remove_rid($rid);
>                }
>                print STDERR "." if ( $v > 0 );
>            }
>                else
>                {
>                    my $result = $rc->next_result();
>                    $factory->save_output($filename);
>                    $factory->remove_rid($rid);
>                    print "\nQuery Name: ", $result->query_name(),  
> "\n";
>                    while ( my $hit = $result->next_hit )
>                    {
>                        next unless ( $v > 0);
>                        print "\thit name is ", $hit->name, "\n";
>                        while( my $hsp = $hit->next_hsp )
>                        {
>                            print "\t\tscore is ", $hsp->score, "\n";
>                        }
>                    }
>                }
>        }
>
>
>    }
> @blast_report = get_file_data ($filename);
> return @blast_report;
>
>
> sub get_file_data
> {
>    use strict;
>    my($filename) = @_;
>    use strict;
>    use warnings;
>    # Initialize variables
>    my @filedata = ( );
>    unless( open(GET_FILE_DATA, $filename) )
>    {
>        print STDERR "Cannot open file \"$filename\"\n\n";
>        exit;
>    }
>    @filedata = <GET_FILE_DATA>;
>    close GET_FILE_DATA;
>    print @filedata;
>    return @filedata;
> }
>
> #######################################################################################################################################################################################
>
> ... and the blastp on the ncbi-homepage. The people from NCBI wrote  
> me that I have to change some parameters:
> ""
> You need to have the following:
>
>
> Max target sequences = 100
> Expect threshold = 10
> Gap Costs = Existence 11 Extension 1
> Compositional adjustments = Conditional compositional score matrix  
> adjustment""
>
> Could you please tell me exactly how to change this parameters  
> within my perl-skript? I think I have to use the "put" command, but  
> I just cannot find out, how...
>
> Regards and thank you so much in advance :),
>
> Jonas Schaer




More information about the Bioperl-l mailing list