Bio-Cellucidate

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

Cellucidate::SimulationRun

A simulation run represents an execution of the Cellucidate simulator and contains
child result resources.  Simulation runs define various settings.
A Model has one or many simulation runs and a simulation run belongs to
a model.


Cellucidate::OdeResult

Represents the set of ODE formulas generated when running a simulation in ODE-mode.
The results can be used directly in MATLAB.


Cellucidate::Plot

A plot contains a single time series and a number of data series representing the
rule and solution observables.  A simulation run has one or many plots (one for
each iteration).


lib/Bio/Cellucidate.pm  view on Meta::CPAN


=item L<Bio::Cellucidate::SimulationRun>

A simulation run represents an execution of the Cellucidate simulator and contains
child result resources.  Simulation runs define various settings.
A Model has one or many simulation runs and a simulation run belongs to
a model.

=item L<Bio::Cellucidate::OdeResult>

Represents the set of ODE formulas generated when running a simulation in ODE-mode.
The results can be used directly in MATLAB.

=item L<Bio::Cellucidate::Plot>

A plot contains a single time series and a number of data series representing the
rule and solution observables.  A simulation run has one or many plots (one for
each iteration).

=item L<Bio::Cellucidate::Series>

lib/Bio/Cellucidate/Base.pm  view on Meta::CPAN

    my $self = shift;
    my $format = shift;
    $CONTENT_TYPES[$format];
}

# find({ name => foo }, 'xml')
sub find {
    my $self = shift;
    my $args = $self->args(shift);
    my $format = shift;
    my $query = $self->formulate_query($args);
    $self->rest('GET', $self->route . "/$query", $format)->processResponseAsArray($self->element);
}

sub get {
    my $self = shift;
    my $id = shift;
    my $format = shift;
    $self->rest('GET', $self->route . "/" . $id, $format)->processResponse;
}

lib/Bio/Cellucidate/Base.pm  view on Meta::CPAN

    my $args = {};
    if (ref $_[0] eq 'HASH') {
        $args = @_;
    } elsif (scalar @_ && scalar @_ % 2 == 0) {
        $args = { @_ };
    }
    return $args->{$package} if $package;
    $args;
}

sub formulate_query {
    my $args = args(@_);
    my $query = '';
    foreach my $key (keys %{$args}) { 
        $query = '?' if $query eq '';
        $query .= "$key=" . $args->{$key} . "&"; 
    }
    $query;
}

1;

t/Base.t  view on Meta::CPAN

use t::TestHelper;

plan tests => 6;

use_ok('Bio::Cellucidate::Base');

# args
is_deeply(Bio::Cellucidate::Base->args( { foo => 'bar' }), { foo => 'bar' }, "Should parse arguments properly");
is_deeply(Bio::Cellucidate::Base->args('foo'), 'foo', "Should parse arguments properly");

# formulate_query
my $args = { foo => 'bar', fizzle => 'fuzzle' };
like(Bio::Cellucidate::Base->formulate_query($args), qr/^\?.*/, "Should parse arguments properly");
like(Bio::Cellucidate::Base->formulate_query($args), qr/foo=bar/, "Should parse arguments properly");
like(Bio::Cellucidate::Base->formulate_query($args), qr/fizzle=fuzzle/, "Should parse arguments properly");

1;



( run in 0.620 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )