[Bio] / FigKernelPackages / PinnedRegions.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/PinnedRegions.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1, Fri Nov 30 17:22:16 2007 UTC revision 1.2, Thu Dec 13 23:16:03 2007 UTC
# Line 187  Line 187 
187      # The sorting done here is for =selection= of the PEGs, not the display order      # The sorting done here is for =selection= of the PEGs, not the display order
188      my $collapse_close_genomes = $pin_desc->{'collapse_close_genomes'};      my $collapse_close_genomes = $pin_desc->{'collapse_close_genomes'};
189    
190      if ( $collapse_close_genomes eq 1 )      if ( $collapse_close_genomes == 1 )
191      {      {
192          # Sort on genus count [6], genus-species count [5], phylogenetic distance [4], organism name [1] and PEG id [0]          # Sort on genus count [6], genus-species count [5], phylogenetic distance [4], organism name [1] and PEG id [0]
193          @peg_data = sort {$a->[6] <=> $b->[6] or          @peg_data = sort {$a->[6] <=> $b->[6] or
# Line 225  Line 225 
225      }      }
226      else      else
227      {      {
228            # taking out the sorting, it turns out this is confusing to the user.
229    
230          # Separate pegs into diversity related categories relative to the input PEG:          # Separate pegs into diversity related categories relative to the input PEG:
231          # @same_org    same genus, same species, same strain          # @same_org    same genus, same species, same strain
232          # @same_gs     same genus, same species, different strain          # @same_gs     same genus, same species, different strain
233          # same_g       same genus, different species          # same_g       same genus, different species
234          # @rest        all others          # @rest        all others
235    
236          my $org    = $fig->org_of($peg);  #       my $org    = $fig->org_of($peg);
237          my($genus, $species) = split(/\s+/, $org);  #       my($genus, $species) = split(/\s+/, $org);
238    
239          my(@same_org, @same_gs, @same_g, @rest);  #       my(@same_org, @same_gs, @same_g, @rest);
240          foreach my $rec ( @peg_data )  #       foreach my $rec ( @peg_data )
241          {  #       {
242              my($org2, $genus2, $species2) = @$rec[1,2,3];  #           my($org2, $genus2, $species2) = @$rec[1,2,3];
243              if ( $org2 eq $org ) {  #           if ( $org2 eq $org ) {
244                  push @same_org, $rec;  #               push @same_org, $rec;
245              } elsif ( $genus2 eq $genus ) {  #           } elsif ( $genus2 eq $genus ) {
246                  if ( $species2 eq $species ) {  #               if ( $species2 eq $species ) {
247                      push @same_gs, $rec;  #                   push @same_gs, $rec;
248                  } else {  #               } else {
249                      push @same_g, $rec;  #                   push @same_g, $rec;
250                  }  #               }
251              } else {  #           } else {
252                  push @rest, $rec;  #               push @rest, $rec;
253              }  #           }
254          }  #       }
255    
256          # Sort on PEG id [0]  #       # Sort on PEG id [0]
257          @same_org = sort {$a->[0] cmp $b->[0]} @same_org;  #       @same_org = sort {$a->[0] cmp $b->[0]} @same_org;
258    
259          # Sort on PEG id [0], organism name [1] and phylogenetic distance [4]  #       # Sort on PEG id [0], organism name [1] and phylogenetic distance [4]
260          @same_gs  = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @same_gs;  #       @same_gs  = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @same_gs;
261          @same_g   = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @same_g;  #       @same_g   = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @same_g;
262          @rest     = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @rest;  #       @rest     = sort {$a->[4] <=> $b->[4] or $a->[1] cmp $b->[1] or $a->[0] cmp $b->[0]} @rest;
263    
264          @peg_data = (@same_org, @same_gs, @same_g, @rest);  #       @peg_data = (@same_org, @same_gs, @same_g, @rest);
265      }      }
266    
267      # Truncate list if necessary      # Truncate list if necessary

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3