Database Routines

dbconnect

description
return database handle for specified database name

input
database name

output
database handle

example
my $dbh = dbconnect('comboscr');

get_bac_filter_panel_pattern

description
return a bac's filter, panel and pattern

input
(dbh, filter name, bac name)

output
($filter, $panel, $pattern)

example
my ($filter, $panel, $pattern) = &get_bac_filter_panel_pattern($dbh, 'Nipponbare-PU', '053G06');

get_pools

Description
Retrieves from the database the pools and their sorted order.

Input
Database handle.

Output
1) An array of the order for pools as defined by SQL.

2) A hash with the pool id as the key and the pool description as the value

Examples
get_pools($dbh,\@order,\%labels);

get_pool_sets

Description
Retrieves from the database the pool sets and their sorted order.

Input
Database handle.

Output
1) An array of the order of the pool sets as defined by SQL.

2) A hash with the pool_set id as the key and the description as the value

Examples
get_pool_sets($dbh,\@order,\%labels);

overgo_name_to_prc

description
return plate, row and col values for an overgo name

input
(dbh, overgo name)

output
plate, row and col

example
my ($plate, $row, $col) = overgo_name_to_prc($dbh, '1jp1234567');

overgo_filter

description
given a list of overgos, return valid overgos

input
%input - keys: dbh, overgos, cutoff

overgos can be formatted as either contig/position or plate/row/col

cutoff is optional (default = 30bp, can also specify a cutoff of 'none' to return everything)

output
@valid_overgos

example
my %input = (dbh => $dbh, overgos => ['1jp1234567', '27A07', '8jp7654321'], cutoff => 28);

or

my %input = (dbh => $dbh, overgos => ['1jp1234567']);

or

my %input = (dbh => $dbh, overgos => [@overgos]);

my @valid_overgos = overgo_filter(%input);


Web Routines

project_referer

description
returns the project type (rice or soybean) based on the HTTP_REFERER cgi env. var.

input
$ENV{HTTP_REFERER}

output
rice or soybean (undef if the referer cannot be determined)

example
my $project = project_referer($ENV{HTTP_REFERER});

table_head0

description
print <table border=``0'' cellspacing=``2'' cellpadding=``2''>

input
none

table_head1

description
print <table border=``1'' cellspacing=``2'' cellpadding=``2''>

input
none

print_overgo_query_html

Description
Prints out the HTML needed to query the user in regards to what overgo they wish to choose.

Input
1) Database handle.

2) CGI handle.

3) If to use HTML tables. 0 = no, 1 = yes, 2 = yes & leave table open (often because the calling program wishes to add other information to the table; a two column table is created)

4..8) Five variables on which sections to display. 0 = no display, 1 = display normal, 2 = display with wildcard. It is up to the calling program to handle the wildcard.

The sections are: 4) Contig-position ... a unified field for the user to put this information 5) Contig, position ... two fields for data entry 6) Plate, row, column ... three fields for data entry 7) Pool 8) Pool set

The routine should be enclosed within a form otherwise the user will not be able to choose the drop down menus properly.

Output
Just prints to stdout.

The user's selection can be obtained via a cgi_handle->query('xxx') where 'xxx' is:

  conpos
  contig
  position
  plate
  row
  column
  pool
  poolset

For the 5 sections respectively. It is up to the calling program to handle the wildcards if there are any.

Examples
(A) Using tables & leave table open, displaying 2nd, 4th, and 5th sections. The 2nd wildcarded.

overgo_query_html($dbh,$q,2,0,2,0,1,1);

(B) Not using tables, displaying only the 3rd section without wildcards

overgo_query_html($dbh,$q,0,0,0,1,0,0);


General Routines