Bio-FdrFet
view release on metacpan or search on metacpan
lib/Bio/FdrFet.pm view on Meta::CPAN
$obj->pathways[($order)];
$obj->pathway_result($pathway, $data_name[, $all_flag]);
$obj->pathway_desc($pathway);
$obj->pathway_genes($pathway);
$obj->fdr_position($fdr);
=head3 Other Methods
$obj->gene_count[($fet_gene_count)];
$obj->calculate;
=head1 DESCRIPTION
Bio::FdrFet implements the False Discovery Rate Fisher Exact Test of gene
expression analysis applied to pathways described in the paper by
Ruiru Ji, Karl-Heinz Ott, Roumyana Yordanova, and Robert E
Bruccoleri. A copy of the paper is included with the distribution in
the file, Fdr-Fet-Manuscript.pdf.
The module is implemented using a simple object oriented paradigm
where the object stores all the information needed for a calculation
along with a state variable, C<STATE>. The state variable has two
possible values, C<'setup'> and C<'calculated'>. The value of
C<'setup'> indicates that the object is being setup with data, and any
results in the object are inconsistent with the data. The value of
C<'calculated'> indicates that the object's computational results are
consistent with the data, and may be returned to a calling program.
The C<'calculate'> method is used to update all the calculated values
from the input data. It checks the state variable first, and only does
the calculation if the state is C<'setup'>. Once the calculations are
complete, then the state variable is set to C<'calculated'>. Thus, the C<calculate> method
can be called whenever a calculated value is needed, and there is no
performance penalty.
The module initializes the C<Bio::FdrFet> object with a state of
C<'setup'>. Any data input sets the state to C<'setup'>. Any requests
for calculated data, calls C<'calculate'>, which updates the state
variable so futures requests for calculated data return quickly.
=head1 METHODS
The following methods are provided:
=over 4
=cut
=item C<new([$fdrcutoff])>
Creates a new Bio::FdrFet object. The optional parameter is the False
Discovery Rate cutoff in units of percent. See the C<fdr_cutoff>
method below for more details.
=cut
sub new {
my $pkg;
my $class = shift;
eval {($pkg) = caller(0);};
if ($class ne $pkg) {
unshift @_, $class;
}
my $self = {};
bless $self;
my $cutoff = shift;
$cutoff = 35 if not defined $cutoff;
$self->{STATE} = "setup";
$self->{FDR_CUTOFF} = _check_fdr_cutoff($cutoff);
$self->{PATHWAYS} = {};
$self->{GENES} = {};
$self->{INPUT_GENE_COUNT} = 0;
$self->{GENE_COUNT} = undef;
$self->{VERBOSE} = 1;
$self->{UNIVERSE} = "genes";
return $self;
}
=item C<fdr_cutoff([$fdrcutoff])>
Retrieves the current setting for the False Discovery Rate threshold,
and optionally sets it. This threshold must be an integer greater than
0 and less than or equal to 100, and is divided by 100 for the value
used by the computation.
=cut
sub fdr_cutoff {
my $self = shift;
my $new_cutoff = shift;
if (defined($new_cutoff)) {
$self->{FDR_CUTOFF} = _check_fdr_cutoff($new_cutoff);
$self->{STATE} = 'setup';
}
return $self->{FDR_CUTOFF};
}
=item C<verbose([$verbose_mode])>
Retrieves the current setting for the verbose parameter
and optionally sets it. It can be either 0, no verbosity, or 1, lots
of messages sent to STDERR.
=cut
sub verbose {
my $self = shift;
my $new_verbose = shift;
if (defined($new_verbose)) {
$self->{VERBOSE} = $new_verbose;
}
return $self->{VERBOSE};
}
=item C<universe([$universe_option])>
Retrieves the current setting for the B<universe> option
and optionally sets it. The B<universe> option specifies how the number of
( run in 2.000 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )