package MenuGff; =head1 NAME MenuGff -- A menu to create a GFF file =head1 SYNOPSIS MenuGff -> run; =head1 DESCRIPTION This package creates a GFF Menu for extropy. The user interacts with GFF Menu in order to create a GFF file. The only method is run. =head1 VERSION 0.001 (last update: 6/30/04) =head1 AUTHOR Chet Langin, clangin@siu.edu SIU Plant Biotechnology and Genomics Core-facility =head1 BUGS None known. =head1 SEE ALSO extropy ExtropyConstants ExtropyUtils Extropy::Configuration Extropy::DBManager Extropy::Project Extropy::ProjectCreate Extropy::ProjectPick Extropy::MenuMain =head1 COPYRIGHT Copyright 2004, Chet Langin, All Rights Reserved. This program is free software. You may copy or redistribute it under the same terms as Perl itself. =head1 METHODS The remainder of this document describes the methods available to the programmer. =cut # load the pragmas use warnings; use strict; # load other modules use ExtropyConstants; use ExtropyUtils; use Extropy::Configuration; use Extropy::DBManager; # use Extropy::Help; # use Extropy::Menu; use Extropy::Project; use Extropy::ProjectCreate; use Extropy::ProjectPick; # package variables my $configuration; my $db_manager; my $project; my $gff; my $command = NONE; my $help_message_number = 0; # ******************************** run ****************************** =head2 run MenuProject->run; Run the Project Menu, which allows the user to select an existing project or start a new one. =cut # --------------------------------------------------------------------- sub run { my $self = shift; $configuration = shift; $db_manager = shift; $project = shift; $gff = shift; my $proceed = TRUE; while($proceed) { &print_menu; if($command == HELP) { Help->display($help_message_number); } # if elsif($command == QUIT) { $proceed = FALSE; } # elsif elsif($command == GFF_LOCI) { message_start; if($project->{locus_names_updated}) { if($gff->{loci} == TRUE) { $gff->{loci} = FALSE; message("The loci will NOT be included in the GFF file"); } # if else { $gff->{loci} = TRUE; message("The loci will be included in the GFF file"); } # else } # if else { message("The loci names must be updated, first"); } # else press_enter; } # elsif elsif($command == GFF_CLONES) { message_start; if($project->{clone_anchors_updated}) { if($gff->{clones} == TRUE) { $gff->{clones} = FALSE; message("The clones will NOT be included in the GFF file"); } # if else { $gff->{clones} = TRUE; message("The clones will be included in the GFF file"); } # else } # if else { message("The clone anchors must be updated, first"); } # else press_enter; } # elsif elsif($command == GFF_CONTIGS) { message_start; if($project->{contig_anchors_updated}) { if($gff->{contigs} == TRUE) { $gff->{contigs} = FALSE; message("The contigs will NOT be included in the GFF file"); } # if else { $gff->{contigs} = TRUE; message("The contigs will be included in the GFF file"); } # else } # if else { message("The contig anchors must be updated, first"); } # else press_enter; } # elsif elsif($command == GFF_QTLS) { message_start; if($project->{qtl_file} ne "") { if($gff->{qtls} == TRUE) { $gff->{qtls} = FALSE; message("The QTL's will NOT be included in the GFF file"); } # if else { $gff->{qtls} = TRUE; message("The QTL's will be included in the GFF file"); } # else } # if else { message("The QTL's must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_ENDS) { message_start; if($project->{end_matches_file} ne "") { if($gff->{ends} == TRUE) { $gff->{ends} = FALSE; message("The end matches will NOT be included in the GFF file"); } # if else { $gff->{ends} = TRUE; message("The end matches will be included in the GFF file"); } # else } # if else { message("The end matches must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_MTPS) { message_start; if($project->{mtp_file} ne "") { if($gff->{mtps} == TRUE) { $gff->{mtps} = FALSE; message("The MTP's will NOT be included in the GFF file"); } # if else { $gff->{mtps} = TRUE; message("The MTP's will be included in the GFF file"); } # else } # if else { message("The MTP's must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_ESTS) { message_start; if($project->{est_file} ne "") { if($gff->{ests} == TRUE) { $gff->{ests} = FALSE; message("The EST's will NOT be included in the GFF file"); } # if else { $gff->{ests} = TRUE; message("The EST's will be included in the GFF file"); } # else } # if else { message("The EST's must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_SEQ) { message_start; if($project->{seq_file} ne "") { if($gff->{seq} == TRUE) { $gff->{seq} = FALSE; message("The Sequences will NOT be included in the GFF file"); } # if else { $gff->{seq} = TRUE; message("The Sequences will be included in the GFF file"); } # else } # if else { message("The Sequences must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_REL) { message_start; if($project->{rel_file} ne "") { if($gff->{rel} == TRUE) { $gff->{rel} = FALSE; message("The Related Genes will NOT be included in the GFF file"); } # if else { $gff->{rel} = TRUE; message("The Related Genes will be included in the GFF file"); } # else } # if else { message("The Related Genes must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_CON) { message_start; if($project->{con_file} ne "") { if($gff->{con} == TRUE) { $gff->{con} = FALSE; message("The Confirmed will NOT be included in the GFF file"); } # if else { $gff->{con} = TRUE; message("The Confirmed will be included in the GFF file"); } # else } # if else { message("The Confirmed must be read, first"); } # else press_enter; } # elsif elsif($command == GFF_ALL) { message_start; if(!$project->{locus_names_updated}) { message("The loci names must be updated, first"); } # if else { $gff->{loci} = TRUE; message("The loci will be included in the GFF file"); } # else if(!$project->{clone_anchors_updated}) { message("The clone anchors must be updated, first"); } # if else { $gff->{clones} = TRUE; message("The clones will be included in the GFF file"); } # else if(!$project->{contig_anchors_updated}) { message("The contig anchors must be updated, first"); } # if else { $gff->{contigs} = TRUE; message("The contigs will be included in the GFF file"); } # else if($project->{qtl_file} eq "") { message("The QTL's must be read, first"); } # if else { $gff->{qtls} = TRUE; message("The QTL's will be included in the GFF file"); } # else if($project->{end_matches_file} eq "") { message("The end matches must be read, first"); } # if else { $gff->{ends} = TRUE; message("The end matches will be included in the GFF file"); } # else if($project->{mtp_file} eq "") { message("The MTP's must be read, first"); } # if else { $gff->{mtps} = TRUE; message("The MTP's will be included in the GFF file"); } # else if($project->{est_file} eq "") { message("The EST's must be read, first"); } # if else { $gff->{ests} = TRUE; message("The EST's will be included in the GFF file"); } # else if($project->{seq_file} eq "") { message("The Sequences must be read, first"); } # if else { $gff->{seq} = TRUE; message("The Sequences will be included in the GFF file"); } # else if($project->{rel_file} eq "") { message("The Related Genes must be read, first"); } # if else { $gff->{rel} = TRUE; message("The Related Genes will be included in the GFF file"); } # else if($project->{con_file} eq "") { message("The Confirmed must be read, first"); } # if else { $gff->{con} = TRUE; message("The Confirmed will be included in the GFF file"); } # else press_enter; } # elsif elsif($command == GFF_WRITE) { $gff->write($db_manager, $project); } # elsif } # while $command = NONE if($command != QUIT); $command; } # run =head2 print_main() print_menu; Display the menu. =cut # ******************************* print_menu ************************ sub print_menu { my $loci_str = "Add (L)oci"; if($gff->{loci} == TRUE) { $loci_str = "Remove (L)oci"; } # if my $clones_str = "Add (C)lones"; if($gff->{clones} == TRUE) { $clones_str = "Remove (C)lones"; } # if my $contigs_str = "Add Conti(g)s"; if($gff->{contigs} == TRUE) { $contigs_str = "Remove Conti(g)s"; } # if my $qtls_str = "Add Q(T)L's"; if($gff->{qtls} == TRUE) { $qtls_str = "Remove Q(T)L's"; } # if my $ends_str = "Add (E)nd matches"; if($gff->{ends} == TRUE) { $ends_str = "Remove (E)nd matches"; } # if my $mtps_str = "Add MT(P)'s"; if($gff->{mtps} == TRUE) { $mtps_str = "Remove MT(P)'s"; } # if my $ests_str = "Add E(S)T's"; if($gff->{ests} == TRUE) { $ests_str = "Remove E(S)T's"; } # if my $seq_str = "Add Sequences"; if($gff->{seq} == TRUE) { $seq_str = "Remove Sequences"; } # if my $rel_str = "Add Related Genes"; if($gff->{rel} == TRUE) { $rel_str = "Remove Related Genes"; } # if my $con_str = "Add Confirmed"; if($gff->{con} == TRUE) { $con_str = "Remove Confirmed"; } # if $command = Menu->menu($loci_str, GFF_LOCI, $clones_str, GFF_CLONES, $contigs_str, GFF_CONTIGS, $qtls_str, GFF_QTLS, $ends_str, GFF_ENDS, $mtps_str, GFF_MTPS, $ests_str, GFF_ESTS, $seq_str, GFF_SEQ, $rel_str, GFF_REL, $con_str, GFF_CON, "Add (A)ll", GFF_ALL, "Write GFF (F)ile", GFF_WRITE, "(H)elp", HELP, "(Q)uit", QUIT); $help_message_number = 101 if($command == HELP); } # print_menu 1