#!/usr/bin/perl # Program to generate the header for a GenePix GAL file # Chris Seidel December 2000 use CGI qw(:standard); $q = new CGI; if( $q->param() ){ #check for input if( $q->param('format') eq "tab" ){ print header, "
";
        &processForm;
        print "
"; }else{ print "Content-type: application/x-excel\n\n"; &processForm; } }else{ &myForm; } sub myForm { print header, h3('GenePix Header Generator'); print <GenePix GAL files. It will also generate the Block Row Column numbers if you check the box. Simply enter the parameters for your array in place of the default values below, check the results by submitting the form, and then if it looks correct switch the format to excel, download the results and open them with excel, then you can finish building the file from there. Stars (*) are used as place holders in the columns, replace them with your own values. ENDBLOCK #print out the form print start_form, "Number of blocks: ", textfield(-name=>'blocks', -default=>'16', -size=>5); print br, "Blocks across: ", textfield(-name=>'blocks_across', -default=>'4', -size=>5); print "Blocks down: ", textfield(-name=>'blocks_down', -default=>'4', -size=>5); print br, "Pin offset: ", textfield(-name=>'pin_offset', -default=>'4500', -size=>5), " (optional - allows default grid spacing to match block spacing)"; print br, "Columns you'd like in File: ", textfield(-name=>'data_columns', -default=>'5', -size=>5), " (5 minimum)"; print br, "x origin: ", textfield(-name=>'x_origin', -default=>'500', -size=>5); print br, "y origin: ", textfield(-name=>'y_origin', -default=>'500', -size=>5); print br, "Feature Diameter: ", textfield(-name=>'f_diam', -default=>'100', -size=>5); print br, "x Features: ", textfield(-name=>'x_features', -size=>5); print br, "x Spacing: ", textfield(-name=>'x_spacing', -default=>'185', -size=>5); print br, "y Features: ", textfield(-name=>'y_features', -size=>5); print br, "y Spacing: ", textfield(-name=>'y_spacing', -default=>'185', -size=>5); print p, "Return Format ", popup_menu(-name=>'format', -values=>['tab', 'excel'], -labels=>{'tab'=>'tab delimited text', 'excel'=>'excel spreadsheet'}, -default=>'tab'); print "     ", checkbox(-name=>'generate_list', -checked=>'checked', -value=>'on', -label=>''), "generate Block Row Column list\n"; print p, submit, end_form; print <The code for this program

Chris Seidel ENDBLOCK } sub processForm { #I always feel compelled to exchange variables into more useful form, neurotic. $blocks = $q->param('blocks'); $blocks_across = $q->param('blocks_across'); $blocks_down = $q->param('blocks_down'); $data_columns = $q->param('data_columns'); $pin_offset = $q->param('pin_offset'); $x_origin = $q->param('x_origin'); $y_origin = $q->param('y_origin'); $feature_diam = $q->param('f_diam'); $x_features = $q->param('x_features'); $x_spacing = $q->param('x_spacing'); $y_features = $q->param('y_features'); $y_spacing = $q->param('y_spacing'); #I've left out the URL line for now. $header_records = 3 + $blocks; print "ATF\t1.0\n"; print $header_records, "\t", $q->param('data_columns'), "\n"; print "Type=GenePix ArrayList V1.0\n"; print "BlockCount=", $blocks, "\n"; print "BlockType=0", "\n"; #print out the grid descriptions and locations $i=1; $x_shift = 0; $y_shift = 0; for( $j=0; $j<$blocks_down; ++$j ){ for( $k=0; $k<$blocks_across; ++$k ){ print "Block", $i, "="; print $x_origin + $x_shift,", ", $y_origin + $y_shift, ", "; print $feature_diam, ", "; print $x_features, ", "; print $x_spacing, ", "; print $y_features, ", "; print $y_spacing; print "\n"; # $x_shift += $x_features * $x_spacing + $pin_offset; $x_shift = ($k+1) * $pin_offset; #print "x_shift: $x_shift\n"; ++$i; } $x_shift = 0; # $y_shift += $y_features * $y_spacing + $pin_offset; $y_shift = ($j+1) * $pin_offset; } # add place holders for extra columns $extra_columns = "\t*\t*"; # use * for place holders if($data_columns > 5){ for($i=5; $i<$data_columns; ){ ++$i; $extra_column_names .= "\tColumn$i"; $extra_columns .= "\t*"; } }else{ $extra_column_names = ""; } print "Block\tRow\tColumn\tID\tName", $extra_column_names, "\n"; #print out the block row col numbers if chosen if( $q->param('generate_list') eq "on" ){ $block = 1; $row = 1; $col = 1; for( $j=0; $j<$blocks_down; ++$j ){ for( $k=0; $k<$blocks_across; ++$k ){ for($l=0; $l<$y_features; ++$l){ for($m=0; $m<$x_features; ++$m){ print "$block", "\t", "$row", "\t", "$col", $extra_columns, "\n"; ++$col; } $col = 1; ++$row; } $row = 1; ++$block; } } } }