How to use the Make_Structure macro:

Your data need to be in a slightly modified version of my "standard" format.  This is to say there is no row with information about the polymorphisms.  Additionally, if you have your genotype data in the "A/A" format, the ONLY spacer you can use for now is "/".  Alternatively, your data can be in the 0, 1, 2 format, where 0 is homozygous wt, 1 is heterozygous, and 2 is homozygous mut.  Once your data is in a worksheet where you want it to be translated, just run the macro.  The purpose of the macro is to create a new line for each individual, which will constitute the "second" allele of the genotype.  This is the format necessary for structure.  Once the macro has run, save the file as text, and you can then run it in structure.  In order to do this, start structure, then click "New Project" and follow the instructions.  The file you created will be used as the data file.

Be sure NOT TO SAVE YOUR WORKBOOK WHICH HOLDS THE MACRO AS TEXT!  The best way to use this macro is to set up a shortcut to it on your toolbar.  To do this, open the workbook with the macro.  Then, right click on the toolbar area of your Excel sheet.  Choose customize, and add a button to your toolbar that is linked to the macro.  On the "Commands" tab, choose "Macros".  This will give you the option of adding a "Custom Button" (The one with the smiley face).  Click this, and drag it into your toolbar.  The "Modifiy Selection" button becomes active.  At this point, you can changet the name, and icon of the button, as well as assign the "Make_Structure" macro to the button.  I highly recommend doing this, because the macro is written to close the worksheet that is holding it automatically, to try to keep you from losing it :) 

Have fun!

Description of the macro.

Download the macro.

Back to the program list.

This page was last updated on: August 28, 2002 by David G. Cox