Question: Exclude organisms in remoteblast with bioperl
0
gravatar for lizabe
3.9 years ago by
lizabe10
Argentina
lizabe10 wrote:

Hi everyone, I am writing to ask for help with a BioPerl script.

I'm doing a remote blast using Bio :: Tools :: Run :: RemoteBlast and I need to exclude shuttle vectors and synthetic constructs.

I've tried to use this:

 $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'NOT shuttle vectors[orgn] AND NOT synthetic constructs[orgn]';

but it gives me no result, it seems as if the "NOT" is not making any effect because I'm getting the sequences that should be excluded.

This is part of the script:

use strict;
  use Bio::Tools::Run::RemoteBlast;
  use Bio::Search::Hit::Fasta;
  use Bio::DB::GenBank;
  use Bio::SeqIO;

  my $infile = shift or die "sintaxis: perl myScript.pl sequenceFile.fasta\n";
  my $prog = 'blastn';
  my $db   = 'nr';

  my @params = ( '-prog' => $prog,
         '-data' => $db);

  my $factory = Bio::Tools::Run::RemoteBlast->new(@params);

  #change a paramter
  $Bio::Tools::Run::RemoteBlast::HEADER{'ALIGNMENTS'} = '20000';
  $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENTS'} = '20000';
  $Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'NOT shuttle vectors[orgn] AND NOT synthetic constructs[orgn]';
  $Bio::Tools::Run::RemoteBlast::HEADER{'HITLIST_SIZE'} = '20000';

  my $v = 1;
  my $coverage_cutoff = 1.00;
  my $identity_cutoff = 1.00;
  my $linea = 1;

 my $r = $factory->submit_blast($infile);

  if( $v > 0 )
  {
    print STDERR "Searching hits...";
  }

  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);
          }
          if( $v > 0 )
          {
            print STDERR ".";
          }
          sleep 5;
        }
        else
        {
          my $result = $rc->next_result();
          my $filename = $infile."\.out";
          $factory->save_output($filename);
          $factory->remove_rid($rid);

          my $query_name = $result->query_name();
          open(SALIDA,">resultBLAST.txt");
          open(SALIDA2,">resultBLASTplano.txt");

..................


I hope you can help!!!

Thanks.

blast bioperl • 1.1k views
ADD COMMENTlink modified 3.9 years ago by Biostar ♦♦ 20 • written 3.9 years ago by lizabe10

If you are able to find only shuttle vectors and synthetic constructs, get their gi list, and use it with the "-negative_gilist" parameter.

ADD REPLYlink written 3.9 years ago by h.mon26k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 533 users visited in the last hour