Skip to content

ASLeonard/polyomino_core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polyomino self-assembly core

Codacy Badge License Badge

Base repository for the polyomino model development. This is mainly useful for extending the functionality provided here in a new repository, using this one as a submodule. For an example, see an example here.

Extending the polyomino core model

Including this repository as a submodule allows for rapid prototyping of the polyomino model.

Generic assembly can be quickly implemented using existing functions. Extending the model requires

  • extend base assembly (using the curiously recursive template pattern)
class NewAssemblyModel : public PolyominoAssembly<NewAssemblyModel>
  • determine the interface type (e.g. integer, string, something more complex, etc.)
using subunit_type = ...
using Genotype = std::vector<subunit_type>
  • implement the interaction matrix that returns the interaction strength between two interfaces
double NewAssemblyModel::InteractionMatrix(subunit A, subunit B)
  • optional features to implement may include more specific methods
    • mutations
    • random initilising
    • reversing alignment

Using the core model

The main calls to the core model are to the assembly and classification functions

  • get interaction edges
const auto edges = NewAssemblyModel::GetActiveInterfaces(genotype)
  • assemble polyomino (and track edges used in assembly)
auto [assembly_information,interacting_indices] = NewAssemblyModel::AssemblePolyomino(edges)
  • get phenotype from the raw assembly information
Phenotype phen=GetPhenotypeFromGrid(assembly_information)
  • potentially classify phenotype using a runtime filled table
Phenotype_ID pid = phenotypeTable->GetPhenotypeID(phen)

More robust examples available in the implementation of polyomino_interfaces model

Building

The core library is header only, so need to add an include path to whatever building process used

-Ipath/to/library/polyomino_core

Some of the code makes use of the relatively modern c++17, and so a relatively up to date compiler may be needed. Again a more full example of a makefile used in compiling may be found in the polyomino_iterfaces repository.

Visuals

There are some skeleton methods in python3 to plot polyominoes and more elaborate interactive plots to show evolutionary transitions between polyominoes, but these are still under design and development.

About

Central repository for the lattice polyomino self-assembly model

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published