Exclude organisms in remoteblast with bioperl
0
0
Entering edit mode
9.3 years ago
lizabe ▴ 10

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

bioperl blast • 1.8k views
ADD COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1908 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6