sub filter_by_Species() { print("New Blast File Opened
"); open( NEWALIGN, ""); #PARSE BLAST RESULT HERE.... #read results file one line at a time my @resultLine = ; # used instead of BLASTFILE my $alignment = {}; # reference to an empty hash my @subjects = []; # reference to empty array my $current_subject = "front_matter"; $alignment->{$current_subject} = ""; #so I produce a hash with key = >gi line of report and value = all lines after until next >gi for (my $i = 0 ; $i/) { $current_subject = $resultLine[ $i ]; chomp ($current_subject); push (@subjects, $current_subject); $alignment->{$current_subject} = ""; #$alignment->{$current_subject} means give value of $alignment when $current_subject is the key } $alignment->{$current_subject} = $alignment->{$current_subject}.$resultLine[ $i ]; } my @elements; my $boolean; print(""); print(""); print(""); foreach my $z (@subjects) { chomp $z; @elements = split('\|', $z); if($elements[4] =~ /^$species_filter/) ##### filtering part here { $boolean = 0; print ("
StatusInformation on new hits
Match to $species_filter"); show_Output($boolean, $z, @elements); } } print("


"); #close files close NEWALIGN; } ################################################################################ # Display the blast results to user in easy to view format sub show_Output() # HTML code { my ($boolean, $z, @elements_copy) = @_; $elements_copy[1] = 'Link"; if($boolean == 0) { print(" $z @elements_copy[1]"); } else { print(" $z
  - New value added to new reference list  @elements_copy[1]"); } }