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

Diff of /FigKernelPackages/ANNO.pm

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

revision 1.5, Fri May 21 16:08:22 2010 UTC revision 1.6, Wed Aug 25 15:49:01 2010 UTC
# Line 53  Line 53 
53                              find_rnas                              find_rnas
54                              assign_functions_to_DNA                              assign_functions_to_DNA
55                              find_special_proteins                              find_special_proteins
56                                assign_functions_to_dna_small
57                          )];                          )];
58    
59  sub methods {  sub methods {
# Line 153  Line 154 
154      return $retVal;      return $retVal;
155  }  }
156    
157    =head3 assign_functions_to_dna_small
158    
159        my $idHash =            $annoObject->assign_functions_to_dna_small({
160                                    -seqs => [[$id1, $comment1, $seq1],
161                                              [$id2, $comment2, $seq2],
162                                              ... ],
163                                    -kmer => 10,
164                                    -minHits => 3,
165                                    -maxGap => 600,
166                                });
167    
168    This method uses FIGfams to assign functions to sequences. It is intended for smaller
169    sequence sets than the main method, because it eschews the normal flow control; however,
170    it is easier to use for things like the EXCEL interface.
171    
172    The parameters are as follows.
173    
174    =item parameter
175    
176    The parameter should be a reference to a hash with the following keys.
177    
178    =over 8
179    
180    =item -seqs
181    
182    Reference to a list of 3-tuples, each consisting of (0) an arbitrary unique ID and
183    (1) a comment, and (2) a sequence associated with the ID.
184    
185    =item -kmer
186    
187    KMER size (7 to 12) to use for the FIGfam analysis. Larger sizes are faster, smaller
188    sizes are more accurate.
189    
190    =item -minHits (optional)
191    
192    A number from 1 to 10, indicating the minimum number of matches required to
193    consider a protein as a candidate for assignment to a FIGfam. A higher value
194    indicates a more reliable matching algorithm; the default is C<3>.
195    
196    =item -maxGap (optional)
197    
198    When looking for a match, if two sequence elements match and are closer than
199    this distance, then they will be considered part of a single match. Otherwise,
200    the match will be split. The default is C<600>.
201    
202    =back
203    
204    =item RETURN
205    
206    Returns a hash mapping each incoming ID to a list of hit regions. Each hit
207    region is a 5-tuple consisting of (0) the number of matches to the function, (1) the
208    start location, (2) the stop location, (3) the proposed function, and (4) the name
209    of the Genome Set from which the gene is likely to have originated.
210    
211    =back
212    
213    =cut
214    
215    sub assign_functions_to_dna_small {
216        # Get the parameters.
217        my ($self, $args) = @_;
218        # Get the Kmers object.
219        my $kmers = $self->{kmers};
220        # Analyze the options.
221        my $maxGap = $args->{-maxGap} || 600;
222        my $minHits = $args->{-minHits} || 3;
223        # Get the KMER size.
224        my $kmer = $args->{-kmer};
225        # Declare the return variable.
226        my $retVal = {};
227        # Get the sequence tuples.
228        my $seqs = ServerThing::GetIdList(-seqs => $args);
229        # Loop through the sequences, finding assignments.
230        for my $seqTuple (@$seqs) {
231            # Extract the ID and sequence.
232            my ($id, undef, $seq) = @$seqTuple;
233            # Compute the assignment.
234            my $assignment = $kmers->assign_functions_to_PEGs_in_DNA($kmer, $seq,
235                                                                     $minHits, $maxGap);
236            # Store the result.
237            $retVal->{$id} = $assignment;
238        }
239        # Return the results.
240        return $retVal;
241    }
242    
243    
244  =head2 Internal Utility Methods  =head2 Internal Utility Methods
245    
246    =head3 set_kmer_data
247    
248        $annoObject->set_kmer_data($kmers);
249    
250    Store the default KMER object for this annotation service.
251    
252    =cut
253    
254    sub set_kmer_data {
255        # Get the parameters.
256        my ($self, $kmers) = @_;
257        # Store the specified object.
258        $self->{kmers} = $kmers;
259    }
260    
261  =head3 get_max_subset  =head3 get_max_subset
262    
263      my ($max_variant, $max_size) = $ssObject->get_max_subset($sub, $setA);      my ($max_variant, $max_size) = $ssObject->get_max_subset($sub, $setA);

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3