Home > Module development > 4.Module category > Constraint



It is a function type sub routine that returns 'Pass' or 'Not pass'. This module is mainly used to screen out improper candidate gene constructs.


o Sample module


1. Open the 'Constraint' module of the 'Sample Script.vgs' in the 'Module Library' window

2. Check current category. It should be 'Constraint'

3. Review the source code

    This module reads sequence data of a target gene component from a current gene construct, calculates CAI, and returns 'Pass' if CAI is higher than 0.3

4. We already designed PropertyBag and pasted it.

5. Click on the 'Test run' button

6. You can see the return value.


7. To check module registration, click on the 'Constraint' button.

8. You can see the module and choose target gene component ID anytime.



Here is a source code (VBScript version). As shown here, 3 classes (GeneConstruct, PropertyBag, GeneService) were used.

Function Main()
  TargetGeneConstructIndex=GeneConstruct.CurrentConstructIndex                       '<---- Get current construct index
  TargetGeneName=PropBag_Param.Value("Target Gene Component ID")             '<---- Read target gene name
  TargetGeneIndex=GeneConstruct.ComponentIndex(TargetGeneConstructIndex,TargetGeneName)   '<---- Getg target gene index
  TargetGeneSeq=GeneConstruct.ParameterValue(TargetGeneConstructIndex,TargetGeneIndex,"Modified DNA")
                                                                                                                             '<---- Get sequence data
  GeneService.Set_WTableFile="Nicotiana benthamiana.vgw"                                  '<---- Set w table
  CalculatedCAI=GeneService.Calculate_CAI(TargetGeneSeq,True)                       '<---- Calculate CAI

  If CalculatedCAI<0.3 then        '<---- If CalculatedCAI is smaller than 0.3, it returns 'Not pass'
     Main="Not pass"
  End if

End Function