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

Diff of /Sprout/SHSigGenes.pm

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

revision 1.1, Tue Sep 26 13:46:03 2006 UTC revision 1.2, Wed Sep 27 16:55:38 2006 UTC
# Line 100  Line 100 
100                                                    -value => $cutoff,                                                    -value => $cutoff,
101                                                    -size => 5)));                                                    -size => 5)));
102      push @rows, $self->SubmitRow();      push @rows, $self->SubmitRow();
103      # The next rows have the three genome menus.      # The next rows have the given genome and a feature filter.
104      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Given Genome"),      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Given Genome"),
105                           $cgi->td({colspan => 2}, $givenMenu));                           $cgi->td({colspan => 2}, $givenMenu));
106        push @rows, $self->FeatureFilterRows();
107        # Now show the target and exclusion menus.
108      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Target Genomes (Set 1)"),      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Target Genomes (Set 1)"),
109                           $cgi->td({colspan => 2}, $targetMenu));                           $cgi->td({colspan => 2}, $targetMenu));
110      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Exclusion Genomes (Set 2)"),      push @rows, $cgi->Tr($cgi->td({valign => "top"}, "Exclusion Genomes (Set 2)"),
# Line 132  Line 134 
134      # Get the sprout and CGI query objects.      # Get the sprout and CGI query objects.
135      my $cgi = $self->Q();      my $cgi = $self->Q();
136      my $sprout = $self->DB();      my $sprout = $self->DB();
137      # Declare the return variable.      # Declare the return variable. If it remains undefined, the caller will
138        # assume there was an error.
139      my $retVal;      my $retVal;
140        # Validate the numeric parameters.
141        my $commonality = $cgi->param('commonality');
142        my $cutoff = $cgi->param('cutoff');
143        if ($commonality !~ /^\s*\d(\.\d+)?\s*$/) {
144            $self->SetMessage("Commonality value appears invalid, too big, negative, or not a number.");
145        } elsif ($commonality <= 0 || $commonality > 1) {
146            $self->SetMessage("Commonality cannot be 0 and cannot be greater than 1.");
147        } elsif ($cutoff !~ /^\s*\d(.\d+)?(e\-\d+)?\s*$/) {
148            $self->SetMessage("Cutoff must be an exponential number (e.g. \"1e-20\" or \"2.5e-11\".");
149        } elsif ($cutoff > 1) {
150            $self->SetMessage("Cutoff cannot be greater than 1.");
151        } else {
152            # Now we need to gather and validate the genome sets.
153            my $givenGenomeID = $cgi->param('given');
154            my %targetGenomes = map { $_ => 1 } $cgi->param('target');
155            my %exclusionGenomes = map { $_ => 1 } $cgi->param('exclusion');
156            # Insure the given genome is not in the exclusion set.
157            if ($exclusionGenomes{$givenGenomeID}) {
158                $self->SetMessage("The given genome ($givenGenomeID) cannot be in the exclusion set.");
159            } else {
160                # Insure the given genome is in the target set.
161                $targetGenomes{$givenGenomeID} = 1
162            }
163            # Denote we have not yet found any genomes.
164            $retVal = 0;
165      # TODO: find stuff      # TODO: find stuff
166        }
167      # Return the result count.      # Return the result count.
168      return $retVal;      return $retVal;
169  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3