[Bioperl-l] SearchIO

Detrix klew019 at aucklanduni.ac.nz
Wed Mar 28 00:23:36 EDT 2012


Hi,

Im new to perl/bioperl and I need to write a script for an assignment. The
background is that we BLAST searched a sequence on NCBI and came up with the
hits. What I have to do is write a script that only extracts the HSPs for
Mus musculus and mouse, but extract it and match it to each chromosome and
write it to a table outfile.

So far I have:


use strict;
use lib "C:/Program Files (x86)/BioPerl";


use Bio::SearchIO; 
my $parser = new Bio::SearchIO(-format => 'blast', 
                           -file   => 'nucleotide.pl');
                     
while (my $result = $parser->next_result) {
	
	while (my $hit = $result->next_hit) {

		if ($hit->description =~ /(Mus musculus)|(Mouse)/i) {
		
			while (my $hsp = $hit->next_hsp) {
   				
	  
        		print
              	" Hit=", $hit->description, "\n";
             	print
             	" HSPs=", $hit->num_hsps, "\n";
            
			}           
		}
	}
}



What this gets me is the list of all the descriptions of the hits (mouse and
mus musculus), and the HSPs for them. What I need now is to sort all the
HSPs for each particular chromosome, and write it to a table outfile. I
think what I have to do is sort it into an associative array, but all
attempts at it I have failed. Im lost, so any help would be greatly
appreciated!

Thanks


-- 
View this message in context: http://old.nabble.com/SearchIO-tp33544807p33544807.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.



More information about the Bioperl-l mailing list