#!/usr/bin/perl -w use CGI qw/:standard/; use CGI::Pretty; $CGI::Pretty::INDENT = ""; use FileManager; use Batch; use BioC; use Site; use strict; # Create the global CGI instance our $cgi = new CGI; # Create the global FileManager instance our $fm = new FileManager; # Handle initializing the FileManager session if ($cgi->param('token') || $cgi->cookie('bioctoken')) { my $token = $cgi->param('token') ? $cgi->param('token') : $cgi->cookie('bioctoken'); if ($fm->init_with_token($UPLOAD_DIR, $token)) { error('Upload session has no files') if !($fm->filenames > 0); } else { error("Couldn't load session from token: ". $cgi->param('token')) if $cgi->param('token'); } } if ($cgi->param('token') && ! $cgi->param('file')) { select_file(); } elsif (! $cgi->param('step')) { step1(); } elsif ($cgi->param('step') == 1) { step2(); } else { error('There was an error in form input.'); } #### Subroutine: step1 # Make step 1 form #### sub step1 { my $filename = $cgi->param('file'); my ($name, @colnames, @probeids, $err); if ($filename) { error('File not found.') if !$fm->file_exists($filename); $err = parse_aafTable($fm->path . "/$filename", \$name, \@colnames, 0, \@probeids, 0); error($err) if $err; } print $cgi->header; site_header('Affymetrix Probe Annotation: annaffy'); print h1('Affymetrix Probe Annotation: annaffy'), start_form, hidden('step', 1), '
| ', p('Probe IDs:'); if ($filename) { print hidden('token', $fm->token), hidden('file', $filename), hidden('name', $name), hidden('probeids', join(', ', @probeids)), p("", scalar @probeids, " in $filename"), p("aafTable Columns:"), p(scrolling_list('tablecols', [@colnames], [], scalar @colnames, 'true')); } else { print p(textarea('probeids', '', 18, 30)); } print ' | ', p('Chip:'), p(popup_menu('chip', ['hgu133a', 'hgu133b', 'hgu95av2', 'hgu95b', 'hgu95c', 'hgu95d', 'hu6800', 'mgu74av2', 'mgu74b', 'mgu74c', 'rgu34a', 'rgu34b', 'rgu34c', 'rae230a', 'rae230b', 'YEAST'])), p('Data Columns:'), p(scrolling_list('colnames', ['Probe', 'Symbol', 'Description', 'Function', 'Chromosome', 'Chromosome Location', 'GenBank', 'LocusLink', 'Cytoband', 'UniGene', 'PubMed', 'Gene Ontology', 'Pathway'], [], 13, 'true')), ' |
Probe IDs can be separated by any combination of whitespace, commas, semicolons, or quotation marks.
On a Macintosh, use Command-Click to select multiple items from the data column list. On a PC, use Control-Click.
The e-mail address you provide will only give you information about the completion status of your job. Make sure to bookmark the following page as the URL will not come in the e-mail. The server will delete your results after approximately a week. Probe annotations typically take anywhere from 15 seconds (25 probes) to 13 minutes (22,000 probes).
For further information, see the documentation page.
Chip: hgu133a
207734_at, 218967_s_at, 217222_at, 65438_at, 207183_at, 215255_at, 202550_s_at, 212012_at, 215985_at, 202728_s_at, 204857_at, 212489_at, 41657_at, 219421_at, 205268_s_at, 221046_s_at, 222152_at, 213784_at, 207085_x_at, 215869_at, 202044_at, 217187_at, 205314_x_at, 206411_s_at, 215244_at
END site_footer(); } #### Subroutine: select_file # Make file selection form #### sub select_file { my @filenames = $fm->filenames; print $cgi->header; site_header('Affymetrix Probe Annotation: annaffy'); print h1('Affymetrix Probe Annotation: annaffy'), start_form, hidden('token', $fm->token), p("Select an aafTable for further annotation:"), p(scrolling_list('file', \@filenames)), p(submit("Next Step")); site_footer(); } #### Subroutine: step2 # Handle step 1, redirect web browser to results #### sub step2 { my $jobname = "aaf-" . rand_token(); my $probeids = $cgi->param('probeids'); $probeids =~ s/[,;"']/ /g; my @probeids = split(' ', $probeids); my ($script, $output, $jobsummary, $error, $job); if (!@probeids) { error("No probe ids specified."); } if (!$cgi->param('colnames')) { error("No data columns specified."); } if ($cgi->param('email') && !check_email($cgi->param('email'))) { error("Invalid e-mail address."); } $script = generate_r($jobname, [@probeids]); $output = <