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

Diff of /FigKernelPackages/CO.pm

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

revision 1.3, Tue Oct 20 20:37:30 2009 UTC revision 1.6, Fri Dec 4 20:12:14 2009 UTC
# Line 43  Line 43 
43    
44  =head3 new  =head3 new
45    
46      my $coObject = CO->new();      my $coObject = COserver->new();
47    
48  Create a new co-occurrence server function object. The server function object  Create a new co-occurrence server function object. The server function object
49  contains a pointer to a L<Sapling> object, and is used to invoke the  contains a pointer to a L<Sapling> object, and is used to invoke the
# Line 51  Line 51 
51    
52  =cut  =cut
53    
54    #
55    # Actually, if you are using CO.pm, you should do CO->new(), not COserver->new()
56    # That comment above is for the benefit of the pod doc stuff on how to use COserver
57    # that is generated from this file.
58    #
59    
60  sub new {  sub new {
61      my ($class) = @_;      my ($class) = @_;
62      # Create the sapling object.      # Create the sapling object.
# Line 65  Line 71 
71    
72  =head2 Primary Methods  =head2 Primary Methods
73    
74    =head3 methods
75    
76        my $document = $coObject->methods();
77    
78    Return a list of the methods allowed on this object.
79    
80    =cut
81    
82    use constant METHODS => [qw(conserved_in_neighborhood
83                                pairsets
84                                clusters_containing
85                                related_clusters
86                                co_occurrence_evidence
87                                related_figfams
88                            )];
89    
90    sub methods {
91        # Get the parameters.
92        my ($self) = @_;
93        # Return the result.
94        return METHODS;
95    }
96    
97  =head3 conserved_in_neighborhood  =head3 conserved_in_neighborhood
98    
99      my $document = $coObject->conserved_in_neighborhood($args);      my $document = $coObject->conserved_in_neighborhood($args);
# Line 241  Line 270 
270    
271      my $document = $coObject->related_clusters($args);      my $document = $coObject->related_clusters($args);
272    
273  This method returns the functional-coupling clusters for features related  This method returns the functional-coupling clusters related to the specified
274  to the specified input features.  input features. Each cluster contains features on a single genome that are
275    related by functional coupling.
276    
277  =over 4  =over 4
278    
# Line 297  Line 327 
327      return $retVal;      return $retVal;
328  }  }
329    
330    =head3 co_occurrence_evidence
331    
332        my $document = $coObject->co_occurrence_evidence($args);
333    
334    For each specified pair of genes, this method returns the evidence that
335    the genes are functionally coupled (if any); that is, it returns a list
336    of the physically close homologs for the pair.
337    
338    =over 4
339    
340    =item args
341    
342    Reference to a hash containing the parameters.
343    
344    =item RETURN
345    
346    Returns a hash mapping each incoming gene pair to a list of 2-tuples. Each 2-tuple
347    contains a pair of physically close genes, the first of which is similar to the first
348    gene in the input pair, and the second of which is similar to the second gene in the
349    input pair. The hash keys will consist of the two gene IDs separated by a colon (e.g.
350    C<fig|273035.4.peg.1016:fig|273035.4.peg.1018>).
351    
352    =back
353    
354    =head4 Parameter Hash Fields
355    
356    =over 4
357    
358    =item -pairs
359    
360    Reference to a list of functionally-coupled pairs. Each pair is represented by two
361    FIG gene IDs, either in the form of a 2-tuple or as a string with the two gene IDs
362    separated by a colon.
363    
364    =back
365    
366    =cut
367    
368    sub co_occurrence_evidence {
369        # Get the parameters.
370        my ($self, $args) = @_;
371        # Declare the return variable.
372        my $retVal = {};
373        # Get the Sapling database.
374        my $sap = $self->{db};
375        # Get the list of pairs.
376        my $pairs = ServerThing::GetIdList(-pairs => $args);
377        # Loop through the pairs.
378        for my $pair (@$pairs) {
379            # Determine the IDs in this pair.
380            my ($peg1, $peg2);
381            if (ref $pair) {
382                ($peg1, $peg2) = @$pair;
383            } else {
384                ($peg1, $peg2) = split /:/, $pair;
385            }
386            # Get the evidence and store it in the return hash.
387            $retVal->{"$peg1:$peg2"} = FC::co_occurrence_evidence($sap, $peg1, $peg2);
388        }
389        # Return the result.
390        return $retVal;
391    }
392    
393    
394    
395  =head3 related_figfams  =head3 related_figfams
396    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3