Plate Builder Documentation
rns 13/06/2002


Description

Plate builder is designed to create custom plate layouts for the gene id tracking system (GITS). It is designed to be generic, allowing creation of different plate types with relatively straightforward(?) addition of code. The interface comprises a list and a plate layout. Currently implemented is the ability to select items from the list into individual wells of the plate or to apply an item against a template. Plate layouts can be output as postscript for printing.

Design

The specific application of plate_builder is defined by the variable $stage - currently a command line argument. According to the value in $stage various parts of the interface are switched on and off. Two subroutines - make_list() and plate_grid() - perform the bulk of the work in building the interface. Other generic subroutines are called depending on the options set for the value of $stage. Specific code to to pull out the list of entities for selection needs to written for each $stage in fill_list(). Plate creation needs to be placed in build_xxx_plate. Currently only build_pcr_plate() is implemented, there are slight variations for 'pool' and 'pcr' stages. The main sections of code are outlined below:

Setting up the Interface

make_list
creates a Tk::HList widget, number of columns defined in $LIST_COLS. The version of HList currently in site_perl is old and doesn't seem to support background colours, column headings, etc. Note that the documentation currently in site_perl is for a later version! Create assay type select box ($TYPE_SELECT) and a transfer button ($TRANSFER_BUTTON) according to switches. Transfer button is used only for selecting into individual wells.

template_select
For pool screening generate a list of available templates and display in a dropdown ($TEMPLATE_SELECT).

fill_list
contols what data is put in list. Calls whatever sql statements are required, organises the output and creates HList display items. In the 'pcr' case oligos against particular pools are listed as child items to an STS. If Tk::Tree were used these branches could be collapsed and opened for easier navigation, not available with version of Tk in use. For pool screening the list displays available STSs and a summary of the panels they have already been screened against.

Additional data put in hashes within fill_list and retrieved when building plate:
  • %wells - oligo name/id_well
  • %oligo_plates - oligo name/id_oligoplate
  • %ga_id - oligo name/id_geneassay
  • %op_pos - oligo name/pos on oligoplate [pcr only]
  • %dnas - superpool name/id_dnawell [pcr only]
The columns from list to be transferred to well of plate layout are defined by $DISPLAY_COL_1 and $DISPLAY_COL_2.

plate_grid
builds a grid representing a 96 well plate. If cherry picking to individual wells ($RADIO) a Tk::Radiobutton is created, otherwise a Tk::Label. There is space in each well to display two pieces of text - when creating PCR plates these are the oligo name and dna superpool name. These are stored as:
  • $bits->{plate}->{well}->{item1}
  • $bits->{plate}->{well}->{item2}
  • where well is in the format a1, a2, b1, etc

Defining Plate Contents

setup_pool() and transfer() control populating the plate layout for pool screening and pcr respectively. DNA name and STS/oligo name are transferred into 'item1' and 'item2' respectively for each well. The values are taken from list columns according to $DISPLAY_COL_1 and $DISPLAY_COL_2. All data from the list entry is copied into an array and added to %on_plate before the list row is deleted. It can thus be recreated if the plate/well is cleared.

setup_pool
called when adding an STS/template combination to a plate in pool screen setup. When an STS is selected from the HList, a template selected from teh dropdown and 'Select' is pressed this subroutine is called. It pulls details of the template from the database, checks that it will fit on the plate, multiple templates can be put on one plate, $filled_col stores how much of plate full. $stripe controls alternating background colours for each template.

transfer
copies the required info from a list item into a well position. Uses oligo name and superpool name as item1 and item2 respectively. If the list item is a water control then don't copy to %on_plate and don't delete entry from list. transfer() is called in one of three ways 1) selecting a list item and a well then pressing transfer button, 2) selecting a list item and double clicking a well radio button, 3) selecting a well and double clicking a list item. The currently selected well is stored in $bits->{well}.

clear_plate
Used for both styles of plate creation. Copies data from %on_plate back to HList then clears %on_plate.

clear_well
Only required for the cherry picking step. Finds the current well from $bits->{well}, writes data back to HList and clears the well display.

Plate Creation

Creates a plate in the database. Also prints barcode labels and gives the option of printng a plate layout (postscript). Currently implemented is build_pcr_plate - this creates plates for pool and pcr stages in much the same way. Uses data placed in each well and looks up additional data from hashes populated in fill_list.

build_pcr_plate
loops through wells on plate layout (SNP_util::get_map_into_hash used for loop). Uses dna name and sts name to look up additional data from hashes set up in fill_list(). Inserts pcr_plate, pcrplate_status and individual pcr_well entries. gene_assays are updated to the required status for pool screen ro pcr. Barcode data is put in to_print and if $PRINT_BARCODE is set then print_barcode is called.

print_layout
If $PRINT_LAYOUT is set then details of the plate layout and contents will be drawn in postscript and dumped to file. The file is given the name of the plate barcode (should be somewhere more sensible than current directory). In addition to the plate layout the oligo plates required to build it are listed. This section could be generalised to print the layout of any plate - it is fairly well commented.