[Bioperl-l] print alignment from blast results file

Fields, Christopher J cjfields at illinois.edu
Wed Nov 16 16:46:16 UTC 2011


small hint: you can get a Bio::AlignI from the HSP (which can be redirected to a Bio::AlignIO instance).

chris

On Nov 16, 2011, at 7:19 AM, Brian Osborne wrote:

> Nisa,
> 
> See:
> 
> http://www.bioperl.org/wiki/HOWTO:SearchIO
> 
> Brian O.
> 
> 
> On Nov 15, 2011, at 7:49 PM, nisa.dar wrote:
> 
>> 
>> Hi,
>> 
>> I am parsing a blast results file. I have found bioperl modules to get query
>> string, homology string and hit string for each hit/hsp. I want to print
>> them in the form of an alignment instead of aligning them individually.
>> 
>> this is what I am doing, but it doesn't seem correct
>> 
>> while (my $hsp = $hit->next_hsp) {
>>                                       my
>> $start_query_num=$hsp->start('query');
>> 					my $query_string=$hsp->query_string;
>> 					my $end_query_num=$hsp->end('query');
>> 					my $homology_string=$hsp->homology_string;
>> 					my $start_hit_num=$hsp->start('hit');
>> 					my $hit_string=$hsp->hit_string;
>> 					my $end_hit_num=$hsp->end('hit');
>> 					my $aln_o = $hsp->get_aln;
>> 					$query_string=~s/\n//g;#get rid of new line characters
>> 					$homology_string=~s/\n//g;
>> 					$hit_string=~s/\n//g;
>> 
>>                        print "<h3>Alignment:</h3><br />";
>> 			print "$start_query_num-$query_string-$end_query_num<br />";
>> 			print "   
>> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$homology_string<br />";
>> 			print "$start_hit_num-$hit_string-$end_hit_num<br /><br />";
>> 
>> 
>> 
>> }
>> 
>> Please let me know how can I print them in the form of an alignment as seen
>> in the blast results file.
>> 
>> Thanks
>> 
>> 
>> -- 
>> View this message in context: http://old.nabble.com/print-alignment-from-blast-results-file-tp32851673p32851673.html
>> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 
> 
> _______________________________________________
> 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