SynBioWeaver Package Reference¶
-
exception
synbioweaver.core.AspectValueError[source]¶ Bases:
exceptions.ValueErrorAn Aspect class was expected, but something else given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.CircuitValueError[source]¶ Bases:
exceptions.ValueErrorA Circuit class was expected, but something else given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidAdviceMethodError[source]¶ Bases:
exceptions.ValueErrormethod with 2 parameters expected, but something else given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidPointCutError[source]¶ Bases:
exceptions.ValueErrorobject of type PointCut expected, but something else given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidPointCutExpressionError[source]¶ Bases:
exceptions.ValueErrorThere is an error in a Point Cut expression
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidPointCutOperatorError[source]¶ Bases:
exceptions.ValueErrorAn unknown or illegal operator was used for the point cut
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidSignatureError[source]¶ Bases:
exceptions.ValueErrorA signature (PointCut / Part / Molecule) is incorrectly formatted or typed
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidSymbolNameError[source]¶ Bases:
exceptions.ValueErrorA symbol name (string) was not correctly formatted
-
args¶
-
message¶
-
-
exception
synbioweaver.core.InvalidWeaverOutputMethodError[source]¶ Bases:
exceptions.ValueErrorwith 2 parameters expected, but something else given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.MoleculeValueError[source]¶ Bases:
exceptions.ValueErrorMolecule was expected, but something else was given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.PartInitializationError[source]¶ Bases:
exceptions.ExceptionPart was expected, but something else was given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.PartValueError[source]¶ Bases:
exceptions.ValueErrorPart was expected, but something else was given
-
args¶
-
message¶
-
-
exception
synbioweaver.core.PrecedenceOutOfRangeError[source]¶ Bases:
exceptions.ValueErrorAn unknown or illegal operator was used for the point cut
-
args¶
-
message¶
-
-
exception
synbioweaver.core.SymbolExistsWarning[source]¶ Bases:
exceptions.UserWarningA Part or Molecule declaration uses an existing name
-
args¶
-
message¶
-
-
class
synbioweaver.core.Advice(pointcut, adviceMethod, precedence=0)[source]¶ Bases:
objectContainer for Advice
Attributes:precedence : int - High precedence advice have execution priority over low precedence- MINPRECEDENCE <= precedence <= MAXPRECEDENCE is the valid rangepointcut : PointCutadviceMethod : method - The method to be executed at the advice- must have 2 parameters: self and PointCutContext-
MAXPRECEDENCE= 100¶
-
MINPRECEDENCE= 0¶
-
-
class
synbioweaver.core.Aspect[source]¶ Bases:
objectAbstract class for an Aspect | Will generally be used to represent a design’s cross-cutting concerns
Notes:Any child must implement mainAspect methodAttributesweaver: WeaverThe weaver which compiles the aspectadviceList - A list of all advice this aspect declarestypeAdviceList - A list of all type advice this aspect declaresweaverOutputList - A list of all type advice for the WeaverOutput-
addAdvice(pointcut, adviceMethod, precedence=0)[source]¶ Declare a new advice in the aspect
Args:pointcut - The pointcut for the adviceadviceMethod - The method to be executed at the pointcutshould be a method bound to this aspect, with second parameterexpecting a PointCutContext objectprecedence : integer (optional) - set precedence of advice,see notes on Advice.precedenceNotes:addAdvice constructs an Advice object. Further information thuscan be found there.
-
addCircuit(circuit)[source]¶ Add a circuit as a sub-compartment in the current compartment
Args:circuit: Circuit to be added as a sub-compartment
-
addPart(part)[source]¶ Used to add parts to the design by passing them on to the AOSB Weaver
Args:part: The part to be added to the circuit
-
addTypeAdvice(signature, typeaddition, name)[source]¶ Declare a type advice in the aspect
Args:signature - The signature for the type advicetypeaddition - The attribute / method to be added to the typename: str - The name for the typeaddition in the new typeNotes:addTypeAdvice constructs an TypeAdvice object.Further information thus can be found there.
-
addWeaverOutput(outputmethod)[source]¶ Declare a new weaver output target
Args:outputMethod - The method to be added to the WeaverOutputRaises:InvalidWeaverOutputMethodError -If outputmethod is not a method or has wrong number of parameters(needs to accept self and a WeaverOutput reference)
-
createMolecule(molecule)[source]¶ Declare that a particular molecule exists in the current scope
Args:molecule
-
exportMolecule(molecule)[source]¶ Export a particular molecule from this compartment to the outer compartment
Args:molecule
-
importMolecule(molecule)[source]¶ Import a particular molecule from the outer compartment to this compartment
Args:molecule
-
mainAspect()[source]¶ Entry point for an aspect, analogous to “main” in a program | Needs to be implemented by any sub class. | mainAspect will be called by the AOSB Weaver.
-
reactionFrom(*molecules)[source]¶ Used to add a reaction to the aspect by passing the reactions left side on to the AOSB Weaver
Args:*molecules: a list of one or more molecules on the lhs of the reaction
-
-
class
synbioweaver.core.Circuit[source]¶ Bases:
synbioweaver.core.PartAbstract class for a genetic part circuit.
Will generally be used to represent a design’s core concernsAdditionally, a circuit can be used to represent composite partsAttributes:weaver: WeaverThe weaver which compiles the circuit-
addCircuit(circuit)[source]¶ Add a circuit as a sub-compartment in the current compartment
Args:circuit: Circuit to be added as a sub-compartment
-
addPart(part)[source]¶ Used to add parts to the circuit by passing them on to the AOSB Weaver
Args:part: The part to be added to the circuit
-
createMolecule(molecule)[source]¶ Declare that a particular molecule exists in the current scope
Args:molecule
-
exportMolecule(molecule)[source]¶ Export a particular molecule from this compartment to the outer compartment
Args:molecule
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
importMolecule(molecule)[source]¶ Import a particular molecule from the outer compartment to this compartment
Args:molecule
-
mainCircuit()[source]¶ Entry point for a circuit, analogous to “main” in a program
Needs to be implemented by any sub class.mainCircuit will be called by the AOSB Weaver.
-
reactionFrom(*molecules)[source]¶ Used to add a reaction to the circuit by passing the reactions left side on to the AOSB Weaver
Args:*molecules: a list of one or more molecules on the lhs of the reaction
-
reactionTo(*molecules)[source]¶ Used to add a reaction to the circuit by passing the reactions right side on to the AOSB Weaver
Args:*molecules: a list of one or more molecules on the rhs of the reaction
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setWeaver(weaver)[source]¶ Internal - Should not be used outside of the framework.
Sets the Weaver Object of this Circuit
Args:weaver: A weaver object that will be used
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.CodingRegion(codesFor)[source]¶ Bases:
synbioweaver.core.PartClass for parts that are Coding Regions
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.ConstitutivePromoter[source]¶ Bases:
synbioweaver.core.PromoterClass for Promoters that are Constitutive Promoters
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.ExecutionNode[source]¶ Bases:
objectAbstract Superclass for all nodes in an execution flow, e.g. parts, molecules
Parts are the atomistic instructions in the genetic circuit execution flow
Attributes:before : [ExecutionNode]A list of ExecutionNode objects that precede this nodeafter : [ExeuctionNode]A list of ExecutionNode objects that follow this nodescope : class(WeaverOutput)What woven system is this node part ofadditionStack : [Circuit or Aspect]stack of Aspects and Circuits which are executing to addthis node
-
class
synbioweaver.core.HybridPromoter(regulatedBy, regulatorInfo)[source]¶ Bases:
synbioweaver.core.PromoterClass for Promoters that are Hybrid Promoters, i.e. with several repressing / inducing operator sites
like other regulated Promoters (NegativePromoter, PostiivePromoter), its regulators are accessible by getRegulatedBy(). Additionally, getInducers(), getRepressors(), and isInducer(molecule), isRepressor(molecule) give information about the functionality of the Promoter.
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.Molecule[source]¶ Bases:
synbioweaver.core.ExecutionNodeAbstract Superclass for all Molecules
Molecules are the nodes in the execution flow, for example: reactions: (MoleculeA+MoleculeB -> MoleculeC), translation: CodingRegion->MoleculeA, inducing: MoleculeA -> RegulatdPromoter, membrane transfer: MoleculeA (Compartment) -> MoleculeA (Outside Compartment)
These nodes in the execution flow don’t mean an existence of an element, but rather describe the information flow within the system.
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
-
class
synbioweaver.core.MoleculeSignature(signature)[source]¶ A MoleculeSignature, used for Type Advice of Molecules
Attributes:namespace : [PartSignatureElement] - List of signature parts of the signaturemolecule : MoleculeSignatureElement - The “part” part of the signature
-
class
synbioweaver.core.MoleculeSignatureElement(signature)[source]¶ Bases:
synbioweaver.core.PartSignatureElementA PartSignatureElement that is a Molecule Signature | Overloads some methods, since MoleculeSignature is used by the user for | Molecule Type Advice - unlike PartSignatureElement, which is internal
-
ANY= 1¶
-
CLASSONLY= 3¶
-
SUBCLASS= 2¶
-
-
class
synbioweaver.core.NegativePromoter(regulatedBy)[source]¶ Bases:
synbioweaver.core.PromoterClass for Promoters that are Negative Promoters
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.NotOnStack(signature)[source]¶ Bases:
synbioweaver.core.PointCutExpressionNode-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
-
class
synbioweaver.core.OnStack(signature)[source]¶ Bases:
synbioweaver.core.PointCutExpressionNode-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
-
class
synbioweaver.core.Part[source]¶ Bases:
synbioweaver.core.ExecutionNodeAbstract Superclass for all Parts
Parts are the atomistic instructions in the genetic circuit execution flow, e.g. Promoters, RBSs, Terminators, Coding Regions They inherit their functionality as nodes in the execution flow from their superclass ExecutionNode
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
setAfterPart(part)[source]¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
-
class
synbioweaver.core.PartSignature(signature)[source]¶ Bases:
synbioweaver.core.PointCutExpressionNodeA PartSignature, used in PointCut expressions or directly for Type Advice
Attributes:namespace : [PartSignatureElement] - List of signature parts of the signaturepart : PartSignatureElement - The “part” part of the signaturemolcule : PartSignatureElement - The molecule part of the signaturenomolecule : Boolean -If the PartSignature explicitly should not match parts with molecules-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
-
class
synbioweaver.core.PartSignatureElement(signature)[source]¶ Bases:
objectA building block of a Part Signature
Attributes:qualifier : ANY / SUBCLASS / CLASSONLYWhether the element should match precisely, all subclasses or uses a wildcardelement : str - The string of the element (without a qualifier)inverse : boolean - Whether the element has been negated-
ANY= 1¶
-
CLASSONLY= 3¶
-
SUBCLASS= 2¶
-
-
class
synbioweaver.core.PointCut(signature, operator)[source]¶ Bases:
objectA PointCut to select Join Points in the genetic parts execution flow
Attributes:operator : BEFORE / AFTER / REPLACE- The operator for this PointCutsignature : PartSignature-
checkAndSetOperator(operator)[source]¶ Set the internal operator attribute, if the parameter is a valid operator
Args:operator - The operator to be confirmedRaises:InvalidPointCutOperatorError - if the operator is invalid(can be dependent on the signature)
-
AFTER= 22¶
-
BEFORE= 11¶
-
REPLACE= 33¶
-
-
class
synbioweaver.core.PointCutContext(within, part)[source]¶ Bases:
objectContainer for context at a PointCut
Attributes:within - A stack of the circuits / aspects that within which the PointCut was matchedpart - The part matched by the PointCut
-
class
synbioweaver.core.PointCutExpressionAnd(left, right)[source]¶ Bases:
synbioweaver.core.PointCutExpressionOperatorA PointCutExpressionOperator which is an And
-
expressionUses(nodeType)¶ Confirms if a certain type of node is used in the expression
Args:nodeType: The type of the node whose existence is to be confirmedReturns:boolean - Whether or not the node exists in the formula
-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
left= None¶
-
right= None¶
-
-
class
synbioweaver.core.PointCutExpressionConcatenate(left, right)[source]¶ Bases:
synbioweaver.core.PointCutExpressionOperatorA PointCutExpressionOperator which is an Concatenation
-
expressionUses(nodeType)¶ Confirms if a certain type of node is used in the expression
Args:nodeType: The type of the node whose existence is to be confirmedReturns:boolean - Whether or not the node exists in the formula
-
numberOfMatchingParts(part)[source]¶ see PointCutExpressionNode definition
This child overrides it, since a concatenation operator is a node in the expression at which more than one part can be matched.
-
left= None¶
-
right= None¶
-
-
class
synbioweaver.core.PointCutExpressionNode[source]¶ Bases:
objectAbstract superclass for all Nodes in a Point Cut Expression Tree
A complex expression for a Point Cut, using operators such as & (and),| (or) or % (concatenation) is represented as a tree of nodes
-
class
synbioweaver.core.PointCutExpressionNot(pointcutexpression)[source]¶ Bases:
synbioweaver.core.PointCutExpressionOperatorA PointCutExpressionOperator which is a Not
A special case, only uses one child, acts as the inverse operator
-
expressionUses(nodeType)¶ Confirms if a certain type of node is used in the expression
Args:nodeType: The type of the node whose existence is to be confirmedReturns:boolean - Whether or not the node exists in the formula
-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
left= None¶
-
right= None¶
-
-
class
synbioweaver.core.PointCutExpressionOperator(left, right)[source]¶ Bases:
synbioweaver.core.PointCutExpressionNodeAbstract superclass of an PointCutExpression Node which is an operator
Attributes:left - The first child of the operatorright - The second child of the operator-
expressionUses(nodeType)[source]¶ Confirms if a certain type of node is used in the expression
Args:nodeType: The type of the node whose existence is to be confirmedReturns:boolean - Whether or not the node exists in the formula
-
match(part)¶ Does a part match this (sub)-expression? An abstract method, must be implemented by each child
Args:part - The part to be matchedReturns:boolean - Whether or not the part was matched
-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
left= None¶
-
right= None¶
-
-
class
synbioweaver.core.PointCutExpressionOr(left, right)[source]¶ Bases:
synbioweaver.core.PointCutExpressionOperatorA PointCutExpressionOperator which is an Or
-
expressionUses(nodeType)¶ Confirms if a certain type of node is used in the expression
Args:nodeType: The type of the node whose existence is to be confirmedReturns:boolean - Whether or not the node exists in the formula
-
numberOfMatchingParts(part)¶ returns the number of parts the expression matches | If an expression uses concatenation, then it might match the current part and a number of preceding parts.
Args:part - The part at which matching startsReturns:integer - how many parts were matched
-
left= None¶
-
right= None¶
-
-
class
synbioweaver.core.PositivePromoter(regulatedBy)[source]¶ Bases:
synbioweaver.core.PromoterClass for Promoters that are Positive Promoters
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.Promoter[source]¶ Bases:
synbioweaver.core.PartClass for Parts that are Promoters
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.Protein[source]¶ Bases:
synbioweaver.core.MoleculeClass for Molecules that are Proteins
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
-
class
synbioweaver.core.RBS[source]¶ Bases:
synbioweaver.core.PartClass for parts that are Ribosome BindingSites
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.RNACodingRegion(codesFor)[source]¶ Bases:
synbioweaver.core.Part-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.Terminator[source]¶ Bases:
synbioweaver.core.PartClass for parts that are Terminators
-
getAfterNodes(filterType)¶ Returns all nodes immediately after this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getAfterPart()¶ Returns the part just after this part in the execution flow
-
getBeforeNodes(filterType=<type 'object'>)¶ Returns all nodes immediately before this node in the execution flow, with the option to filter by node type
Args:filterType: Filters the list to only include nodes of a given (super)type
-
getBeforePart()¶ Returns the part just before this part in the execution flow
-
setAfterPart(part)¶ Inserts a part after this part in the execution flow. If there’s already a part behind this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
setBeforePart(part)¶ Inserts a part before this part in the execution flow. If there’s already a part in front of this part, the part to be inserted will be inserted between the two parts presently connected
Args:part: the Part to be inserted
-
weave(weaver)¶ Internal method used during the weaving process: Facilitates molecule scope checking
-
-
class
synbioweaver.core.TypeAdvice(signature, typeaddition, name, aspect)[source]¶ Bases:
objectContainer for TypeAdvice
Attributes:signature : PartSignature or MoleculeSignaturetypeaddition : method or attribute to be added to the typename : The name the new typeaddition should have in the new typeaspect : Aspect which declares this TypeAdvice
-
class
synbioweaver.core.Weaver(circuit, *aspects)[source]¶ Bases:
objectThe “compiler” that weaves core concerns (circuits) and cross-cutting concerns (aspects) and creates a woven execution flow of parts
Attributes:partList - The current list of partsmoleculeList - The current list of moleculesbeforeAndReplaceAdviceList - List of all before and replace advice to be wovenafterAdviceList - List of all after advice to be wovenpartTypeAdviceList - List of all part type advicemoleculeTypeAdviceList - List of all molecule type advicecircuit - The main circuitaspects - The list of all aspects to be wovenweaverOutput : WeaverOutput - The “compiled” result-
class
MoleculeReactionFrom(weaver, callingObject, molecules)[source]¶ Class to represent the left hand side of a molecule reaction and enable convenient syntax by overloading the >> (rshift) operator
Attributes:before : [ExecutionNode]A list of ExecutionNode objects that precede this nodeafter : [ExeuctionNode]A list of ExecutionNode objects that follow this nodescope : class(WeaverOutput)What woven system is this node part ofadditionStack : [Circuit or Aspect]stack of Aspects and Circuits which are executing to addthis node
-
class
MoleculeReactionTo(molecules)[source]¶ Class to represent the right hand side of a molecule reaction
-
class
WeaverOutput(circuitName, parentCircuit=None)[source]¶ Bases:
objectContainer for the woven result of the Weaver
Attributes:circuitName - the name of the circuit that was wovenpartList - finished ordered list of parts in the designmoleculeList - list of all molecules in the designsubcircuitList - list of all subcircuits (itself weaver outputs) (??)
-
addCircuit(callingObject, circuit)[source]¶ Called by circuit or aspect to add a circuit as a sub-compartment in the current compartment
Args:callingObject - the circuit or aspect calling thiscircuit - The circuit to be added as a sub-compartment
-
addPart(callingObject, part)[source]¶ Called by circuit or aspect to add a part in the execution flow
Args:callingObject - the circuit or aspect calling thispart - The part supposed to be added
-
createMolecule(callingObject, molecule)[source]¶ Indicates that a molecule is potentially present in the current compartment, i.e. it does not necessarily need to be created by a Coding Region, by an import, etc.
Args:callingObject - the circuit or aspect calling thismolecule - the molecule to be present
-
exportMolecule(callingObject, molecule)[source]¶ - Indicates that a molecule should be “exported” by the current compartment to
- the outer compartment
Args:callingObject - the circuit or aspect calling thismolecule - the molecule to be exported
-
importMolecule(callingObject, molecule)[source]¶ - Indicates that a molecule should be “imported” by the current compartment from
- the outer compartment
Args:callingObject - the circuit or aspect calling thismolecule - the molecule to be imported
-
reactionFrom(callingObject, molecules)[source]¶ Used to add the left hand side of a molecule reaction to the design, called by either a circuit or aspect
Args:callingObject - the circuit or aspect calling thismolecules - the list of molecules on the lhs of the reaction
-
reactionTo(callingObject, molecules)[source]¶ Used to add the right hand side of a molecule reaction to the design, called by either a circuit or aspect
Args:callingObject - the circuit or aspect calling thismolecules - the list of molecules on the rhs of the reaction
-
readAspectsConstructAdviceLists()[source]¶ Internal - initializes aspects and constructs all advice lists
-
runAfterAdvice(callingObject, part, precedence=0)[source]¶ Internal - runs After Advice of a part
Args:part - The part for which the advice matchescallingObject - the circuit or advice which added the partprecedence - Only run advice with a precedence greater or equal thisUsed if replacement advice has been executed
-
runBeforeAndReplaceAdvice(callingObject, part)[source]¶ Internal - runs Before and Replace Advice of a part
Args:part - The part for which the advice matchescallingObject - the circuit or advice which added the partReturns:“continue”True - If part should still be addedFalse - If part has been replaced and remaining after advice executed
-
class
-
synbioweaver.core.checkAndSetMolecule(molecule)[source]¶ checks if parameter is a class of type Molecule and returns it
Args:molecule - A potential MoleculeRaises:MoleculeValue - If molecule is not a class of type MoleculeReturns:A class of type Molecule
-
synbioweaver.core.checkBaseClassesMatch(bases, typename)[source]¶ Recursively check if the name of the types in bases (or parents) are equal to typename
Args:bases - A tuple of typestypename : str - A name of a typeReturns:True if any of the names of types in bases or any of their parent bases equals typename,False otherwise
-
synbioweaver.core.checkIfTypeReturnInstance(possibleType)[source]¶ if the parameter is a type, try to return an instance
Args:possibleType - a parameter which may be an instance or a typeRaises:PartInitializationError - if the parameter is a type which can not be constructedReturns:An instance of the type of possibleType
-
synbioweaver.core.declareNewMolecule(classname, *parents)[source]¶ Returns a new Molecule type and exports it to the caller’s namespace
Args:classname: The name for the new type*parents: 0 or more Molecule super classesReturns:The new Part typeRaises:MoleculeValueError: If any parent is not a MoleculeInvalidSymbolNameError: If classname is not a valid name for a symbolWarnings:SymbolExistsWarning: If classname already exists in the namespace
-
synbioweaver.core.declareNewPart(classname, parent=<class 'synbioweaver.core.Part'>, moleculesBefore=[], moleculesAfter=[], regulatorInfoMap={})[source]¶ Returns a new Part type and exports it to the caller’s namespace
Argsclassname : stringThe name for the new typeparent : Partsuper class for the new typemoleculesBefore : [Molecule]optional, if the new Part type should have Molecule node(s) before it, e.g. regulators of a PromotermoleculesAfter : [Molecule]optional, if the new Part type should have Molecule node(s) after it, e.g. Proteins created by CodingRegionsregulatorInfoMap : Dictionaryoptional, if a parent part needs additional regulator information.Necessary for HybridPromoters, who need a map in the form of {Molecule: Boolean}ReturnsThe new Part typeRaisesPartValueError -If the parent is not a PartInvalidSymbolNameError - If classname is not a valid name for a symbolWarningsSymbolExistsWarning - If classname already exists in the namespace