#!/usr/local/bin/perl ############################################################################### # Program : flycat.cgi # Author : Eric Deutsch # $Id$ # # Description : This script authenticates the user, and then # displays the opening access page for FLYCAT queries. # # SBEAMS is Copyright (C) 2000-2005 Institute for Systems Biology # This program is governed by the terms of the GNU General Public License (GPL) # version 2 as published by the Free Software Foundation. It is provided # WITHOUT ANY WARRANTY. See the full description of GPL terms in the # LICENSE file distributed with this software. # ############################################################################### ############################################################################### # Get the script set up with everything it will need ############################################################################### use strict; use FindBin; use lib "$FindBin::Bin/../../lib/perl"; use vars qw ($q $sbeams $sbeamsPROT $PROGRAM_FILE_NAME $current_contact_id $current_username); #use CGI; use CGI::Carp qw(fatalsToBrowser croak); use SBEAMS::Connection qw($q); use SBEAMS::Connection::Settings; use SBEAMS::Connection::Tables; use SBEAMS::Proteomics; use SBEAMS::Proteomics::Settings; use SBEAMS::Proteomics::Tables; #$q = new CGI; $sbeams = new SBEAMS::Connection; $sbeamsPROT = new SBEAMS::Proteomics; $sbeamsPROT->setSBEAMS($sbeams); ############################################################################### # Global Variables ############################################################################### $PROGRAM_FILE_NAME = 'main.cgi'; main(); ############################################################################### # Main Program: # # Call $sbeams->Authentication and stop immediately if authentication # fails else continue. ############################################################################### sub main { #### Do the SBEAMS authentication and exit if a username is not returned exit unless ($current_username = $sbeams->Authenticate( permitted_work_groups_ref=>['Proteomics_user','Proteomics_admin', 'Proteomics_readonly'], #connect_read_only=>1, #allow_anonymous_access=>1, )); #### Print the header, do what the program does, and print footer $sbeamsPROT->printPageHeader(); showMainPage(); $sbeamsPROT->printPageFooter(); } # end main ############################################################################### # Show the main welcome page ############################################################################### sub showMainPage { $sbeams->printUserContext(); print qq~

Welcome to FLYCAT, a catalog of annotated peptides in Drosophila.

Click on one of the links below to view annotations for genes beginning with the character...

~; my $sql = qq~ SELECT SUBSTRING(biosequence_name,1,1) AS 'first letter',COUNT(*) AS 'Count' FROM $TBPR_BIOSEQUENCE WHERE biosequence_set_id = 3 GROUP BY SUBSTRING(biosequence_name,1,1) ORDER BY 1 ~; my @columns = $sbeams->selectOneColumn($sql); my $element; foreach $element (@columns) { $element = uc($element); print " $element  " } print qq~

OR:

Enter the gene search string (% is a wildcard):
Gene Name
Accession (FBgnxxxxxxx)
        
~; } # end showMainPage