VERSION 1.0
Matrix Generator User’s Guide and Technical Documentation Charity Washam
1,2
Acknowledgments: Larry J. Suva1, Mariofanna Milanova2, Sudeepa Bhattacharyya1,2, Stephanie Byrum1,2
Contents 1 Overview 2 Obtaining Matrix Generator 3 System Requirements 4 Installation 5 Uninstalling Matrix Generator 6 Documentation 7 Running Matrix Generator 8 Tutorial 9 References 10 Figures and Tables 11 Source Code
1
Department of Orthopaedic Surgery, Center for Orthopaedic Research, University of Arkansas for Medical Sciences, Little Rock AR 72205. Email:
[email protected] 2 Joint Graduate Program in Bioinformatics, University of Arkansas at Little Rock/University of Arkansas for Medical Sciences, Little Rock AR 72205. Email:
[email protected]
1
VERSION 1.0
1 Overview Matrix Generator is a companion application developed for the Shared Biomarker Patterns (SB3) Add-In. The file contains a template of VB code that allows users to generate additional columns (one column per analysis) for the cluster matrix used by the SB3 application. This allows the user to expand the dimensions of the cluster matrix (original dimensions of the cluster matrix: 250 x 250) and adapt SB 3 to their specific needs.
2 Obtaining Matrix Generator Academic users can download the latest version of Matrix Generator© from the Department of Orthopaedic Surgery, Center for Orthopaedic Research website at the University of Arkansas for Medical Sciences (UAMS) http://www.cor.uams.edu/staff.asp, or from the Bioinformatics website at the University of Arkansas at Little Rock (UALR) http://bioinformatics.ualr.edu/research/2009/washam/software_matrix.html.
2
VERSION 1.0
3 System Requirements Microsoft Office Word 2007 System Requirements The system requirements of Matrix Generator are the same as those specified for Microsoft Word 2007. The supported operating systems include, Windows Server 2003, Windows Vista, and Windows XP (SP2) or later operating system. The complete set of requirements are listed in Table 1 below. For more information on the system requirements for Word 2007 visit the Microsoft Website. (Note: It is highly recommended for the user to verify their computer meets the system requirements of the 2007 Microsoft Office System before installing Matrix Generator.)
Table 1: System Requirements for Microsoft Word 2007 Component
Requirement
Computer and processor
500 megahertz (MHz) processor or higher
Memory
256 megabyte (MB) RAM or higher
Hard disk
1.5 gigabyte (GB); a portion of this disk space will be freed after installation if the original download package is removed from the hard drive.
Drive
CD-ROM or DVD drive
Display
1024x768 or higher resolution monitor
Operating system
Microsoft Windows XP with Service Pack (SP) 2, Windows Server 2003 with SP1, or later operating system
Matrix Generator only functions in Word 2007 documents preferably macro-enabled documents (.docm). It will not function if installed in earlier versions of Word such as Word 2003. It is compatible with all Microsoft Office Suite packages (Office Basic 2007, Office Standard 2007, Office Home and Student 2007, Office Professional 2007, Office Small Business 2007, Office Professional Plus 2007, Office Enterprise 2007, and Office Ultimate 2007) since all versions include Word 2007.
3
VERSION 1.0
4 Installation To start the installation process, download the Matrix_Generator.docm file from one of the websites listed above (see Section 2). Save the program file as a macro-enable document (.docm) on your hard disk (Figure 4-1).
Customize the Quick Access Toolbar 1. Open the Matrix_Generator.docm file. 2. Right click on an unused area of the Quick Access Toolbar and select Customize Quick Access Toolbar from the list of options (Figure 4-2).
4
VERSION 1.0 3. Select Macros from the list displayed in the Choose commands from drop-down box (Figure 4-3). 4. Select Project.ShowMatrixForm from the list of macros displayed and click the Add button located in the center of the dialog box (Figure 4-3).
5. Click Ok in the Word Options dialog box to add the Matrix Generator button Quick Access Toolbar (Figure 4-4).
to the
For more information on how to customize the Quick Access Toolbar visit the Microsoft Website. 5
VERSION 1.0
5 Uninstalling Matrix Generator Remove the Matrix Generator button from the Quick Access Toolbar. 1. Open Microsoft Word 2007. 2. Right click the Matrix Generator button on the Quick Access Toolbar (Figure 5-1).
3. Select the Remove from Quick Access Toolbar option from the list of options displayed (Figure 5-2)
To completely remove the application locate the Matrix_Generator.docm file on your hard disk and delete the file. 6
VERSION 1.0
6 Documentation 6.1 MatrixForm Dialog Box The user form, MatrixForm, is a custom dialog box for Microsoft Word 2007. The form accepts one type of input, the number (integer value) of the column to create. This value is entered in TextBox1 (Figure 6-1).
6.1.1 MatrixForm Controls Labels: The lblColNumber label instructs the user to enter a column number in TextBox1 (Figure 6-1). Text Boxes: TextBox1 on the user form accepts an integer value for the column to generate (Figure 6-1). Command Buttons: The command buttons on the form execute the applications code. The generate command button creates the VB code for the column number entered in TextBox1. The reset command button uses the value entered in TextBox1 to reset the VB code (Figure 6-1). A summary of the MatrixForm form controls is displayed in Table 2 below.
7
VERSION 1.0 6.1.2 User Input Parameters The Column Number parameter determines the location of the code in the cluster matrix. For example, if “6” is entered in TextBox1 and the generate command button is clicked then the code generated will be translated by SB3 into formula that populate the cells in “column 6” of the matrix (Figure 6-2).
A snippet of the code used to create column 6 is shown in Figure 6-3 below. Note: the current version of SB3 contains a 250 x 250 clustering matrix, therefore to increase the size of the matrix the user should begin by generating the code that corresponds to column 251 of the cluster matrix.
8
VERSION 1.0 In order to set this parameter enter an integer value (e.g. “6” not “6.0”) in TextBox1. The Column Number parameter also serves to restore the code template to its original state. Performing this action allows the user to generate the next set of code. To set this parameter the user should re-enter in TextBox1 the value used to generate the current set of code. For example, if the code for “column 6” is generated, then in order to restore the code the user should re-enter “6” in TextBox1 and click the reset command button instead of the generate command button. 6.1.3 User Input Requirements The column number entered in TextBox1 must be an integer value (e.g. “6” not “6.0”). In order to restore the VB code, the user must re-enter the value used to generate the current set of code in TextBox1 (see the Tutorial section for an example scenario). 6.1.4 MatrixForm Code Execution The command buttons located in the bottom right corner of the user form (MatrixForm) execute the applications code. The code is stored in three modules, ShowMatrixForm(), Col_Generator(), and Col_Reset().
Generate Command Button When the generate command button is clicked the Col_Generate() procedure is called. This procedure uses the value entered in TextBox1 to generate the code for the corresponding column of the cluster matrix.
Reset Command Button When the reset command button is clicked the Col_Reset() procedure is executed. This procedure uses the value entered in TextBox1 to reset the documents code. This prepares the application for the next analysis.
Quick Access Toolbar Button When the button on the Quick Access Toolbar is clicked the ShowMatrixForm() procedure is called (Figure 6-4). This procedure opens the MatrixForm dialog box (Figure 6-4).
9
VERSION 1.0
A summary of the procedures associated with each command button are listed in Table 3 below.
10
VERSION 1.0
7 Running Matrix Generator 7.1 Instructions For Use 1.
Open the Matrix_Generator.docm document in Microsoft Word 2007.
2.
Click the Matrix Generator button
3.
Enter the column number you wish to create in TextBox1 and click the generate button (Figure 7-1).
4.
Save or add the VB code to a new module in the SB3 application.
5.
Re-enter the value used to create the code and click the reset command button to restore the code.
on the Quick Access Toolbar (Figure 7-1).
11
VERSION 1.0
8 Tutorial Generate the code for column 1 of the cluster matrix 1. Open the Matrix_Generator.docm file in Microsoft Word 2007. 2. Click the Matrix Generator button on the Quick Access Toolbar (Figure 8-1). 3. Enter the number “1” in TextBox1 and click the generate button (Figure 8-1). 4. Save or add the VB code to a new module in the SB3 application.
When the generate button is clicked the code for the first column of the cluster matrix is created. A snippet of the VB code for column 1 is shown in Figure 8-2a below. The changes made to the code template are highlighted in red.
12
VERSION 1.0 Reset the VB code 1. Enter the number “1” in TextBox1 and click the reset button (Figure 8-3).
When the reset button is clicked the VB code (i.e. the code for column 1) is restored to its original state. A snippet of the changes made to the VB code are shown in Figure 8-2b.
13
VERSION 1.0
9 References Green, J., Bullen, S., Bovery, R., Alexander, M.. Excel 2007 VBA Programmer's Reference. 1. Indianapolis, Indiana: Wiley, 2007. ISBN: 978-0-470-04643-2. Website Microsoft . “2007 Microsoft Office system requirements: Microsoft Office Word 2007”. Microsoft Office Online. 2008. Microsoft Corporation. 20 December 2008. Microsoft Website
Shelly, G., Cashman, T., Vermaat, M. Office 2007 Introductory Concepts and Techniques Windows XP Edition. 1. Boston, Massachusetts: Thomson Course Technology, 2008. ISBN: 978-1-4188-4327-4. Website
14
VERSION 1.0
10 Figures and Tables Figure 4-1 Figure 4-2 Figure 4-3 Figure 4-4 Figure 5-1 Figure 6-1 Figure 6-2 Figure 6-3 Figure 6-4 Figure 6-5 Figure 7-1 Figure 8-1 Figure 8-2
Figure 8-3
Table 1 Table 2 Table 3
Save the Matrix Generator program file on your hard disk Customize the Quick Access Toolbar Word Options Dialog Box Matrix Generator button on the Quick Access Toolbar (a) The Quick Access Toolbar (b) Matrix Generator Button MatrixForm Dialog Box Form Controls MatrixForm Input Parameters Cluster Matrix Formulas (a) a snippet of code from the Col_06() procedure (b) the formulas that are displayed in column 6 of the cluster matrix Matrix Generator button on the Quick Access Toolbar MatrixForm Dialog Box (a) The Matrix Generator button on the Quick Access Toolbar (b) TextBox1 on the MatrixForm user form user input parameters used to generate the code for Example 1. (a) A snippet of the VB code used to create column 1 of the cluster matrix, (b) the VB code is restored to its original state. Changes made to the template code are highlighted in red. Input parameters used to reset the code generated in Example 1.
System Requirements for Microsoft Word 2007 MatrixForm Form Controls A list of the modules called by each command button associated with Matrix Generator.
15
VERSION 1.0
11 Source Code 11.1 Procedures 11.1.1 Col_Generator() 11.1.2 Col_Reset() 11.1.3 ShowMatrixForm() 11.2 Form Click Events 11.2.1 MatrixForm_GenerateButton 11.2.2 MatrixForm_ResetButton
Procedure Col_Generate() Col_Reset() ShowMatrixForm()
Description This procedure uses the value in TextBox1 to generate the VB code for the corresponding column of the cluster matrix. This procedure uses the value entered in TextBox1 to restore the template code. This procedure opens the MatrixForm dialog box.
Lines of Code Event Procedures Lines of Code MatrixForm_GenerateButton MatrixForm_ResetButton Procedures Col_Generator() Col_Reset() ShowMatrixForm()
total no. of lines
2
total no. of lines
127
1 1
Lines of Code 63 61 3
16