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

Annotation of /FigWebServices/ACH_resolution.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (view) (download)

1 : overbeek 1.1 # -*- perl -*-
2 :     #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 :    
20 :     use FIG;
21 : olson 1.13 use DBKernel;
22 :    
23 : overbeek 1.1 my $fig = new FIG;
24 :    
25 : olson 1.13 my $achDB = DBKernel->new('mysql', 'fig_anno_v5', 'ach', undef, undef, 'anno-3.nmpdr.org');
26 :    
27 : overbeek 1.1 use HTML;
28 :     use strict;
29 :     use URI::Escape;
30 :    
31 :     use CGI;
32 :     my $cgi = new CGI;
33 :    
34 : overbeek 1.5 if (0)
35 : overbeek 1.1 {
36 :     my $VAR1;
37 :     eval(join("",`cat /tmp/ACH_res_parms`));
38 :     $cgi = $VAR1;
39 :     # print STDERR &Dumper($cgi);
40 :     }
41 :    
42 :     if (0)
43 :     {
44 :     print $cgi->header;
45 :     my @params = $cgi->param;
46 :     print "<pre>\n";
47 :     foreach $_ (@params)
48 :     {
49 :     print "$_\t:",join(",",$cgi->param($_)),":\n";
50 :     }
51 :    
52 :     if (0)
53 :     {
54 :     if (open(TMP,">/tmp/ACH_res_parms"))
55 :     {
56 :     print TMP &Dumper($cgi);
57 :     close(TMP);
58 :     }
59 :     }
60 :     exit;
61 :     }
62 :    
63 :     my $html = [];
64 :     unshift @$html, "<TITLE>ACH Resolution</TITLE>\n";
65 :    
66 :     my $nmpdr_user = $cgi->param('nmpdr_user');
67 :     my $non_nmpdr_user = $cgi->param('non_nmpdr_user');
68 :     my $request = $cgi->param('request');
69 :     my $curator = $cgi->param('curator');
70 :    
71 : overbeek 1.12 if ($request eq "download")
72 :     {
73 :     &download($fig,$cgi,$html);
74 :     }
75 :     elsif (((! $nmpdr_user) && (! $non_nmpdr_user)) || ($nmpdr_user && $non_nmpdr_user))
76 : overbeek 1.1 {
77 :     &get_user($fig,$cgi,$html);
78 :     }
79 : overbeek 1.6 elsif ($non_nmpdr_user && (! $request))
80 :     {
81 :     &process_non_nmpdr($fig,$cgi,$html,$non_nmpdr_user);
82 :     }
83 : overbeek 1.1 elsif ($nmpdr_user && (! $request))
84 :     {
85 :     &process_nmpdr($fig,$cgi,$html,$nmpdr_user);
86 :     }
87 :     elsif ($nmpdr_user && ($request eq "show_role_diffs"))
88 :     {
89 :     &show_role_diffs($fig,$cgi,$html,$nmpdr_user,$curator);
90 :     }
91 :     elsif ($nmpdr_user && ($request eq "set_role_diffs"))
92 :     {
93 :     &set_role_diffs($fig,$cgi,$html);
94 :     }
95 : overbeek 1.3 elsif ($nmpdr_user && ($request eq "show_peg_diffs"))
96 :     {
97 :     &show_peg_diffs($fig,$cgi,$html,$nmpdr_user,$curator);
98 :     }
99 : overbeek 1.6 elsif (($nmpdr_user || $non_nmpdr_user) && ($request eq "show_comments"))
100 : overbeek 1.4 {
101 :     &show_comments($fig,$cgi,$html);
102 :     }
103 : overbeek 1.6 elsif (($nmpdr_user || $non_nmpdr_user) && ($request eq "create_comment"))
104 : overbeek 1.5 {
105 :     &create_comment($fig,$cgi,$html);
106 :     }
107 : overbeek 1.6 elsif (($nmpdr_user || $non_nmpdr_user) && ($request eq "set_comment"))
108 : overbeek 1.3 {
109 : overbeek 1.4 &set_comment($fig,$cgi,$html);
110 : overbeek 1.3 }
111 : overbeek 1.1 else
112 :     {
113 :     push(@$html,$cgi->h1("What now for $non_nmpdr_user"));
114 :     }
115 : olson 1.13 &HTML::show_page($cgi,$html, 1, undef, undef, undef, undef, { no_fig_search => 1 });
116 : overbeek 1.1
117 :     sub process_nmpdr {
118 :     my($fig,$cgi,$html,$nmpdr_user) = @_;
119 :    
120 :     my $by_curator = &get_diffs_by_curator($fig);
121 :     my $col_hdrs = ["Curator","Number of Unhandled Differences"];
122 :     my $tab = [];
123 :     foreach my $curator (sort keys(%$by_curator))
124 :     {
125 :     my $diffs = $by_curator->{$curator};
126 :     my $n = @$diffs;
127 :     push(@$tab,[$curator,"<a href=./ACH_resolution.cgi?nmpdr_user=$nmpdr_user&curator=$curator&request=show_role_diffs>$n</a>"]);
128 :     }
129 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"Roles that Need to Be Checked"));
130 : overbeek 1.5 push(@$html,"<hr>");
131 :     &make_conflicts_table($fig,$cgi,$html,$nmpdr_user);
132 : overbeek 1.1 }
133 :    
134 :     sub get_diffs_by_curator {
135 :     my($fig) = @_;
136 :    
137 :     my %by_curator;
138 :     my @diffs = &unhandled_diffs($fig);
139 :     foreach my $diff (@diffs)
140 :     {
141 :     my($expertF,$ourF) = @$diff;
142 :     my @curators = &function_to_curators($fig,$ourF);
143 :     foreach my $curator (@curators)
144 :     {
145 :     push(@{$by_curator{$curator}},[$expertF,$ourF]);
146 :     }
147 :     }
148 :     return \%by_curator;
149 :     }
150 :    
151 :     sub function_to_curators {
152 :     my($fig,$func) = @_;
153 :    
154 :     my %curators;
155 :     my @subs = grep { $fig->usable_subsystem($_) } $fig->function_to_subsystems($func);
156 :     foreach my $sub (@subs)
157 :     {
158 :     my $curator = $fig->subsystem_curator($sub);
159 :     if ($curator)
160 :     {
161 :     $curators{$curator} = 1;
162 :     }
163 :     else
164 :     {
165 :     print STDERR "$sub has no curator?\n";
166 :     }
167 :     }
168 :     return sort keys(%curators);
169 :     }
170 :    
171 :     sub unhandled_diffs {
172 :     my($fig) = @_;
173 :    
174 : olson 1.13 my $values = $achDB->SQL("SELECT expertF,ourF FROM ACHres_diffs");
175 : overbeek 1.1
176 :     my %diffH;
177 :     foreach my $tuple (@$values)
178 :     {
179 :     $diffH{join("\t",@$tuple)} = 1;
180 :     }
181 :    
182 : olson 1.13 $values = $achDB->SQL("SELECT DISTINCT expertF,ourF FROM ACHres");
183 : overbeek 1.1 my @todo = grep { ! $diffH{join("\t",@$_)} } @$values;
184 :     }
185 :    
186 :     sub get_user {
187 :     my($fig,$cgi,$html) = @_;
188 :    
189 :     push(@$html, $cgi->start_form(-action => "ACH_resolution.cgi",
190 :     -method => 'post'),
191 : overbeek 1.12 "<br><a href=ACH_resolution.cgi?request=download>Download Synonyms</a><br><br>",
192 : overbeek 1.1 'NMPDR User: ',
193 :     $cgi->textfield(-name => "nmpdr_user", -size => 10, -value => ''),
194 :     $cgi->br,$cgi->br,
195 :     'or non_NMPDR_user ',
196 :     $cgi->textfield(-name => "non_nmpdr_user", -size => 10, -value => ''),
197 :     $cgi->br,
198 :     $cgi->submit( 'Declare User' ),
199 :     $cgi->end_form
200 :     );
201 :    
202 :     }
203 :    
204 :     sub show_role_diffs {
205 :     my($fig,$cgi,$html,$nmpdr_user,$curator) = @_;
206 :    
207 :     my $by_curator = &get_diffs_by_curator($fig);
208 :     my @to_show = @{$by_curator->{$curator}};
209 :    
210 :     my $col_hdrs = ["Different","Same","Ignore",'Expert Function','Our Function'];
211 :     my $tab = [];
212 :     foreach my $pair (@to_show)
213 :     {
214 :     my($expertF,$ourF) = @$pair;
215 :     my $key = &uri_escape("$expertF\t$ourF");
216 :     my($dB,$sB,$iB) = $cgi->radio_group( -name => "choices:$key",
217 :     -values => ['d','s','i'],
218 :     -default => '',
219 :     -override => 1);
220 :     push(@$tab,[$dB,$sB,$iB,$expertF,$ourF]);
221 :     }
222 :     push(@$html,$cgi->start_form( -action => "ACH_resolution.cgi", -method => 'post'),
223 :     &HTML::make_table($col_hdrs,$tab,"Check These Roles"),
224 :     $cgi->hidden( -name => 'nmpdr_user', -value => $nmpdr_user),
225 :     $cgi->hidden( -name => 'request', -value => 'set_role_diffs', override => 1),
226 :     $cgi->br,$cgi->submit('record choices'),
227 :     $cgi->end_form
228 :     );
229 :     }
230 :    
231 :     sub set_role_diffs {
232 :     my($fig,$cgi,$html) = @_;
233 :    
234 :     my @params = grep { $_ =~ /^choices/ } $cgi->param();
235 :     my $n = 0;
236 :     foreach my $param (@params)
237 :     {
238 :     my $value = $cgi->param($param);
239 :     my $key = &uri_unescape($param);
240 :     if ($key =~ /^choices:(.*)\t(.*)/)
241 :     {
242 :     my($expertF,$ourF) = ($1,$2);
243 :     my $expertFQ = quotemeta $expertF;
244 :     my $ourFQ = quotemeta $ourF;
245 : olson 1.13 if ($achDB->SQL("INSERT INTO ACHres_diffs (expertF,ourF,status) VALUES ( '$expertFQ' , '$ourFQ' , '$value' )"))
246 : overbeek 1.1 {
247 :     $n++;
248 :     }
249 :     }
250 :     }
251 :     push(@$html,$cgi->h1("Recorded $n Decisions"));
252 :     }
253 : overbeek 1.2
254 :     sub make_conflicts_table {
255 :     my($fig,$cgi,$html,$nmpdr_user) = @_;
256 :    
257 :     my $by_curator = &get_peg_diffs_by_curator($fig);
258 :     my $col_hdrs = ["Curator","Number of PEG Differences"];
259 :     my $tab = [];
260 :     foreach my $curator (sort keys(%$by_curator))
261 :     {
262 :     my $diffs = $by_curator->{$curator};
263 :     my $n = &num_diffs($diffs);
264 :     push(@$tab,[$curator,"<a href=./ACH_resolution.cgi?nmpdr_user=$nmpdr_user&curator=$curator&request=show_peg_diffs>$n</a>"]);
265 :     }
266 : overbeek 1.5 push(@$html,"<br><hr>\n");
267 : overbeek 1.2 push(@$html,&HTML::make_table($col_hdrs,$tab,'Remaining PEG Differences'));
268 :     }
269 :    
270 :     sub num_diffs {
271 :     my($xL) = @_;
272 :    
273 :     my $n = 0;
274 :     foreach my $x (@$xL)
275 :     {
276 :     $n += @{$x->[3]};
277 :     }
278 :     return $n;
279 :     }
280 :    
281 :     sub get_peg_diffs_by_curator {
282 :     my ($fig) = @_;
283 :    
284 :     my %by_curator;
285 :     my @diffs = &get_role_conflicts($fig);
286 :     foreach my $diff (@diffs)
287 :     {
288 :     my($expert,$expertF,$ourF,$pegs) = @$diff;
289 :     my @curators = &function_to_curators($fig,$ourF);
290 :     foreach my $curator (@curators)
291 :     {
292 :     push(@{$by_curator{$curator}},[$expert,$expertF,$ourF,$pegs]);
293 :     }
294 :     }
295 :     return \%by_curator;
296 :     }
297 :    
298 :     sub get_role_conflicts {
299 :     my($fig) = @_;
300 :    
301 : olson 1.13 my $conflicts = $achDB->SQL("SELECT expertF,ourF FROM ACHres_diffs WHERE status = 'd'");
302 : overbeek 1.2 my @grouped = ();
303 :     foreach my $tuple (@$conflicts)
304 :     {
305 :     my($expertF,$ourF) = @$tuple;
306 : overbeek 1.7 my $expertFQ = quotemeta $expertF;
307 :     my $ourFQ = quotemeta $ourF;
308 : olson 1.13 my $pegs = $achDB->SQL("SELECT peg,expert,expert_id FROM ACHres WHERE (expertF = '$expertFQ') AND (ourF = '$ourFQ')");
309 : overbeek 1.4 my @sorted = sort { ($a->[1] cmp $b->[1]) or ($a->[0] cmp $b->[0]) or ($a->[2] cmp $b->[2]) } @$pegs;
310 : overbeek 1.2 my $x;
311 :     while (@sorted > 0)
312 :     {
313 :     my $group = [];
314 :     my $curr = $sorted[0]->[1];
315 :     while ((@sorted > 0) && ($sorted[0]->[1] eq $curr))
316 :     {
317 :     my $x = shift @sorted;
318 :    
319 :     my $peg = $x->[0];
320 :     my $func = $fig->function_of($peg);
321 :     if ($ourF eq $func)
322 :     {
323 : overbeek 1.9 my @subsys = grep { $fig->usable_subsystem($_) } $fig->peg_to_subsystems($peg);
324 :     if (@subsys > 0)
325 :     {
326 :     push(@$group,[$peg,$x->[2]]);
327 :     }
328 : overbeek 1.2 }
329 :     }
330 : overbeek 1.6 if (@$group > 0)
331 :     {
332 :     push(@grouped,[$curr,$expertF,$ourF,$group]);
333 :     }
334 : overbeek 1.2 }
335 :     }
336 : overbeek 1.6 @grouped = &filter_expert_funcs($fig,\@grouped);
337 : overbeek 1.2 return @grouped;
338 :     }
339 : overbeek 1.3
340 : overbeek 1.6 sub filter_expert_funcs {
341 :     my($fig,$grouped) = @_;
342 :    
343 :     my @pegs = ();
344 :     my %pegs_to_check;
345 :     my($tuple1,$tuple2);
346 :     foreach $tuple1 (@$grouped)
347 :     {
348 :     my($expert,$expertF,$ourF,$grouped_pegs) = @$tuple1;
349 :     foreach $tuple2 (@$grouped_pegs)
350 :     {
351 :     my($peg,$expert_id) = @$tuple2;
352 :     $pegs_to_check{$peg} = 1;
353 :     }
354 :     }
355 :    
356 :     my @expert_assertions = &FIG::get_expert_assertions([keys(%pegs_to_check)]);
357 :     my %assertions;
358 :     foreach $tuple1 (@expert_assertions)
359 :     {
360 :     my($peg,$who,$expertF) = @$tuple1;
361 :     $assertions{$peg}->{$expertF}->{$who} = 1;
362 :     }
363 :    
364 :     my @groups1 = ();
365 :     foreach $tuple1 (@$grouped)
366 :     {
367 :     my($expert,$expertF,$ourF,$grouped_pegs) = @$tuple1;
368 :     my $grouped_pegs2 = [];
369 :     foreach $tuple2 (@$grouped_pegs)
370 :     {
371 :     my($peg,$expert_id) = @$tuple2;
372 :     if ($assertions{$peg}->{$expertF}->{$expert})
373 :     {
374 :     push(@$grouped_pegs2,[$peg,$expert_id]);
375 :     }
376 :     }
377 :     if (@$grouped_pegs2 > 0)
378 :     {
379 :     push(@groups1,[$expert,$expertF,$ourF,$grouped_pegs2]);
380 :     }
381 :     }
382 :     return @groups1;
383 :     }
384 :    
385 :    
386 : overbeek 1.3 sub show_peg_diffs {
387 :     my($fig,$cgi,$html,$nmpdr_user,$curator) = @_;
388 :    
389 :     my $by_curator = &get_peg_diffs_by_curator($fig);
390 :     my @to_show = @{$by_curator->{$curator}};
391 :    
392 : overbeek 1.4 my $col_hdrs = ["Expert",'Expert Function','PEG','Our Function','',''];
393 : overbeek 1.3 my $tab = [];
394 :     foreach my $tuple (@to_show)
395 :     {
396 :     my($expert,$expertF,$ourF,$group) = @$tuple;
397 : overbeek 1.4 my $ourFQ = &uri_escape($ourF);
398 :    
399 : overbeek 1.3 foreach my $pair (@$group)
400 :     {
401 :     my($peg,$expert_id) = @$pair;
402 : olson 1.13 my $comments = $achDB->SQL("SELECT comment from ACHres_comments WHERE peg = '$peg'");
403 : overbeek 1.4 my $get_comments = (@$comments > 0) ? "<a href=./ACH_resolution.cgi?nmpdr_user=$nmpdr_user&peg=$peg&request=show_comments>show comments</a>" : "";
404 :    
405 : overbeek 1.5 my $create_comment = "<a href=./ACH_resolution.cgi?nmpdr_user=$nmpdr_user&peg=$peg&function=$ourFQ&request=create_comment>enter comment</a>";
406 :     push(@$tab,[$expert,$expertF,
407 : overbeek 1.6 &anno_link($cgi,$peg),$ourF,
408 : overbeek 1.5 $get_comments,$create_comment]);
409 : overbeek 1.3 }
410 :     }
411 : overbeek 1.6 push(@$html,&HTML::make_table($col_hdrs,$tab,"Check These PEGs"));
412 : overbeek 1.3 }
413 :    
414 : overbeek 1.5 sub create_comment {
415 :     my($fig,$cgi,$html) = @_;
416 :    
417 :     my $peg = $cgi->param('peg');
418 :     my $func = &uri_unescape($cgi->param('function'));
419 : overbeek 1.6 my $protein = $cgi->param('protein');
420 :    
421 : overbeek 1.5 push(@$html,$cgi->start_form( -action => "./ACH_resolution.cgi", -method => 'post'),
422 :     $cgi->hidden( -name => 'nmpdr_user', -value => $nmpdr_user),
423 : overbeek 1.8 $cgi->hidden( -name => 'non_nmpdr_user', -value => $non_nmpdr_user),
424 : overbeek 1.5 $cgi->hidden( -name => 'peg', -value => $peg),
425 : overbeek 1.6 $cgi->hidden( -name => 'protein', -value => $protein),
426 : overbeek 1.5 $cgi->hidden( -name => 'function', -value => $func),
427 :     $cgi->hidden( -name => 'request', -value => 'set_comment', override => 1),
428 :     "<br><br>Enter a Comment to be associated with why $peg has the function<br><br> <b> $func</b><br><br>\n",
429 :     $cgi->textarea( -name => 'comment', -rows => 20, -cols => 100, -override => 1),
430 :     $cgi->br,$cgi->submit('record comment'),
431 :     $cgi->end_form
432 :     );
433 :     }
434 :    
435 : overbeek 1.4 sub set_comment {
436 : overbeek 1.3 my($fig,$cgi,$html) = @_;
437 :    
438 :     my $n = 0;
439 : overbeek 1.4 my $peg = $cgi->param('peg');
440 : overbeek 1.6 my $function = &uri_unescape($cgi->param('function'));
441 : overbeek 1.4 my $nmpdr_user = $cgi->param('nmpdr_user');
442 : overbeek 1.6 my $non_nmpdr_user = $cgi->param('non_nmpdr_user');
443 :    
444 : overbeek 1.4 my $func = $fig->function_of($peg);
445 :     my $comment = $cgi->param('comment');
446 : overbeek 1.6 if ($comment && (($nmpdr_user && ($func eq $function)) || ($non_nmpdr_user && ($func ne $function))))
447 : overbeek 1.4 {
448 :     my $commentQ = quotemeta $comment;
449 : overbeek 1.6 my $functionQ = quotemeta $function;
450 :     my $user = $nmpdr_user ? $nmpdr_user : $non_nmpdr_user;
451 : olson 1.13 if ($achDB->SQL("INSERT INTO ACHres_comments (peg,func,who,comment) VALUES ( '$peg','$functionQ','$user','$commentQ' )"))
452 : overbeek 1.4 {
453 : overbeek 1.5 push(@$html,$cgi->h1("entered a comment for $peg"));
454 : overbeek 1.4 }
455 :     }
456 :     }
457 :    
458 :     sub show_comments {
459 :     my($fig,$cgi,$html) = @_;
460 : overbeek 1.3
461 : overbeek 1.4 my $peg = $cgi->param('peg');
462 : overbeek 1.6 my $protein = $cgi->param('protein');
463 :     my $col_hdrs = ['Function','Who','Comment'];
464 : overbeek 1.4 my $tab = [];
465 : olson 1.13 my $tuples = $achDB->SQL("SELECT func,who,comment FROM ACHres_comments WHERE peg = '$peg'");
466 : overbeek 1.4 foreach my $tuple (@$tuples)
467 : overbeek 1.3 {
468 : overbeek 1.14 $tuple->[2] = "<pre>\n" . $tuple->[2] . "</pre>";
469 : overbeek 1.4 push(@$tab,$tuple);
470 : overbeek 1.3 }
471 : overbeek 1.6 my $title = $cgi->param('nmpdr_user') ? "Comments for $peg" : "Comments for $peg/$protein";
472 :     push(@$html,&HTML::make_table($col_hdrs,$tab,$title));
473 : overbeek 1.4 }
474 :    
475 : overbeek 1.6 sub anno_link {
476 :     my($cgi,$peg) = @_;
477 : overbeek 1.4
478 : overbeek 1.6 my $user = $cgi->param('nmpdr_user');
479 :     return "<a href=\"http://anno-3.nmpdr.org/anno/FIG/protein.cgi?user=$user&prot=$peg\">$peg</a>";
480 : overbeek 1.3 }
481 : overbeek 1.6
482 :     sub process_non_nmpdr {
483 :     my($fig,$cgi,$html,$non_nmpdr_user) = @_;
484 :    
485 :     my @diffs = &get_peg_diffs_by_expert($fig,$cgi,$html,$non_nmpdr_user);
486 :    
487 : overbeek 1.11 my $col_hdrs = ['Expert Function','Protein','SEED ID','Our Function','',''];
488 : overbeek 1.6 my $tab = [];
489 :     foreach my $tuple (@diffs)
490 :     {
491 :     my($expert,$expertF,$ourF,$group) = @$tuple;
492 :     my $expertFQ = &uri_escape($expertF);
493 :    
494 :     foreach my $pair (@$group)
495 :     {
496 :     my($peg,$expert_id) = @$pair;
497 : overbeek 1.11 my $expert_idL = $expert_id;
498 :     $expert_idL =~ s/;/<br>/g;
499 :     my $pegURL = &HTML::alias_url($peg,"SEED");
500 :     my $pegL = "<a href=$pegURL>$peg</a>";
501 :     my $expert_idL = &HTML::set_prot_links($cgi,$expert_idL);
502 : olson 1.13 my $comments = $achDB->SQL("SELECT comment from ACHres_comments WHERE peg = '$peg'");
503 : overbeek 1.6 my $get_comments = (@$comments > 0) ? "<a href=./ACH_resolution.cgi?non_nmpdr_user=$non_nmpdr_user&peg=$peg&protein=$expert_id&request=show_comments>show comments</a>" : "";
504 :    
505 :     my $create_comment = "<a href=./ACH_resolution.cgi?non_nmpdr_user=$non_nmpdr_user&peg=$peg&function=$expertFQ&protein=$expert_id&request=create_comment>enter comment</a>";
506 :     push(@$tab,[$expertF,
507 : overbeek 1.11 $expert_idL,$pegL,$ourF,
508 : overbeek 1.6 $get_comments,$create_comment]);
509 :     }
510 :     }
511 : overbeek 1.10 push(@$html,&HTML::make_table($col_hdrs,$tab,"$non_nmpdr_user, please check These proteins"));
512 : overbeek 1.6 }
513 :    
514 :     sub get_peg_diffs_by_expert {
515 :     my ($fig,$cgi,$html,$non_nmpdr_user) = @_;
516 :    
517 :     my @diffs = &get_role_conflicts($fig);
518 :     return grep { $_->[0] eq $non_nmpdr_user } @diffs;
519 :     }
520 :    
521 : overbeek 1.12 sub download {
522 :     my($fig,$cgi,$html) = @_;
523 :    
524 : olson 1.13 my $syn = $achDB->SQL("SELECT expertF,ourF FROM ACHres_diffs WHERE status = 's'");
525 : overbeek 1.12 my $col_hdrs = ['Expert Function','Our Function'];
526 :     my $tab = [];
527 :    
528 :     foreach my $tuple (@$syn)
529 :     {
530 :     push(@$tab,$tuple);
531 :     }
532 :     push(@$html,&HTML::make_table($col_hdrs,$tab,"Synonyms"));
533 :     push(@$html,"<hr>\n");
534 :     push(@$html,"<br><br><pre>\n");
535 :     foreach my $tuple (@$syn)
536 :     {
537 :     push(@$html,join("\t",@$tuple),"\n");
538 :     }
539 :     push(@$html,"</pre>\n");
540 :     }
541 :    
542 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3