object-oriented programming [2mm] for biomodellingsivanov/content/seminars/...postdoc: oop...

35
Object-oriented Programming for Biomodelling Sergiu Ivanov [email protected] Université Grenoble Alpes February 10, for RMoD

Upload: others

Post on 20-May-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Object-oriented Programming

for Biomodelling

Sergiu Ivanov

[email protected]

Université Grenoble Alpes

February 10, for RMoD

Page 2: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

My Previous Research on Formal Models

Rewriting

string rewriting

A B → B a

multiset rewriting

a

b

c

d

Machines

Register machinesR1

R2

...

Rn

Turing machines

a b 1· · · · · ·

qi

Apply to complex biological systems

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 1/14

Page 3: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

My Previous Research on Formal Models

Rewriting

string rewriting

A B → B a

multiset rewriting

a

b

c

d

Machines

Register machinesR1

R2

...

Rn

Turing machines

a b 1· · · · · ·

qi

Apply to complex biological systems

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 1/14

Page 4: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

My Previous Research on Formal Models

Rewriting

string rewriting

A B → B a

multiset rewriting

a

b

c

d

MachinesRegister machines

R1

R2

...

Rn

Turing machines

a b 1· · · · · ·

qi

Apply to complex biological systems

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 1/14

Page 5: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

My Previous Research on Formal Models

Rewriting

string rewriting

A B → B a

multiset rewriting

a

b

c

d

MachinesRegister machines

R1

R2

...

Rn

Turing machines

a b 1· · · · · ·

qi

Apply to complex biological systems

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 1/14

Page 6: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

In the Meantime, Much Programming▶ applications in research ▶ side projects

Functionalprogramming

Haskell

▶ solvers

▶ simulators

▶ teaching

Object-orientedprogramming

Python

▶ category theory module

for SymPy

C++ [no logo :-(]

▶ postdoc

Postdoc: OOP biomodellingapply

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 2/14

https://openclipart.org/

Page 7: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

In the Meantime, Much Programming▶ applications in research ▶ side projects

Functionalprogramming

Haskell

▶ solvers

▶ simulators

▶ teaching

Object-orientedprogramming

Python

▶ category theory module

for SymPy

C++ [no logo :-(]

▶ postdoc

Postdoc: OOP biomodellingapply

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 2/14

https://openclipart.org/

Page 8: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

In the Meantime, Much Programming▶ applications in research ▶ side projects

Functionalprogramming

Haskell

▶ solvers

▶ simulators

▶ teaching

Object-orientedprogramming

Python

▶ category theory module

for SymPy

C++ [no logo :-(]

▶ postdoc

Postdoc: OOP biomodellingapply

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 2/14

https://openclipart.org/

Page 9: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Postdoc: OOP biomodellingapply

▶ generic

▶ extensible

▶ parallel

Modelling framework

Goal:Develop a biomechanical model

of microtubules

▶ mass-spring-based

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 3/14

https://openclipart.org/

Page 10: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Outline

1. Microtubules: Biology and Modelling

2. Grid Registers

3. Grid Register Transformers

4. Real Coordinates

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling –/14

Page 11: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Outline

1. Microtubules: Biology and Modelling

2. Grid Registers

3. Grid Register Transformers

4. Real Coordinates

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling –/14

Page 12: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Microtubules▶ tubular polymers of tubuline▶ support the shape of the cell▶ support the cellular transport

The characteristic shapeand size of a microtubule.

Microtubules formdense structures.

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 4/14

Page 13: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Microtubules as Mass-spring Systems

Modelling microtubules as a system of masses con-

nected with springs gives good results.

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 5/14

Page 14: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Outline

1. Microtubules: Biology and Modelling

2. Grid Registers

3. Grid Register Transformers

4. Real Coordinates

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling –/14

Page 15: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Masses and Springs

mass

spring

agent

Discretise on a grid

▶ to simulate the diffusion of reactants

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 6/14

Page 16: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Masses and Springs

mass

springagent

Discretise on a grid

▶ to simulate the diffusion of reactants

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 6/14

Page 17: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Masses and Springs

mass

springagent

Discretise on a grid

▶ to simulate the diffusion of reactants

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 6/14

Page 18: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Grid Registers of Agents

agent = payload + cursor

The cursors handle (abstract away) the mouvement.

Register (grid of cursors)

cursor

payload

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 7/14

https://openclipart.org/

Page 19: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Grid Registers of Agents

agent = payload + cursor

The cursors handle (abstract away) the mouvement.

Register (grid of cursors)

cursor

payload

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 7/14

https://openclipart.org/

Page 20: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

What We Want: Grid Registers of Agents

agent = payload + cursor

The cursors handle (abstract away) the mouvement.

Register (grid of cursors)

cursor

payload

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 7/14

https://openclipart.org/

Page 21: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Registers of Cursors: Implementation

Grid3DRegister

Payload, Size

Cursor

movetrue/false

move

true/false

register:Grid3DRegister cursor:Cursor user

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 8/14

https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 22: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Outline

1. Microtubules: Biology and Modelling

2. Grid Registers

3. Grid Register Transformers

4. Real Coordinates

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling –/14

Page 23: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers

Register

Transformer▶ a kind of a register

▶ changes the way the

cursors move

▶ superposition of

behaviour

▶ transformers can besuperposed

wink-wink Haskell and monad transformers ;-)

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 9/14

https://openclipart.org/

Page 24: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers

Register

Transformer▶ a kind of a register

▶ changes the way the

cursors move

▶ superposition of

behaviour

▶ transformers can besuperposed

wink-wink Haskell and monad transformers ;-)

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 9/14

https://openclipart.org/

Page 25: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers

Register

Transformer▶ a kind of a register

▶ changes the way the

cursors move

▶ superposition of

behaviour

▶ transformers can besuperposed

wink-wink Haskell and monad transformers ;-)

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 9/14

https://openclipart.org/

Page 26: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers: Examples

Obstacles

Adaptors

▶ connect several registers

▶ connect a register to itself

[demo]

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 10/14

https://openclipart.org/

Page 27: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers: ImplementationExplode Grid3DRegister:

1Grid3DRegister

DefaultGrid3DRegister Transformer

Transformers are transparent to cursors:

movetrue/false

move

true/false

move

true/false

register transformer cursor user

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 11/14

https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 28: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Grid Register Transformers: ImplementationExplode Grid3DRegister:

1Grid3DRegister

DefaultGrid3DRegister Transformer

Transformers are transparent to cursors:

movetrue/false

move

true/false

move

true/false

register transformer cursor user

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 11/14

https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 29: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Outline

1. Microtubules: Biology and Modelling

2. Grid Registers

3. Grid Register Transformers

4. Real Coordinates

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling –/14

Page 30: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Cursors with Real Coordinates

RealCursor Cursor

Handles the discretisation.Handles the discretisation.

Real coordinates grid coordinatesinfluence

▶ unnecessary dependence

▶ difficult to maintain

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 12/14

https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 31: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Cursors with Real Coordinates

RealCursor Cursor

Handles the discretisation.Handles the discretisation.

Real coordinates grid coordinatesinfluence

▶ unnecessary dependence

▶ difficult to maintain

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 12/14

https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 32: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Real Coordinates + Transformers = ?

≪don’t know≫Transformer RealCursor

Cast is you friend.

▶ only at cursor creation

▶ everything works with casts

RealTransformer Transformer ??

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 13/14

https://openclipart.org/https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 33: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Real Coordinates + Transformers = ?

≪don’t know≫Transformer RealCursor

Cast is you friend.

▶ only at cursor creation

▶ everything works with casts

RealTransformer Transformer ??

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 13/14

https://openclipart.org/https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 34: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Real Coordinates + Transformers = ?

≪don’t know≫Transformer RealCursor

Cast is you friend.

▶ only at cursor creation

▶ everything works with casts

RealTransformer Transformer ??Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 13/14

https://openclipart.org/https://perso.ensta-paristech.fr/~kielbasi/tikzuml/

Page 35: Object-oriented Programming [2mm] for Biomodellingsivanov/content/seminars/...Postdoc: OOP biomodelling apply generic extensible parallel Modelling framework Goal: Develop a biomechanical

Conclusions and Open Questions

▶ OOP biomodellingapply

▶ agent = payload + cursor

▶ Transformer for compositional behaviour

? Transformer + RealCursor

Sergiu Ivanov, Université Grenoble Alpes Object-oriented Programming for Biomodelling 14/14

https://openclipart.org/https://perso.ensta-paristech.fr/~kielbasi/tikzuml/