[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.6, Tue Jan 16 23:11:48 2007 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;
 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'  
                                    }  
   
                         );  
   
9    
10  my $id_string = $cgi->param("ids");  my $id_string = $cgi->param("ids");
11  my $peg = $cgi->param("peg");  my $peg = $cgi->param("peg");
12    
13    &print_header;
14    &print_verbiage;
15    
16  if (!$id_string) {  if (!$id_string) {
17          print "PubMed journals found for this peg were not specific to this peg<p>";          print "PubMed publication(s) found for this PEG  were not specific to this PEG<p>";
18          exit;          exit;
19          }          }
20    
21    &print_peg_info;
22    
23  print "<table>";  my $pmid_output = &FIG::run_gathering_output("$FIG_Config::bin/get_pubmed_journals", $id_string);
 print "<tr><td bgcolor=#6666FF>Peg</td><td> $peg</td></tr>";  
 my $role = $fig->function_of($peg);  
 print "<tr><td bgcolor=#6666FF>Functional Role</td><td> $role</td></tr></table>";  
24    
25  print $cgi->hr();  my @publications_list = split(/ /, $pmid_output);
26  print "<I>PubMed journals for  $id_string ...</I><p>";  my %publications_list_seen = ();
27    my %publications_to_pegs = ();
28    
 my $pmid_output = &FIG::run_gathering_output("$FIG_Config::bin/get_pubmed_journals", $id_string);  
29    
30  my @journals_list = split(/ /, $pmid_output);  foreach (@publications_list) {
31  my @new_journals = &FigWebServices::SeedComponents::PubMed::sort_journals(\@journals_list);          $publications_list_seen{$_} = "$peg\t$_";
32  my $journal_htmltable = &FigWebServices::SeedComponents::PubMed::journals_as_htmltable(\@new_journals);          $publications_to_pegs{$_} = $peg;
33    }
34    
35    my (@show_notr_publications, @show_r_publications);
36    my ($publication_div, $publication_relevant_div, $publication_notrelevant_div);
37    
38    my @pubmed_rel_attributes = $fig->get_attributes($peg,"PUBMED_CURATED_RELEVANT");
39    my @pubmed_notrel_attributes = $fig->get_attributes($peg,"PUBMED_CURATED_NOTRELEVANT");
40    my @pubmed_attributes = $fig->get_attributes($peg,"PUBMED",undef,undef);
41    
42    &process_attributes(\@pubmed_attributes, "pubmed_plain");
43    &process_attributes(\@pubmed_rel_attributes, "relevant");
44    &process_attributes(\@pubmed_notrel_attributes, "notrelevant");
45    
46    my @filtered_publications;
47    while( my($k,$v) = each(%publications_list_seen)) {
48            if ($k ne "") {
49            $publication_div .= "<li id=\"$k\">$k</li>";
50            push(@filtered_publications,$v);
51            }
52    }
53    
54    my $peg_list;
55    while( my($k,$v) = each(%publications_to_pegs)) {
56            $peg_list .= "$k-$v\;";
57    }
58    
59    
60    
61    my $column_table = &FigWebServices::SeedComponents::PubMed::column_title;
62    my $not_curated_htmltable = &FigWebServices::SeedComponents::PubMed::journals_as_htmltable(\@filtered_publications);
63    my $r_publication_htmltable = &FigWebServices::SeedComponents::PubMed::journals_as_htmltable(\@show_r_publications);
64    my $notr_publication_htmltable = &FigWebServices::SeedComponents::PubMed::journals_as_htmltable(\@show_notr_publications);
65    
66    #Put publications as a string to be passed the next cgi
67    
68  #Put journals as a string to be passed the next cgi  print "<table>";
69    print $column_table;
70    
71  my $journal_info;  if ($not_curated_htmltable) {
72            print $not_curated_htmltable;
73    }
74    if ($r_publication_htmltable) {
75            print "<tr><td colspan=3><ul><li>Curated to be relevant publication(s):</li></ul></td></tr>";
76            print $r_publication_htmltable;
77    }
78    
79  foreach (@new_journals) {  if ($notr_publication_htmltable) {
80            print "<tr><td colspan=3><ul><li>Curated to be not relevant publication(s):</li></ul></td></tr>";
81            print $notr_publication_htmltable;
82            print "</table>";
83    }
84    
85          my($pmid, $year,$month,$date,$title) = split(/\t/,$_);  if ((! $notr_publication_htmltable) || ( ! $r_publication_htmltable) ) {
86          my $j = "$pmid|$title";          print "</table>";
         $journal_info .= $j.";";  
87  }  }
88    
89    my $publication_info;
90    print $cgi->hr();
91    &print_form;
92    
93    
94    ###############
95    # Subroutines
96    ###############
97    
98    sub print_header {
99    
100    print $cgi->header;
101    print $cgi->start_html( -title=>'PubMed for PEG',
102                            -style=>{ -src => 'Html/dnd.css'},
103                            -script=> [
104                                       {-language => 'JAVASCRIPT',
105                                        -src => 'Html/drag_and_drop.js'},
106                                    ]
107                              );
108    
 my $count=1;  
 my $journal_div;  
 foreach (@journals_list) {  
109    
     $journal_div .= "<li id=\"$_\">$_</li>";  
     $count++;  
110  }  }
111    
112  print $journal_htmltable;  sub print_verbiage {
113    
114    print "<table><tr><td bgcolor=#D2E6F0>Introduction</td></tr></table>";
115    print "This website automates the process of finding relevant publications associated with a protein encoded gene (PEG). Aliases associated with the PEG are used as the search terms to query the PubMed database to find publications. Our tool does not get all journals associated with the PEG. A filter is used to remove publications that may be genome papers, and other publications that may not be relevant to the PEG. <p> Since this tool is an automated tool  to query PubMed database and automated tools can not replace human knowledge, relevant and not relevant papers may be returned with the search.  It is up to the curator to deem the  publications as relevant and not relevant publications.";
116    
 if (!$pmid_output) {  
         print "PubMed journals found for this peg were not specific to this functional role<p>";  
         return;  
117          }          }
118    
119    
120    sub print_peg_info {
121    my $role = $fig->function_of($peg);
122    print $cgi->hr();
123    print "<table>";
124    print "<tr><td bgcolor=#D2E6F0>Functional Role</td><td> $role</td></tr></table>";
125    print "<I>Getting PubMed publication(s) for $id_string ...</I><p>";
126  print $cgi->hr();  print $cgi->hr();
127    }
128    
129    
130    sub print_form {
131    
132  print "  print "
133    
134  If you believe that the articles are relevant or not relevant, drag and drop the  This section allows you to curate the publications. 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.  
135    
136  <div id=\"submit_line\">  <div>
137  <form name=\"myForm\" method=\"post\" action=\"save_to_attributes.cgi\" onsubmit=\"saveDragDropNodes()\">  <form name=\"myForm\" method=\"post\" action=\"save_to_attributes.cgi\" onsubmit=\"saveDragDropNodes()\">
138  <input type=\"hidden\" name=\"listOfItems\" value=\"\">  <p><input type=\"textbox\" name=\"master\" value=\"Name\"> Your name
 <input type=\"hidden\" name=\"all_journals\" value=\"$journal_info\">  
 <input type=\"hidden\" name=\"peg\" value=\"$peg\">  
 <input type=\"textbox\" name=\"PMID\" value=\"\"> Journal Identifier (ie PMID)  
 <p><input type=\"textbox\" name=\"date\" value=\"\"> Publication Date: Year Month Day  
 <p><input type=\"textbox\" name=\"title\" value=\"\"> Title of the Journal Article  
 <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.  
139  <p><input type=\"submit\" value=\"Save to attributes\" name=\"save\">  <p><input type=\"submit\" value=\"Save to attributes\" name=\"save\">
140    <p>
141    You may curate the publication information by
142    <ul>
143    <li> Adding your own publication for this peg</li>
144    
145    <input type=\"hidden\" name=\"listOfItems\" value=\"\">
146    <input type=\"hidden\" name=\"all_publications\" value=\"$publication_info\">
147    <input type=\"hidden\" name=\"listOfPeg\" value=\"$peg_list\">
148    <input type=\"hidden\" name=\"purpose\" value=\"peg\">
149    <input type=\"hidden\" name=\"purpose_peg\" value=\"$peg\">
150    <input type=\"textbox\" size=50 name=\"PMID\" value=\"PMID1 PMID2 PMID3\"> Publication Identifier (Multiple PMIDs should be separated by a space)
151    PMID
152  </form>  </form>
153    <p>
154    <li> Drag and drop the PMID to the appropriate containers (Relevant Publication(s)/ Not Relevant Publication(s)).
155    Containers will be empty if there are no pmid found for this peg.</li>
156  </div>  </div>
   
157  <div id=\"dhtmlgoodies_dragDropContainer\">  <div id=\"dhtmlgoodies_dragDropContainer\">
158          <div id=\"topBar\">          <div id=\"topBar\">
159          </div>          </div>
160          <div id=\"dhtmlgoodies_listOfItems\">          <div id=\"dhtmlgoodies_listOfItems\">
161                  <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\">$publication_div</ul></div>
162          </div>          </div>
163          <div id=\"dhtmlgoodies_mainContainer\">          <div id=\"dhtmlgoodies_mainContainer\">
164                  <div><p>Relevant Journal(s)</p><ul id=\"Curated_Relevant_PUBMED\"></ul></div>                  <div><p>RELEVANT Publication(s) (curated by)</p><ul id=\"PUBMED_CURATED_RELEVANT\">$publication_relevant_div</ul></div>
165                  <div><p>Not Relevant Journal(s)</p><ul id=\"Curated_NotRelevant_PUBMED\"></ul></div>                  <div><p>NOT RELEVANT Publication(s) (curated by)</p><ul id=\"PUBMED_CURATED_NOTRELEVANT\">$publication_notrelevant_div</ul></div>
166          </div>          </div>
167  </div>  </div>
168    </ul>
169  <ul id=\"dragContent\"></ul>  <ul id=\"dragContent\"></ul>
170  <div id=\"dragDropIndicator\"><img src=\"images/insert.gif\"></div>  <div id=\"dragDropIndicator\"></div>
171  <div id=\"saveContent\"><div>  <div id=\"saveContent\"><div>
172  ";  ";
173    
174    }
175    
176    sub process_attributes {
177            my ($attribute_in, $what) = @_;
178            my @att_in = @{$attribute_in};
179    
180            foreach(@att_in) {
181                    my @line = @{$_};
182                    my $peg  = $line[0];
183                    my $key  = $line[1];
184                    my $value = $line[2];
185                    my ($curator,$pmid,$title) = split(/,/,$value);
186    
187                    if($what eq 'pubmed_plain') {
188                            $pmid = $value;
189    
190                    }
191    
192                    $publications_to_pegs{$pmid} = $peg;
193    
194                    #delete existing pmids from all publication_list
195                    if($what eq 'relevant') {
196                            delete $publications_list_seen{$pmid};
197                            push(@show_r_publications, "$peg\t$pmid");
198                            $publication_relevant_div .= "<li id=\"$pmid($curator)\">$pmid($curator)</li>";
199    
200                    }
201                    if($what eq 'notrelevant') {
202                            delete $publications_list_seen{$pmid};
203                            push(@show_notr_publications, "$peg\t$pmid");
204                            $publication_notrelevant_div .= "<li id=\"$pmid($curator)\">$pmid($curator)</li>";
205                    }
206    
207                    if(($what eq 'pubmed_plain') && (! $publications_list_seen{$pmid})) {
208    
209                            $publications_list_seen{$pmid} = "$peg\t$pmid";
210                    }
211            }
212    }
213    
214    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3