intbio-ncl / shortbol

ShortBOL - A abstract language implementing the SBOL Data Model.
3 stars 1 forks source link

New composite templates possibly hide too much. #13

Closed MattyCrowther closed 4 years ago

MattyCrowther commented 4 years ago

Reproduce this problem: `TetR is a ProteinComponent() LacI is a ProteinComponent()

TetR_inv is a ProteinComponent() LacI_inv is a TetR_inverter is a ModuleDefinition()

toggleSwitch is a Module(TetR_inverter) ( description = "toggle switch" mapsUseLocal(TetR,TetR_inv) mapsUseLocal(LacI,LacI_inv) )`

So, I want an two instances of a CD which is used in the mapsUseLocal templates.

MattyCrowther commented 4 years ago

I think for this layer this issue is larger than anticipated, Initially decided to fully abstract away both FunctionalComponent and Component from the user. However, I think FunctionalComponents have to be explicitly defined by the user because they are actually variable. Components is another issue, where the user doesnt need to explicitly define there can be multip

MattyCrowther commented 4 years ago

le Components of a single ComponentDefinition. However this problem is a language problem as how do we implicitly create unique Components for each ComponentDefinition that the Component is inside?

Examples do illustrate both problems: There inst a solution to this that keeps FunctionalComponents implicit while allowing the same amount of control-ability as SBOL provides. Therefore I am changing back to:

TetR is a ProteinComponent()
LacI is a ProteinComponent()

TetR_fc is a InstanceOf(TetR)
LacI_fc is a InstanceOf(LacI)
TetR_inv_fc is a InstanceOf(TetR)
LacI_inv_fc is a InstanceOf(LacI)

# The TetR inverter module
TetR_inverter is a ModuleDefinition()
(
  description = "TetR inverter"
  inhibition(TetR_fc,LacI_fc)
)

#The toggle switch module
toggleSwitch is a Module(TetR_inverter)
(
  description = "toggle switch"
  mapsUseLocal(TetR_inv_fc,TetR_fc)
  mapsUseLocal(LacI_inv_fc,LacI_fc)
)

# The LacI inverter module
LacI_inverter is a ModuleDefinition()
(
  description = "LacI inverter"
  inhibition(LacI_inv_fc,TetR_inv_fc)
  module = toggleSwitch
)

This re-introduces FunctionalComponents in the form of a more descriptive name InstanceOf. If we introduce future layers rethinking the way the user writes the language would be advised.

Second problem: When the same ComponentDefinition (pConst) has two + Components of itself made. This problem can be solved in the same way as FunctionalComponent, but then we have regressed to basically the first layer. However, This problem I think can be bypassed easier because it is evident where the implicit Components are needed, however the challenge is making the implicit names unique. I tried using self. as the prefix so the name is prefixed by the Parent ComponentDefinition name but once the Component is given to the SequenceAnnotation self. value changes due to change in "scope". I tried adding a Parent language object that is similar to Self but I am struggling to implement. Any advice on these issues would be appreciated.

mKate_gene is a Promoter()
(
    precedes(pConst, mKate_cds)
)
Gal4VP16_gene is a Promoter()
(
    precedes(pConst,Gal4VP16_cds)
)
MattyCrowther commented 4 years ago

Closing this issue, I don't think much more can be done for layer 2. When new layers are outlined we can look into if these issues resurface.