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

Diff of /FigKernelPackages/ServerThing.pm

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

revision 1.40, Tue Mar 16 20:24:05 2010 UTC revision 1.42, Fri Mar 19 00:15:05 2010 UTC
# Line 513  Line 513 
513      # Declare the return variables.      # Declare the return variables.
514      my ($fileName, $genomeA, $genomeB);      my ($fileName, $genomeA, $genomeB);
515      # Determine the ordering of the genome IDs.      # Determine the ordering of the genome IDs.
516      if ($genome1 lt $genome2) {      if (MustFlipGenomeIDs($genome1, $genome2)) {
517          ($genomeA, $genomeB) = ($genome1, $genome2);          ($genomeA, $genomeB) = ($genome1, $genome2);
518      } else {      } else {
519          ($genomeA, $genomeB) = ($genome2, $genome1);          ($genomeA, $genomeB) = ($genome2, $genome1);
# Line 611  Line 611 
611  }  }
612    
613    
614    =head3 MustFlipGenomeIDs
615    
616        my $converse = ServerThing::MustFlipGenomeIDs($genome1, $genome2);
617    
618    Return TRUE if the specified genome IDs are out of order. When genome IDs are out of
619    order, they are stored in the converse order in correspondence files on the server.
620    This is a simple method that allows the caller to check for the need to flip.
621    
622    =over 4
623    
624    =item genome1
625    
626    ID of the proposed source genome.
627    
628    =item genome2
629    
630    ID of the proposed target genome.
631    
632    =item RETURN
633    
634    Returns TRUE if the first genome would be stored on the server as a target, FALSE if
635    it would be stored as a source.
636    
637    =cut
638    
639    sub MustFlipGenomeIDs {
640        # Get the parameters.
641        my ($genome1, $genome2) = @_;
642        # Return an indication.
643        return ($genome1 gt $genome2);
644    }
645    
646    
647  =head3 ReadGeneCorrespondenceFile  =head3 ReadGeneCorrespondenceFile
648    
649      my $list = ServerThing::ReadGeneCorrespondenceFile($fileName, $converse, $all);      my $list = ServerThing::ReadGeneCorrespondenceFile($fileName, $converse, $all);
# Line 728  Line 761 
761      my ($row) = @_;      my ($row) = @_;
762      # Flip the row in place.      # Flip the row in place.
763      ($row->[1], $row->[0], $row->[2], $row->[3], $row->[5], $row->[4], $row->[7],      ($row->[1], $row->[0], $row->[2], $row->[3], $row->[5], $row->[4], $row->[7],
764       $row->[6], ARROW_FLIP->{$row->[8]}, $row->[9], $row->[10], $row->[14],       $row->[6], $row->[8], $row->[9], $row->[10], $row->[14],
765       $row->[15], $row->[16], $row->[11], $row->[12], $row->[13], $row->[17]) = @$row;       $row->[15], $row->[16], $row->[11], $row->[12], $row->[13], $row->[17]) = @$row;
766        # Flip the arrow.
767        $row->[8] = ARROW_FLIP->{$row->[8]};
768        # Flip the pairs.
769        my @elements = split /,/, $row->[3];
770        $row->[3] = join(",", map { reverse split /:/, $_ } @elements);
771  }  }
772    
773  =head3 ValidateGeneCorrespondenceRow  =head3 ValidateGeneCorrespondenceRow

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.42

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3