Home > Module development > 3.PropergyBag

PropertyBag

 

A PropertyBag is a parameter setting panel for a user to adjust parameter values. Since Visual Gene Developer has a user friendly interfaced PropertyBag editor, module developers can easily design customized PropertyBag and attach the designed PropertyBag to the module. Using the specialized class (class name: PropertyBag), you can access to the PropertyBag to read and write parameters, and make use of parameter values while developing modules.

 


o PropertyBag file (file extension: vgb)

 

A 'PropertyBag file' is a collection of PropertyBags and contains at least one PropertyBag. As default, all PropertyBag files are located in the sub folder, "/PropertyBag", where Visual Gene Developer is installed. Because PropertyBag file has standard text format, you can open any file and review its content and edit it with software such as NotePad or MS Word. 

 

 

 

o PropertyBag Identification Key (=PropertyBag Hash Code)

 

Each PropertyBag also has a unique Identification Key that Visual Gene Developer generates automatically. The concept and purpose is quite the same like typical modules. Check the previous section.

 


o PropertyBag Editor window

 

You can define new parameters in the 'PropertyBag Editor' window

 

1. In order to create new PropertyBag, click on the 'New PropertyBag file' button in the 'PropertyBag Library' window

2. Or, click on the 'Edit PropertyBag' button to edit existing PropertyBag

3. There are 4 buttons in the 'PropertyBag Editor' window, you can click on the 'Add parameter' button to add a new parameter

4. Choose one of the parameters

5. You can see information of the parameter you chose

6. Click on the 'OK' button to close the 'PropertyBag Editor' window

7. Click on the 'Save changes to files' to save all designed PropertyBags to a PropertyBag files.

 

 

o How to define parameter

Here is an example.

 

 Parameter

 Description

 Name

 Parameter name that represents a given parameter

 Module developers read and write parameter value by this 'Name'

 Variable type

 It has one of types

   - Integer: integer number

   - Single: floating point number

   - String: text

 Value

 Default value

 Cell type

 It has one of types

   - Text: single line text

   - TextBox: multiple line text

   - ComboBox: drop down combo box (a user can choose one of listed items)

 String collection

 It is reserved for ComboBox cell type (Text and TextBox cell type don't use this one)

 It is a multiple line text

 Each line is considered to be a single item

 Enable

 It set a parameter to be editable or not.

 I has 'True' or 'False' value

 If  'False', users only can read value

 Height (Line)

 Height of a parameter shown in PropertyBag

 Default value is 1 line

 

 


o How to attach PropertyBag to module

 

1. Click on the 'Copy' button in the 'PropertyBag Library' window to copy 'PropertyBag Identification Key' to clipboard

2. Click on the 'Paste' button in the 'Module Editor' window.

3. Immediately, you can see the designed PropertyBag

 

Information  If you paste incorrect PropertyBag Identification Key, Visual Gene Developer will neglect and will not show it.

 

 

o How to Read and Write Parameters

 

In the above figure, please check the source code. 'PropBag_Param' is a instance of 'PropertyBag' class and means a default PropertyBag for a given module. In the 'Module Editor' window, 'PropBag_Param' is a default PropertyBag (Number 3 in the above figure) and a module developer can read parameter values using 'PropBag_Param'. At the same, a registered module in other window also can be 'PropBag_Param' as a default PropertyBag. For example, default PropertyBag's name in the 'Configuration of gene optimization' is also 'PropBag_Param'.

 

Therefore, module developers can use 'PropBag_Param' class to consistently access to default PropertyBag to test a module in the 'Module Editor' window.

 


o Specialized class: 'PropertyBag'

 

The class, 'PropertyBag' is a specialized class to access to PropertyBag and its parameter values. There are 3 different instances of PropertyBag such as 'PropBag_Param', 'PropBag_Prc' and 'PropBag_Custom'. 'Instance' means that they are separate templates and copies of 'PropertyBag' but are different objects with different class names. Module developers mainly will use 'PropBag_Param' for module development.

'PropBag_Prc' class is usually optional as a secondary PropertyBag and it is used by 'Search strategy' function among the module categories (or types) or other target places. Of course, the 'Module Editor' window also has a secondary PropertyBag whose name is 'PropBag_Prc'.

 

 

Meanwhile, 'PropBag_Custom' is used to show gene analysis results by Visual Gene Developer software or users

1. When you click on the 'CAI and GC content', you can see the 'Gene analysis' window.

The name of the PropertyBag is 'PropBag_Custom' in the figure and the software actually accesses to the PropertyBag to write the results via common interface. It means that a user also can access to the PropertyBag to output gene analysis results.