Bio-Cellucidate
view release on metacpan or search on metacpan
examples/full_example.pl view on Meta::CPAN
# Let's examine the agents, rules and models in my book
my $agents = Bio::Cellucidate::Book->agents($result->{id});
print "\nImported Agents:\n";
print Dumper $agents;
# Here is a detail of the first agent
my $agent = Bio::Cellucidate::Agent->get($agents->[0]->{id});
print "\nFirst Agent Detail:\n";
print Dumper $agent;
my $rules = Bio::Cellucidate::Book->rules($result->{id});
print "\nImported Rules:\n";
print Dumper $rules;
# Here is a detail of the first rule
my $rule = Bio::Cellucidate::Rule->get($rules->[0]->{id});
print "\nFirst Rule Detail:\n";
print Dumper $rule;
my $models = Bio::Cellucidate::Book->models($result->{id});
print "\nImported Models:\n";
print Dumper $models;
# Here is a detail of the first model
my $model = Bio::Cellucidate::Model->get($models->[0]->{id});
print "\nFirst Model Detail:\n";
print Dumper $model;
# Lets look at the initial conditions of our model.
my $ics = Bio::Cellucidate::Model->initial_conditions($model->{id});
print "\nInitial Conditions:\n";
print Dumper $ics;
# Here are the details of the first initial condition
my $ic = Bio::Cellucidate::InitialCondition->get($ics->[0]->{id});
print "\nFirst Initial Condition Detail:\n";
print Dumper $ic;
# Here are the model rules.
my $model_rules = Bio::Cellucidate::Model->model_rules($model->{id});
print "\nModel Rules for model:\n";
print Dumper $model_rules;
# Here is the detail of the first model rule
my $model_rule = Bio::Cellucidate::ModelRule->get($model_rules->[0]->{id});
print "\nModel Rule Detail:\n";
print Dumper $model_rule;
# There shouldn't be any simulation runs yet, but let's check
my $simulation_runs = Bio::Cellucidate::Model->simulation_runs($model->{id});
print "\nSimulation Runs for model:\n";
print Dumper $simulation_runs;
# Let's create a simulation run (2 iterations)!
my $simulation_run = Bio::Cellucidate::SimulationRun->create({ model_id => $model->{id}, num_iterations => 2 }); #, simulation_method => 'ODE' });
print "\nNewly created Simulation Run:\n";
print Dumper $simulation_run;
# Same pattern as import, poll and see when my run is complete...
while ($simulation_run->{state} ne 'succeeded') {
# Wait a few seconds..
sleep(2);
# Requery simulation
$simulation_run = Bio::Cellucidate::SimulationRun->get($simulation_run->{id});
printf "Simulation run state is %s. %.2f %% complete...\n",
$simulation_run->{state},
$simulation_run->{progress};
}
# Simulation is done, check it out
print "\nCompleted Simulation Run:\n";
print Dumper $simulation_run;
# Let's see all the data in CSV format for the simulation
my $simulation_csv = Bio::Cellucidate::SimulationRun->get($simulation_run->{id}, 'CSV');
print "\nSimluation Run CSV:\n";
print Dumper $simulation_csv;
# We can get the Plots
my $plots = Bio::Cellucidate::SimulationRun->plots($simulation_run->{id});
print "\nAll Plots from Simulation:\n";
print Dumper $plots;
# Detail for first plot
my $plot = Bio::Cellucidate::Plot->get($plots->[0]->{id});
print "\nFirst Plot Detail:\n";
print Dumper $plot;
# Get the plot in CSV
my $plot_csv = Bio::Cellucidate::Plot->get($plot->{id}, 'CSV');
print "\nFirst Plot in CSV:\n";
print Dumper $plot_csv;
__DATA__
'RBS transcription{58497}' DNA(binding!1,downstream!2,type~BBaB0000), RNAP(dna!1,rna!3), DNA(upstream!2,binding), RNA(downstream!3) -> DNA(binding,downstream!2,type~BBaB0000), RNAP(dna!1,rna!3), DNA(upstream!2,binding!1), RNA(downstream!4), RNA(bindi...
'Coding sequence translation{77005}' RNA(binding!1,type~BBaC0000), Ribosome(rna!1) -> RNA(binding,type~BBaC0000), Ribosome(rna), Repressor(dna) @ 10.0
'Transcription initiation of R0051{77270}' DNA(binding!1,type~BBaR0051p4,downstream!2), RNAP(dna!1,rna), DNA(upstream!2,binding) -> DNA(binding,type~BBaR0051p4,downstream!3), RNAP(dna!1,rna!2), DNA(upstream!3,binding!1), RNA(binding,upstream,downstre...
'LacI binding to R0010p3 (no LacI){77309}' DNA(binding,type~BBaR0010p3,upstream!2), LacI(dna,lactose), DNA(downstream!2,binding,type~BBaR0010p2) <-> DNA(binding!1,type~BBaR0010p3,upstream!3), LacI(dna!1,lactose), DNA(downstream!3,binding,type~BBaR001...
'TetR translation initiation{77281}' RNA(binding!2,downstream!1), RNA(binding,upstream!1,type~BBaC0040), Ribosome(rna!2) -> RNA(binding,downstream!1), RNA(binding!2,upstream!1,type~BBaC0040), Ribosome(rna!2) @ 0.167
'IPTG addition{77331}' -> IPTG(laci) @ 0.0
'C0040 transcription{77278}' DNA(binding!1,downstream!2,type~BBaC0040), RNAP(dna!1,rna!3), DNA(upstream!2,binding), RNA(downstream!3) -> DNA(binding,downstream!2,type~BBaC0040), RNAP(dna!1,rna!3), DNA(upstream!2,binding!1), RNA(downstream!4), RNA(bin...
'Transcription of R0051 (readthrough){77271}' DNA(binding,type~BBaR0051p3,downstream!2,upstream!3), RNAP(dna!1,rna!5), DNA(upstream!6,binding), DNA(upstream!4,downstream!3,binding,type~BBaR0051p2), DNA(downstream!4,binding!1,type~BBaR0051p1), RNA(dow...
'Repressor binding (no RNAP){76995}' DNA(downstream!1,binding,type~BBaR0000p2), DNA(upstream!1,binding,type~BBaR0000p3), Repressor(dna) <-> DNA(downstream!1,binding!2,type~BBaR0000p2), DNA(upstream!1,binding,type~BBaR0000p3), Repressor(dna!2) @ 0.016...
'Transcription of R0010 (readthrough){77317}' DNA(binding,type~BBaR0010p3,downstream!2,upstream!3), RNAP(dna!1,rna!5), DNA(upstream!6,binding), DNA(upstream!4,downstream!3,binding,type~BBaR0010p2), DNA(downstream!4,binding!1,type~BBaR0010p1), RNA(dow...
'Transcription of R0040 (readthrough){77306}' DNA(binding,type~BBaR0040p3,downstream!2,upstream!3), RNAP(dna!1,rna!5), DNA(upstream!6,binding), DNA(upstream!4,downstream!3,binding,type~BBaR0040p2), DNA(downstream!4,binding!1,type~BBaR0040p1), RNA(dow...
'Ribosome falloff{76777}' Ribosome(rna!1), RNA(binding!1) -> Ribosome(rna), RNA(binding) @ 0.01
'Transcription initiation{58498}' DNA(binding!1,type~BBaR0000p3,downstream!2), RNAP(dna!1,rna), DNA(upstream!2,binding) -> DNA(binding,type~BBaR0000p3,downstream!3), RNAP(dna!1,rna!2), DNA(upstream!3,binding!1), RNA(binding,upstream,downstream!2,type...
'RNAP falloff{76542}' DNA(binding!1,downstream!3), RNAP(dna!1,rna!2), RNA(downstream!2), DNA(upstream!3,binding!_) -> DNA(binding,downstream!1), RNAP(dna,rna), RNA(downstream), DNA(upstream!1,binding!_) @ 1.0
( run in 1.839 second using v1.01-cache-2.11-cpan-71847e10f99 )