π€ RAPS: R Aid for P systems
Welcome to the repository behind the RAPS
package.
NEWS: Last 21 / 11 / 2022 RAPS 1.0.0 was launched. Have a good time trying it!.
Quickstart
Run the following to install the package locally, directly from GitHub:
devtools::install_github("Xopre/RAPS")
Now you can run every example in the demos
β folder. Give the deterministic waiting time algorithm a try!
Main workflow with RAPS
:
graph TD;
url/path-->path2rap;
path2rap-->rap;
load_demo_dataset-->rap;
rap-->choose_rule;
choose_rule-->apply_rule;
apply_rule-->new_rap;
rap-->simulate;
simulate-->new_rap;
rap-->alg_gillespie_menv;
rap-->alg_det_menv;
alg_det_menv-->new_rap;
alg_gillespie_menv-->new_rap;
rap-->get_rule_by_id;
get_rule_by_id-->show_rule;
rap-->show_rap;
new_rap-->show_rap;
In RAPS
we use the rap
(Representing A P system) objects, which have the following aspect:
$Configuration
| Environment | ID | Label | Objects | SuperM | SubM | Charge | Other_params |
|ββββ-|β-|ββ-|ββββββ|βββ-|ββ-|βββ|βββββ|
| 1 | 1 | 1 | [(a, 1)] | 0 | [2,3] | -1 | @immutable |
| 1 | 2 | 2 | [(b, 2), (c,3)] | 1 | NULL | +1 | NA |
| 1 | 3 | 3 | [(@filler, 1)] | 1 | NULL | +1 | NA |
$Rules
| rule_id | dissolves | priority | main_membrane_label | lhs | rhs | propensity
|βββ|ββββ|βββ-|βββββββ|ββ|ββ|βββββ-|
| value0 | FALSE | - | 1 | $lhs_1$ | $rhs_1$ | 1974 |
$Properties
| System | PLingua_model | N_membranes | N_environments | N_objects | N_rules |
|βββ|βββββ|βββββ|βββββ|ββββ|βββ|
| FAS | Stochastic | 4 | 1 | 53 | 99 |
where:
\[lhs_1 = \begin{pmatrix} where & object & multiplicity \\ \hline \\ @here & a & 1 \\ mem_2 & b & 2 \\ @exists & mem_3 & 1 \\ \end{pmatrix}\] \[rhs_1 = \begin{pmatrix} where & object & multiplicity \\ \hline \\ @here & ap & 2 \\ mem_2 & bp & 3 \\ \end{pmatrix}\]Main functions
path2rap()
: Create arap
object from a path.alg_det_menv()
: Run the deterministic algorithm on arap
object.alg_gillespie_menv()
: Run the Gillespie algorithm on arap
object.simulate()
: Run a custom simulation algorithm on arap
object.show_rap()
: Show arap
object.apply_rule()
: Apply a rule to arap
object.choose_rule()
: Choose a rule to apply.
Supported rules
Supported rules:
- Evolution: $[u \rightarrow v]_i$
- In-communication: $[\ u \rightarrow v_1 \ [v_2]_j\ ]_i$
- Out-communication: $[\ u_1 \ [u_2]_j \rightarrow v\ ]_i$
- In/Out-communication: $[\ u_1 \ [u_2]_j \rightarrow v_1 \ [v_2]_k\ ]_i$
Will-be-supported rules, by priority:
- Charge change: $[u]_i^{\alpha} \rightarrow [v]_i^{\beta}$
- Dissolution: $[u \rightarrow v, \lambda]_i$
- Membrane generation: $u \rightarrow [\ ]_i$
- Membrane division: $[a]_i \rightarrow [b]_j [c]_k$
Might be supported but are nonstandard:
- Presence of one or more membranes: $[\ ]_i [\ ]_j \rightarrow a$
- Presence of the residual of an object: $a^0 \rightarrow b$
- Crazy multicommunication: $[u_1]i [u_2]_j [u_3]_k \rightarrow [v_1]{ip} [v_2]{jp} [v_3]{kp}$
Other stuff
General objectives:
- Create
README.md
- Complete
README.md
- Workflow diagram
- Functional demos
- Simulation of stochastic P systems
- Monoenvironmental Gillespie algorithm
- Multienvironmental Gillespie algorithm
- With control over time
- Validated with FAS
- Multienvironmental deterministic waiting time algorithm
- With control over time
- Validated with FAS
-
Establish the deprecated functions as such
- Prepare RAPS object for monoenvironmental P systems
-
Prepare RAPS object for multienvironmental P systems
- Adapt parser to P-Lingua 5 in function
path2rap()
- Create one or more simulators for RAPSβ objects
Repository contents
.Rproj.user/
: User data.demos/
: Examples of use of the RAPS package.man/
:roxygen2
-generated documentation.R/
: The functions included in this package.RData/
:RData
for some demos.renv/
: Folder for therenv
package.semantics/
: Folder for different semantics.utils/
: Some auxiliar code. Do not pay much attention.UPDATE.R
: Utility for updating the package.RAPS_package.Rmd
: The father ofUPDATE.R
.
.gitignore
: git-ignored files..Rbuildignore
: Build ignored files..Rhistory
: Ignore this. Should be empty..Rprofile
: My profile.DESCRIPTION
: Description of the package.NAMESPACE
:roxygen2
-generated documentation about exports.RAPS.Rproj
: The project wherein everything is developed.README.md
: The document youβre reading right now.renv.lock
: Info for therenv
package.
Future work
- Improve the R workflow within GitHub.
- Include the
tictoc
or thelubridate
packages to control time in a convenient way. - Design custom hexSticker.