[Bio] / FigWebServices / index.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.50, Sun Oct 24 02:45:41 2004 UTC revision 1.51, Thu Nov 4 16:13:35 2004 UTC
# Line 45  Line 45 
45  my $html = [];  my $html = [];
46    
47    
48  my($pattern,$seq_pat,$tool,$ids);  my($pattern,$seq_pat,$tool,$ids,$subsearch);
49  my $user = $cgi->param('user');  my $user = $cgi->param('user');
50  if (! $user) { $user = "" }  if (! $user) { $user = "" }
51    
# Line 79  Line 79 
79      }      }
80  }  }
81  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
82    #  Locate PEGs in Subsystems
83    #-----------------------------------------------------------------------
84    elsif ($cgi->param('Find PEGs') && ($subsearch = $cgi->param('subsearch')))
85    {
86        my $genome = $cgi->param('genome');
87        my (@pegs,$peg);
88        if ($subsearch =~ /(fig\|\d+\.\d+\.peg\.\d+)/)
89        {
90    #       handle searching for homologs that occur in subsystems
91            $peg = $1;
92            @pegs = ($peg);
93            push(@pegs,map { $_->id2 } $fig->sims( $peg, 500, 1.0e-10, "fig"));
94            if ($genome)
95            {
96                my $genomeQ = quotemeta $genome;
97                @pegs = grep { $_ =~ /^fig\|$genomeQ/ } @pegs;
98            }
99        }
100        else
101        {
102    #       handle searching for PEGs with functional role in subsystems
103            @pegs = $fig->seqs_with_role($subsearch,"master",$genome);
104        }
105    
106        print $cgi->header;
107        if (@pegs == 0)
108        {
109            print $cgi->h1("Sorry, could not even find PEGs to check");
110        }
111        else
112        {
113            my(@pairs,$pair,@sub);
114            @pairs = map { $peg = $_;
115                          @sub = $fig->peg_to_subsystems($peg);
116                          map { [$peg,$_] } @sub } @pegs;
117            if (@pairs == 0)
118            {
119                print $cgi->h1("Sorry, could not map any PEGs to subsystems");
120            }
121            else
122            {
123                my $col_hdrs = ["PEG","Genome","Subsystem"];
124                my $tab = [ map { $pair = $_;
125                                  [&HTML::fid_link($cgi,$pair->[0]),
126                                   $fig->org_of($pair->[0]),
127                                   &HTML::sub_link($cgi,$pair->[1])] } @pairs];
128                print &HTML::make_table($col_hdrs,$tab,"PEGs that Occur in Subsystems");
129            }
130        }
131        exit;
132    }
133    #-----------------------------------------------------------------------
134  #  Align Sequences  #  Align Sequences
135  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
136  elsif ($cgi->param('Align Sequences'))  elsif ($cgi->param('Align Sequences'))
# Line 461  Line 513 
513                  $cgi->textfield(-name => "seqids", -size => 100),                  $cgi->textfield(-name => "seqids", -size => 100),
514                  $cgi->end_form                  $cgi->end_form
515           );           );
516    
517        push(@$html,
518                    $cgi->hr,
519                    $cgi->h2('Locate PEGs in Subsystems'),
520                    $cgi->start_form(-action => "index.cgi"),
521                    "Enter user: ",
522                    $cgi->textfield(-name => "user", -size => 20), $cgi->br,
523                    $cgi->br,"Genome: ",$cgi->textfield(-name => "genome", -size => 15),$cgi->br,
524                    $cgi->submit('Find PEGs'),": ",
525                    $cgi->textfield(-name => "subsearch", -size => 100),
526                    $cgi->end_form
527             );
528  }  }
529    
530    

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3