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

Diff of /FigWebServices/aliases_to_pubmed.cgi

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

revision 1.1, Fri Aug 18 16:01:53 2006 UTC revision 1.2, Fri Sep 8 20:37:15 2006 UTC
# Line 1  Line 1 
   
1  #/usr/bin/perl  #/usr/bin/perl
2  use FIG;  use FIG;
3  use strict;  use strict;
# Line 7  Line 6 
6    
7  my $cgi =  new CGI;  my $cgi =  new CGI;
8  my $fig =  new FIG;  my $fig =  new FIG;
9    
10  print $cgi->header;  print $cgi->header;
11  print $cgi->start_html( -title=>'PubMed for peg',  print $cgi->start_html( -title=>'PubMed for peg',
12                          -style=>{ -src => 'Html/dnd.css'},                          -style=>{ -src => 'Html/dnd.css'},
13                          -script=> {-language => 'JAVASCRIPT',                          -script=> [
14                                      -src => 'Html/drag_and_drop.js'                                     {-language => 'JAVASCRIPT',
15                                     }                                      -src => 'Html/drag_and_drop.js'},
16                                    ]
17                          );                          );
18    
19    
# Line 32  Line 32 
32  print "<tr><td bgcolor=#6666FF>Functional Role</td><td> $role</td></tr></table>";  print "<tr><td bgcolor=#6666FF>Functional Role</td><td> $role</td></tr></table>";
33    
34  print $cgi->hr();  print $cgi->hr();
35  print "<I>PubMed journals for  $id_string ...</I><p>";  print "<I>Getting PubMed journals for  $id_string ...</I><p>";
36    
37  my $pmid_output = &FIG::run_gathering_output("$FIG_Config::bin/get_pubmed_journals", $id_string);  my $pmid_output = &FIG::run_gathering_output("$FIG_Config::bin/get_pubmed_journals", $id_string);
38    
# Line 43  Line 43 
43  #Put journals as a string to be passed the next cgi  #Put journals as a string to be passed the next cgi
44    
45  my $journal_info;  my $journal_info;
46    my %journals_seen = ();
47    
48  foreach (@new_journals) {  foreach (@new_journals) {
   
49          my($pmid, $year,$month,$date,$title) = split(/\t/,$_);          my($pmid, $year,$month,$date,$title) = split(/\t/,$_);
50          my $j = "$pmid|$title";          my $j = "$pmid|$title";
51          $journal_info .= $j.";";          $journal_info .= $j.";";
52            $journals_seen{$pmid} = $title;
53  }  }
54    
55    my @attributes = $fig->get_attributes($peg);
56    my @relevant;
57    my @notrelevant;
58    my @notcurated;
59    
60    foreach (@attributes) {
61            my @att_line = @{$_};
62            my $key = $att_line[1];
63            my ($pmid, $title)  = split(/\,/,$att_line[2]);
64    
65            if ($key =~ m/\_RELEVANT\_CURATED\_BY\_(.*)/) {
66            my $anno_name = $1;
67            my $pmid_name = "$pmid($anno_name)";
68            push (@relevant, $pmid_name);
69            delete $journals_seen{$pmid};
70            }
71    
72            if ($key =~ m/\_NOTRELEVANT\_CURATED\_BY\_(.*)/) {
73            my $anno_name = $1;
74            my $pmid_name = "$pmid($anno_name)";
75            push (@notrelevant, $pmid_name);
76            delete $journals_seen{$pmid};
77            }
78    
79  my $count=1;          if ($key =~ m/\_NOT\_CURATED\_/) {
80                    if($journals_seen{$pmid}) {
81                      delete $journals_seen{$pmid};
82                    }
83                    else {
84                    $journals_seen{$pmid};
85                    }
86            }
87    }
88    #original div
89  my $journal_div;  my $journal_div;
90  foreach (@journals_list) {  my $journal_relevant_div;
91    my $journal_notrelevant_div;
92    
93      $journal_div .= "<li id=\"$_\">$_</li>";  foreach (@notrelevant) {
94      $count++;      $journal_notrelevant_div .= "<li id=\"$_\">$_</li>";
95  }  }
96    
97    foreach (@relevant) {
98        $journal_relevant_div .= "<li id=\"$_\">$_</li>";
99    }
100    
101    while( my($k,$v) = each(%journals_seen)) {
102            $journal_div .= "<li id=\"$k\">$k</li>";
103    }
104    
105    #not curated div
106    
107    
108  print $journal_htmltable;  print $journal_htmltable;
109    
110  if (!$pmid_output) {  if (!$pmid_output) {
# Line 73  Line 117 
117    
118  print "  print "
119    
120  If you believe that the articles are relevant or not relevant, drag and drop the  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.
 PMID to the appropriate containers (Relevant Journal(s)/ Not Relevant Journal(s)). <p>  
 <p> You may add your own journals for this peg.  
121    
122  <div id=\"submit_line\">  <div>
123  <form name=\"myForm\" method=\"post\" action=\"save_to_attributes.cgi\" onsubmit=\"saveDragDropNodes()\">  <form name=\"myForm\" method=\"post\" action=\"save_to_attributes.cgi\" onsubmit=\"saveDragDropNodes()\">
124    <p><input type=\"textbox\" name=\"master\" value=\"Name\"> Your name
125    <p><input type=\"submit\" value=\"Save to attributes\" name=\"save\">
126    <p>
127    You may curate the journal information by
128    <ul>
129    <li> Adding your own journal for this peg</li>
130    
131  <input type=\"hidden\" name=\"listOfItems\" value=\"\">  <input type=\"hidden\" name=\"listOfItems\" value=\"\">
132  <input type=\"hidden\" name=\"all_journals\" value=\"$journal_info\">  <input type=\"hidden\" name=\"all_journals\" value=\"$journal_info\">
133  <input type=\"hidden\" name=\"peg\" value=\"$peg\">  <input type=\"hidden\" name=\"peg\" value=\"$peg\">
134  <input type=\"textbox\" name=\"PMID\" value=\"\"> Journal Identifier (ie PMID)  <input type=\"textbox\" size=10 name=\"PMID\" value=\"\"> Journal Identifier (ie PMID)
135  <p><input type=\"textbox\" name=\"date\" value=\"\"> Publication Date: Year Month Day  <p><input type=\"textbox\" size=50  name=\"title\" value=\"\"> Title of the Journal Article
136  <p><input type=\"textbox\" name=\"title\" value=\"\"> Title of the Journal Article  <p><input type=\"textbox\" size=50  name=\"url\" value=\"\"> URL of the Journal
137  <p><input type=\"textbox\" name=\"url\" value=\"\"> URL of the Journal  
 <p><input type=\"textbox\" name=\"master\" value=\"Name\">  
 <p> You may only curate the journals on the annotator's master machine and please specify your name.  
 <p><input type=\"submit\" value=\"Save to attributes\" name=\"save\">  
138  </form>  </form>
 </div>  
139    
140    <li> Drag and drop the PMID to the appropriate containers (Relevant Journal(s)/ Not Relevant Journal(s)). </li>
141    </div>
142  <div id=\"dhtmlgoodies_dragDropContainer\">  <div id=\"dhtmlgoodies_dragDropContainer\">
143          <div id=\"topBar\">          <div id=\"topBar\">
144          </div>          </div>
145          <div id=\"dhtmlgoodies_listOfItems\">          <div id=\"dhtmlgoodies_listOfItems\">
146                  <div><p>All Journals </p><ul id=\"Not_Curated_PUBMED\">$journal_div</ul></div>                  <div><p>PUBMED NOT CURATED </p><ul id=\"PUBMED_NOT_CURATED\">$journal_div</ul></div>
147          </div>          </div>
148          <div id=\"dhtmlgoodies_mainContainer\">          <div id=\"dhtmlgoodies_mainContainer\">
149                  <div><p>Relevant Journal(s)</p><ul id=\"Curated_Relevant_PUBMED\"></ul></div>                  <div><p>RELEVANT Journal(s) (curated by)</p><ul id=\"PUBMED_RELEVANT_CURATED\">$journal_relevant_div</ul></div>
150                  <div><p>Not Relevant Journal(s)</p><ul id=\"Curated_NotRelevant_PUBMED\"></ul></div>                  <div><p>NOT RELEVANT Journal(s) (curated by)</p><ul id=\"PUBMED_NOTRELEVANT_CURATED\">$journal_notrelevant_div</ul></div>
151          </div>          </div>
152  </div>  </div>
153    </ul>
154  <ul id=\"dragContent\"></ul>  <ul id=\"dragContent\"></ul>
155  <div id=\"dragDropIndicator\"><img src=\"images/insert.gif\"></div>  <div id=\"dragDropIndicator\"><img src=\"images/insert.gif\"></div>
156  <div id=\"saveContent\"><div>  <div id=\"saveContent\"><div>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3