Giter Site home page Giter Site logo

asleonard / polyomino_core Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 50 KB

Central repository for the lattice polyomino self-assembly model

Home Page: https://www.tcm.phy.cam.ac.uk/profiles/asl47/

License: MIT License

C++ 66.47% Python 33.53%
polyomino self-assembly evolution

polyomino_core's Introduction

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.

polyomino_core's People

Contributors

asleonard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.