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

Diff of /FigWebServices/subsys.cgi

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

revision 1.21, Thu Dec 9 00:53:45 2004 UTC revision 1.22, Thu Dec 9 06:00:02 2004 UTC
# Line 753  Line 753 
753                  " Max homologous seqs: ",$cgi->textfield(-name => "max_homo", -value => 100, -size => 6),                  " Max homologous seqs: ",$cgi->textfield(-name => "max_homo", -value => 100, -size => 6),
754               );               );
755    
756         # RAE: A new function to reannotate a single column
757         # I don't understand how you get CGI.pm to reset (and never have).
758         # $cgi->delete("col_to_annotate"); # this does nothing to my script and there is always the last number in this box
759         #push(@$html, $cgi->br,"Change annotation for column: ", $cgi->textfield(-name => "col_to_annotate", -size => 7));
760         push(@$html, $cgi->br,"Change annotation for column: ", '<input type="text" name="col_to_annotate" value="" size="7">');
761    
762      if ($can_alter)      if ($can_alter)
763      {      {
764          push(@$html,          push(@$html,
# Line 855  Line 861 
861      {      {
862          &align_column($fig,$cgi,$html,$col,$subsystem);          &align_column($fig,$cgi,$html,$col,$subsystem);
863      }      }
864        elsif ($col = $cgi->param('col_to_annotate'))
865        {
866            &annotate_column($fig,$cgi,$html,$col,$subsystem);
867        }
868    
869  }  }
870    
# Line 1957  Line 1967 
1967    
1968  }  }
1969    
1970    sub annotate_column {
1971        # RAE: I added this function to allow you to reannotate a single column all at once
1972        # this is because I wanted to update some of my annotations after looking at UniProt
1973        # and couldn't see an easy way to do it.
1974        my($fig,$cgi,$html,$col,$subsystem) = @_;
1975        my $checked;
1976        my $roles = [$subsystem->get_roles];
1977        my $colN = &which_column($col,$roles);
1978        my @checked = &seqs_to_align($colN,$subsystem);
1979        return undef unless (@checked);
1980    
1981        # the following is read from fid_checked.cgi
1982        push( @$html, "<table border=1>\n",
1983                       "<tr><td>Protein</td><td>Organism</td><td>Current Function</td><td>By Whom</td></tr>"
1984            );
1985    
1986        foreach my $peg ( @checked ) {
1987            my @funcs = $fig->function_of( $peg );
1988            if ( ! @funcs ) { @funcs = ( ["", ""] ) }
1989            my $nfunc = @funcs;
1990            my $org = $fig->org_of( $peg );
1991            push( @$html, "<tr>",
1992                          "<td rowspan=$nfunc>$peg</td>",
1993                          "<td rowspan=$nfunc>$org</td>"
1994                );
1995            my ($who, $what);
1996            push( @$html, join( "</tr>\n<tr>", map { ($who,$what) = @$_; "<td>$what</td><td>$who</td>" } @funcs ) );
1997            push( @$html, "</tr>\n" );
1998        }
1999        push( @$html, "</table>\n" );
2000    
2001        push( @$html, $cgi->start_form(-action => "fid_checked.cgi", -target=>"_blank"),
2002                  $cgi->br, $cgi->br,
2003                  "<table>\n",
2004                  "<tr><td>New Function:</td>",
2005                  "<td>", $cgi->textfield(-name => "function", -size => 60), "</td></tr>",
2006                  "<tr><td colspan=2>", $cgi->hr, "</td></tr>",
2007                  "<tr><td>New Annotation:</td>",
2008                  "<td rowspan=2>", $cgi->textarea(-name => "annotation", -rows => 30, -cols => 60), "</td></tr>",
2009                  "<tr><td valign=top width=20%><br>", $cgi->submit('add annotation'),
2010                  "<p><b>Please note:</b> At the moment you need to make sure that the annotation in the table at the ",
2011                  "top of this page reflects the new annotation. This may not be updated automatically.</p>",
2012                  "</td></tr>",
2013                  "</table>",
2014                  $cgi->hidden(-name => 'user', -value => $user),
2015                  $cgi->hidden(-name => 'checked', -value => [@checked]),
2016                  $cgi->end_form
2017         );
2018    }
2019    
2020    
2021  sub align_column {  sub align_column {
2022      my($fig,$cgi,$html,$col,$subsystem) = @_;      my($fig,$cgi,$html,$col,$subsystem) = @_;
2023      my($colN,@checked,$cutoff);      my($colN,@checked,$cutoff);
2024    
2025      my $checked;      my $checked;
2026      my $roles = [$subsystem->get_roles];      my $roles = [$subsystem->get_roles];
2027    
2028      if (($colN = &which_column($col,$roles)) &&      if (($colN = &which_column($col,$roles)) &&
2029          ((@checked = &seqs_to_align($colN,$subsystem)) > 1))          ((@checked = &seqs_to_align($colN,$subsystem)) > 1))
2030      {      {

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3