[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.52, Mon Jun 14 14:36:02 2010 UTC revision 1.53, Thu Jul 8 20:15:39 2010 UTC
# Line 866  Line 866 
866      return $retVal;      return $retVal;
867  }  }
868    
869    =head3 GetCorrespondenceData
870    
871        my $corrList = ServerThing::GetCorrespondenceData($genome1, $genome2, $passive, $full);
872    
873    Return the L</Gene Correspondence List> for the specified source and target genomes. If the
874    list is in a file, it will be read. If the file does not exist, it may be created.
875    
876    =over 4
877    
878    =item genome1
879    
880    ID of the source genome.
881    
882    =item genome2
883    
884    ID of the target genome.
885    
886    =item passive
887    
888    If TRUE, then the correspondence file will not be created if it does not exist.
889    
890    =item full
891    
892    If TRUE, then both directions of the correspondence will be represented; otherwise, only
893    correspondences from the source to the target (including bidirectional corresopndences)
894    will be included.
895    
896    =item RETURN
897    
898    Returns a L</Gene Correspondence List> in the form of a reference to a list of lists, or an
899    undefined value if an error occurs or no file exists and passive mode was specified.
900    
901    =back
902    
903    =cut
904    
905    sub GetCorrespondenceData {
906        # Get the parameters.
907        my ($genome1, $genome2, $passive, $full) = @_;
908        # Declare the return variable.
909        my $retVal;
910        # Check for a gene correspondence file.
911        my ($fileName, $converse) = ServerThing::CheckForGeneCorrespondenceFile($genome1, $genome2);
912        if ($fileName) {
913            # Here we found one, so read it in.
914            $retVal = ServerThing::ReadGeneCorrespondenceFile($fileName, $converse, $full);
915        }
916        # Were we successful?
917        if (! defined $retVal) {
918            # Here we either don't have a correspondence file, or the one that's there is
919            # invalid. If we are NOT in passive mode, then this means we need to create
920            # the file.
921            if (! $passive) {
922                ($fileName, $converse) = ServerThing::CreateGeneCorrespondenceFile($genome1, $genome2);
923                # Now try reading the new file.
924                if (defined $fileName) {
925                    $retVal = ServerThing::ReadGeneCorrespondenceFile($fileName, $converse);
926                }
927            }
928        }
929        # Return the result.
930        return $retVal;
931    
932    }
933    
934    
935  =head2 Internal Utility Methods  =head2 Internal Utility Methods
936    

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3