[Bioperl-l] bl2seq parsing

Jason Stajich jason.stajich at gmail.com
Thu Aug 1 16:49:09 UTC 2013


Try giving your sequences names -- a simple 'q' and 'h' is fine.
If I edit your output file and add a name after Query= and the > it works.

On Aug 1, 2013, at 6:21 AM, Emilie Lalonde <emilie.lalonde at gmail.com> wrote:

> Hi all,
> 
> I'm trying to parse bl2seq output but am not getting any data in the 
> returned object. My bl2seq output file contains an alignment, but it isn't 
> being loaded into an object, which is undefined.
> 
> I've tried by simply parsing the bl2seq report:
> 
> # make Seq objects for forward and reverse reads
> my $rev_hsp = Bio::Seq->new(-seq =>$proper_pairs{$ampl}{R}->query_string, 
> -alphabet => 'dna');
> my $fwd_hsp = Bio::Seq->new(-seq =>$proper_pairs{$ampl}{F}->query_string, 
> -alphabet => 'dna');
> 
> # make Blast factory and run bl2seq
> my $paired_blast_obj = Bio::Tools::Run::StandAloneBlast->new(-program => 
> 'blastn', -outfile => 'blast/paired_alignment/bl2seq.out');
> my $bl2seq_report = $paired_blast_obj->bl2seq($rev_hsp, $fwd_hsp);
> 
> # parse bl2seq report
> if(my $r = $bl2seq_report->next_result){
>   while( my $hit = $r->next_hit ) {
>     while( my $hsp = $hit->next_hsp ) {
>         print $hsp->get_aln->consensus_iupac()."\n";
>       }
>     }
> }
> 
> 
> And I've also tried with AlignIO:
> # read and parse bl2seq output file
> my $str = Bio::AlignIO->new(-file => 'blast/paired_alignment/bl2seq.out', 
> '-format' => 'bl2seq'); 
> while(my $aln = $str->next_aln() ){
>     print $aln->length . "\n";
> }
> 
> I've attached my bl2seq report (output file).
> 
> 
> 
> Any help would be greatly appreciated! 
> 
> 
> Emilie
> <CPCG0003F_PIK3CA_chr3_exon13_1_bl2seq.out>_______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l


On Aug 1, 2013, at 6:21 AM, Emilie Lalonde <emilie.lalonde at gmail.com> wrote:

> Hi all,
> 
> I'm trying to parse bl2seq output but am not getting any data in the 
> returned object. My bl2seq output file contains an alignment, but it isn't 
> being loaded into an object, which is undefined.
> 
> I've tried by simply parsing the bl2seq report:
> 
> # make Seq objects for forward and reverse reads
> my $rev_hsp = Bio::Seq->new(-seq =>$proper_pairs{$ampl}{R}->query_string, 
> -alphabet => 'dna');
> my $fwd_hsp = Bio::Seq->new(-seq =>$proper_pairs{$ampl}{F}->query_string, 
> -alphabet => 'dna');
> 
> # make Blast factory and run bl2seq
> my $paired_blast_obj = Bio::Tools::Run::StandAloneBlast->new(-program => 
> 'blastn', -outfile => 'blast/paired_alignment/bl2seq.out');
> my $bl2seq_report = $paired_blast_obj->bl2seq($rev_hsp, $fwd_hsp);
> 
> # parse bl2seq report
> if(my $r = $bl2seq_report->next_result){
>   while( my $hit = $r->next_hit ) {
>     while( my $hsp = $hit->next_hsp ) {
>         print $hsp->get_aln->consensus_iupac()."\n";
>       }
>     }
> }
> 
> 
> And I've also tried with AlignIO:
> # read and parse bl2seq output file
> my $str = Bio::AlignIO->new(-file => 'blast/paired_alignment/bl2seq.out', 
> '-format' => 'bl2seq'); 
> while(my $aln = $str->next_aln() ){
>     print $aln->length . "\n";
> }
> 
> I've attached my bl2seq report (output file).
> 
> 
> 
> Any help would be greatly appreciated! 
> 
> 
> Emilie
> <CPCG0003F_PIK3CA_chr3_exon13_1_bl2seq.out>_______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
jason.stajich at gmail.com
jason at bioperl.org





More information about the Bioperl-l mailing list