[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.5, Tue Nov 3 21:20:07 2009 UTC
# Line 65  Line 65 
65    
66  =head2 Primary Methods  =head2 Primary Methods
67    
68    =head3 methods
69    
70        my $document = $coObject->methods();
71    
72    Return a list of the methods allowed on this object.
73    
74    =cut
75    
76    use constant METHODS => [qw(conserved_in_neighborhood
77                                pairsets
78                                clusters_containing
79                                related_clusters
80                                co_occurrence_evidence
81                                related_figfams
82                            )];
83    
84    sub methods {
85        # Get the parameters.
86        my ($self) = @_;
87        # Return the result.
88        return METHODS;
89    }
90    
91  =head3 conserved_in_neighborhood  =head3 conserved_in_neighborhood
92    
93      my $document = $coObject->conserved_in_neighborhood($args);      my $document = $coObject->conserved_in_neighborhood($args);
# Line 241  Line 264 
264    
265      my $document = $coObject->related_clusters($args);      my $document = $coObject->related_clusters($args);
266    
267  This method returns the functional-coupling clusters for features related  This method returns the functional-coupling clusters related to the specified
268  to the specified input features.  input features. Each cluster contains features on a single genome that are
269    related by functional coupling.
270    
271  =over 4  =over 4
272    
# Line 297  Line 321 
321      return $retVal;      return $retVal;
322  }  }
323    
324    =head3 co_occurrence_evidence
325    
326        my $document = $coObject->co_occurrence_evidence($args);
327    
328    For each specified pair of genes, this method returns the evidence that
329    the genes are functionally coupled (if any); that is, it returns a list
330    of the physically close homologs for the pair.
331    
332    =over 4
333    
334    =item args
335    
336    Reference to a hash containing the parameters.
337    
338    =item RETURN
339    
340    Returns a hash mapping each incoming gene pair to a list of 2-tuples. Each 2-tuple
341    contains a pair of physically close genes, the first of which is similar to the first
342    gene in the input pair, and the second of which is similar to the second gene in the
343    input pair. The hash keys will consist of the two gene IDs separated by a colon (e.g.
344    C<fig|273035.4.peg.1016:fig|273035.4.peg.1018>).
345    
346    =back
347    
348    =head4 Parameter Hash Fields
349    
350    =over 4
351    
352    =item -pairs
353    
354    Reference to a list of functionally-coupled pairs. Each pair is represented by two
355    FIG gene IDs, either in the form of a 2-tuple or as a string with the two gene IDs
356    separated by a colon.
357    
358    =back
359    
360    =cut
361    
362    sub co_occurrence_evidence {
363        # Get the parameters.
364        my ($self, $args) = @_;
365        # Declare the return variable.
366        my $retVal = {};
367        # Get the Sapling database.
368        my $sap = $self->{db};
369        # Get the list of pairs.
370        my $pairs = ServerThing::GetIdList(-pairs => $args);
371        # Loop through the pairs.
372        for my $pair (@$pairs) {
373            # Determine the IDs in this pair.
374            my ($peg1, $peg2);
375            if (ref $pair) {
376                ($peg1, $peg2) = @$pair;
377            } else {
378                ($peg1, $peg2) = split /:/, $pair;
379            }
380            # Get the evidence and store it in the return hash.
381            $retVal->{"$peg1:$peg2"} = FC::co_occurrence_evidence($sap, $peg1, $peg2);
382        }
383        # Return the result.
384        return $retVal;
385    }
386    
387    
388    
389  =head3 related_figfams  =head3 related_figfams
390    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3