#/usr/bin/perl use FIG; use strict; use CGI; use FigWebServices::SeedComponents::PubMed; my $cgi = new CGI; my $fig = new FIG; print $cgi->header; print $cgi->start_html( -title=>'PubMed for peg', -style=>{ -src => 'Html/dnd.css'}, -script=> [ {-language => 'JAVASCRIPT', -src => 'Html/drag_and_drop.js'}, ] ); my $id_string = $cgi->param("ids"); my $peg = $cgi->param("peg"); if (!$id_string) { print "PubMed journals found for this peg were not specific to this peg

"; exit; } print ""; print ""; my $role = $fig->function_of($peg); print "
Peg $peg
Functional Role $role
"; print $cgi->hr(); print "Getting PubMed journals for $id_string ...

"; my $pmid_output = &FIG::run_gathering_output("$FIG_Config::bin/get_pubmed_journals", $id_string); my @journals_list = split(/ /, $pmid_output); my @new_journals = &FigWebServices::SeedComponents::PubMed::sort_journals(\@journals_list); my $journal_htmltable = &FigWebServices::SeedComponents::PubMed::journals_as_htmltable(\@new_journals); #Put journals as a string to be passed the next cgi my $journal_info; my %journals_seen = (); foreach (@new_journals) { my($pmid, $year,$month,$date,$title) = split(/\t/,$_); my $j = "$pmid|$title"; $journal_info .= $j.";"; $journals_seen{$pmid} = $title; } my @attributes = $fig->get_attributes($peg); my @relevant; my @notrelevant; my @notcurated; foreach (@attributes) { my @att_line = @{$_}; my $key = $att_line[1]; my ($pmid, $title) = split(/\,/,$att_line[2]); if ($key =~ m/\_RELEVANT\_CURATED\_BY\_(.*)/) { my $anno_name = $1; my $pmid_name = "$pmid($anno_name)"; push (@relevant, $pmid_name); delete $journals_seen{$pmid}; } if ($key =~ m/\_NOTRELEVANT\_CURATED\_BY\_(.*)/) { my $anno_name = $1; my $pmid_name = "$pmid($anno_name)"; push (@notrelevant, $pmid_name); delete $journals_seen{$pmid}; } if ($key =~ m/\_NOT\_CURATED\_/) { if($journals_seen{$pmid}) { delete $journals_seen{$pmid}; } else { $journals_seen{$pmid}; } } } #original div my $journal_div; my $journal_relevant_div; my $journal_notrelevant_div; foreach (@notrelevant) { $journal_notrelevant_div .= "

  • $_
  • "; } foreach (@relevant) { $journal_relevant_div .= "
  • $_
  • "; } while( my($k,$v) = each(%journals_seen)) { $journal_div .= "
  • $k
  • "; } #not curated div print $journal_htmltable; if (!$pmid_output) { print "PubMed journals found for this peg were not specific to this functional role

    "; return; } print $cgi->hr(); print " This section allows you to curate the journals. You must be on the annotator's machine and specify your name. Press the \"Save to Attributes\" button for your changes to take effect.

    Your name

    You may curate the journal information by

    PUBMED NOT CURATED

      $journal_div

    RELEVANT Journal(s) (curated by)

      $journal_relevant_div

    NOT RELEVANT Journal(s) (curated by)

      $journal_notrelevant_div
    ";