#!/usr/bin/perl use warnings; use strict; use Bio::SearchIO; use Bio::AlignIO; my $out = ">C:/Documents and Settings/mgavi.brathwaite/Desktop/current +/bl2seq/13117_aln1.out"; my $dir = 'C:/Documents and Settings/mgavi.brathwaite/Desktop/current/ +bl2seq/'; my $in = new Bio::SearchIO(-format => 'blast', -file => $dir.'13117_2.out', -report_type => 'bl2seq'); while( my $result = $in->next_result ) { while( my $hit = $result->next_hit ) { while( my $hsp = $hit->next_hsp ) { if( $hsp->length('total') > 1000 ) { if ( $hsp->percent_identity >= 90 ) { if( $hsp->score ){ if( $hsp->gaps ){ if( $hsp->expect ){ print "Hit= ", $hit->name, " Length=", $hsp->length('total'), " Score=", $hsp->score,"\n"; print " Gaps=", $hsp->gaps, " Expect=", $hsp->expect, " Percent_id=", $hsp->percent_identity, "\n"; =cut # $hit->name, $hit->hsps, $hit->name, $hsp->length('total'), $hsp->score, $hsp->gaps, $hsp->expect, $hsp->percent_identity; =cut my $aln = $hsp->get_aln; my $alnIO = Bio::AlignIO->new(-format =>"clustalw" +, -file => $out); $alnIO->write_aln($aln); } } } } } } } }
I can get the alignment, but I also need the print data
to be prepended at the top of the $out file.

In reply to Re^2: parsing blast output by lomSpace
in thread parsing blast output by lomSpace

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.