[Bio] / Sprout / SHSigGenes.pm Repository:
ViewVC logotype

Annotation of /Sprout/SHSigGenes.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     package SHSigGenes;
4 :    
5 :     use strict;
6 :     use Tracer;
7 :     use SearchHelper;
8 :     use CGI;
9 :     use HTML;
10 :     use Sprout;
11 : parrello 1.10 use Time::HiRes;
12 : parrello 1.1
13 :     our @ISA = qw(SearchHelper);
14 :    
15 :     =head1 Gene Discrimination Feature Search Helper
16 :    
17 :     =head2 Introduction
18 :    
19 :     This search performs a signature genes comparison. The user selects two genome sets,
20 :     and the search returns genes from a given genome which are common only in the first set
21 :     and not in the second. If the second set is empty, the search will return genes from
22 :     the given genome that are common in the first set.
23 :    
24 :     Gene identity will be computed in this case using bidirectional best hits. If gene X
25 :     from the given genome has a BBH in a specified genome Y, then it is said to occur
26 :     in whatever set includes genome Y. A gene is considered I<common> if it occurs in a
27 :     certain percentage of the genomes of the set.
28 :    
29 :     This search has the following extra parameters.
30 :    
31 :     =over 4
32 :    
33 :     =item given
34 :    
35 :     The ID of the given genome.
36 :    
37 :     =item target[]
38 :    
39 :     The IDs of the genomes in the first (target) set. The given genome is
40 :     automatically considered a part of this set, so it can never be empty.
41 :    
42 :     =item exclusion[]
43 :    
44 :     The IDs of the genomes in the second (exclusion) set. If this set is empty, then
45 :     no genes will be considered common in set 2, causing all genes common in set 1
46 :     to be selected.
47 :    
48 :     =item commonality
49 :    
50 :     Minimum score for a gene to be considered common. The score is equal to the number
51 :     of genomes containing a bidirectional best hit of the gene divided by the total
52 :     number of genomes. The default is C<0.8>. A value of C<1> means a gene must have
53 :     BBHs in all of the genomes to be considered common; a value of C<0> is invalid.
54 :    
55 :     =item cutoff
56 :    
57 :     Maximum match difference for a BBH hit to be considered valid. The default is C<1e-10>.
58 :    
59 :     =back
60 :    
61 :     =head2 Virtual Methods
62 :    
63 :     =head3 Form
64 :    
65 : parrello 1.7 C<< my $html = $shelp->Form(); >>
66 : parrello 1.1
67 :     Generate the HTML for a form to request a new search.
68 :    
69 :     =cut
70 :    
71 :     sub Form {
72 :     # Get the parameters.
73 :     my ($self) = @_;
74 :     # Get the CGI and sprout objects.
75 :     my $cgi = $self->Q();
76 :     my $sprout = $self->DB();
77 :     # Start the form.
78 :     my $retVal = $self->FormStart("Signature Genes");
79 :     # The bulk of this form will be two genome selection menus, one for the first
80 :     # (target) set and one for the second (exclusion) set. Above these two controls
81 :     # there is the selector for the given genome, the commonality and cutoff values,
82 :