[Bioperl-l] Blast to Clustalw Format

Marcelo Iwata marcelo011982 at gmail.com
Thu Jan 14 13:46:21 UTC 2010


Sorry , the correct code is:



#!/usr/bin/perl -w

use strict;
use Bio::SearchIO;
use Bio::AlignIO;

my $in = new Bio::SearchIO(-format => 'blast',
                           -file   => '
../../fontes/exemplos/blat/teste2/output.blast ');
my $aln;
my $alnIO;
$alnIO = Bio::AlignIO->new(-format =>"clustalw", -file => ">hsp.aln");
while ( my $result = $in->next_result ) {
  ## $result is a Bio::Search::Result::ResultI compliant object
  while ( my $hit = $result->next_hit ) {
    ## $hit is a Bio::Search::Hit::HitI compliant object
    while ( my $hsp = $hit->next_hsp ) {
      ## $hsp is a Bio::Search::HSP::HSPI compliant object
      $aln = $hsp->get_aln;
      $alnIO->write_aln($aln);

    }
  }
}


On Thu, Jan 14, 2010 at 11:44 AM, Marcelo Iwata <marcelo011982 at gmail.com>wrote:

> Thanks Mark.
> I think that most of you already know it.
> But , i'll put it for new users:
>
>
> #!/usr/bin/perl -w
>
> use strict;
> use Bio::SearchIO;
> use Bio::AlignIO;
>
> my $in = new Bio::SearchIO(-format => 'blast',
>                            -file   => '
> ../../fontes/exemplos/blat/teste2/output.blast ');
> my $aln;
> my $alnIO;
> $alnIO = Bio::AlignIO->new(-format =>"clustalw", -file => ">hsp.aln");
> while ( my $result = $in->next_result ) {
>   ## $result is a Bio::Search::Result::ResultI compliant object
>   while ( my $hit = $result->next_hit ) {
>     ## $hit is a Bio::Search::Hit::HitI compliant object
>     while ( my $hsp = $hit->next_hsp ) {
>       ## $hsp is a Bio::Search::HSP::HSPI compliant object
>       $aln = $hsp->get_aln;
>       $alnIO->write_aln($aln);
>
>
>     }
>   }
> }
>
>
> On Wed, Jan 13, 2010 at 4:44 PM, Mark A. Jensen <maj at fortinbras.us> wrote:
>
>> Marcelo-
>> Yes-- look at the code snip at
>> http://www.bioperl.org/wiki/HOWTO:SearchIO#Using_SearchIO
>> combined with the snip at
>> http://www.bioperl.org/wiki/HOWTO:SearchIO#Using_the_methods
>> (using -format => 'clustalw')
>> cheers MAJ
>> ----- Original Message ----- From: "Marcelo Iwata" <
>> marcelo011982 at gmail.com>
>> To: <bioperl-l at lists.open-bio.org>
>> Sent: Wednesday, January 13, 2010 1:12 PM
>> Subject: [Bioperl-l] Blast to Clustalw Format
>>
>>
>>  Hi..
>>> I have an simple Blast result, such as blastn.
>>> Is there an  scrip  to transform such result to Clustalw format in
>>> Bioperl
>>> ?(.aln)
>>>
>>> Thanx for any help.
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
>>>
>



More information about the Bioperl-l mailing list