[Bioperl-l] two sequences alignment question
Jason Stajich
jason.stajich at duke.edu
Sun Apr 3 21:56:05 EDT 2005
If you just want the position, get it from the Search::HSP object.
Don't bother with AlignIO. See the SearchIO HOWTO for more
information.
if( my $hit = $bl2seq->next_hit ) {
while( my $hsp =$hit->next_hsp ) {
print "query: ", $hsp->query->start, "-", $hsp->query->end, " aligned
to subject: ", $hsp->hit->start, "-",
$hsp->hit->end, "\n";
}
}
On Apr 4, 2005, at 1:05 AM, yanfeng wrote:
> Hi, bioperl experts,
> I am a bioper and perl beginner. I have two sequences. One is very
> long( say 16000) and the other is short( say 100) . The short one is
> very similar to some part of the long sequence.
> I want to locate the position like from 1200 to 1300 is the very
> similar sequence part.
> I tried to use bl2seq module.But failed. It maybe a simple question
> but I just don't know how to do it.
>
> #Get 2 sequences
> $str = Bio::SeqIO->new(-file=>'t/amino.fa' , '-format' => 'Fasta', );
> my $seq3 = $str->next_seq();
> my $seq4 = $str->next_seq();
>
> # Run bl2seq on them
> $factory = Bio::Tools::StandAloneBlast->new('program' => 'blastp',
> 'outfile' => 'bl2seq.out');
> my $bl2seq_report = $factory->bl2seq($seq3, $seq4);
> # Note that report is a Bio::SearchIO object
>
> # Use AlignIO.pm to create a SimpleAlign object from the bl2seq report
> $str = Bio::AlignIO->new(-file=> 'bl2seq.out','-format' => 'bl2seq');
> $aln = $str->next_aln();
>
>
> the complain imformation is "can't write to bl2seq.out.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list