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

Diff of /FigWebServices/figfam_proto.cgi

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

revision 1.4, Thu May 24 20:09:42 2007 UTC revision 1.6, Fri May 25 16:40:29 2007 UTC
# Line 16  Line 16 
16  my $inputs;  my $inputs;
17  if ($cgi->param('request') )  if ($cgi->param('request') )
18  {  {
19    my $input =$cgi->param('proteins');    my $input =$cgi->param('set_of_pegs');
20    my @inputs = split("\n",$input);    my @inputs = split("\n",$input);
21    
22    if ($cgi->upload('fileupload'))    if ($cgi->upload('fileupload'))
# Line 32  Line 32 
32    
33  elsif ($cgi->param('domain_search') )  elsif ($cgi->param('domain_search') )
34  {  {
   #print STDERR "pressed\n";  
35    my $query_domain =$cgi->param('query_domain');    my $query_domain =$cgi->param('query_domain');
36    &not_in_family_search($cgi,$fig,$query_domain);    &not_in_family_search($cgi,$fig,$query_domain);
37  }  }
# Line 81  Line 80 
80      push @$html,      push @$html,
81      "<br>",      "<br>",
82      "<h3>Pegs with $query_domain Not in $figfam_id</h3>",      "<h3>Pegs with $query_domain Not in $figfam_id</h3>",
83      "<table border><tr><td>PEG</td><td>FUNCTION</td></tr>";      "<table border><tr><td>ORGANISM</td><td>PEG</td><td>SUBSYSTEM</td><td>FUNCTION</td></tr>";
84      my $count = scalar(@returns);      my $count = scalar(@returns);
85      print STDERR "count:$count\n";      #print STDERR "count:$count\n";
86      foreach my $return (@returns){      foreach my $return (@returns){
87          my $peg = @$return[0];          my $peg = @$return[0];
         print STDERR "peg:$peg\n";  
88          if(!$in_family{$peg}){          if(!$in_family{$peg}){
89              #print STDERR "peg:$peg\n";              my $peg_link = &HTML::fid_link($cgi,$peg);
90                my $genome_id;
91                if($peg =~/fig\|(\d+.\d).peg.\d+/){
92                    $genome_id = $1;
93                }
94    
95                my $organism = $fig->genus_species($genome_id);
96                my @subsystems = $fig->subsystems_for_peg($peg);
97                #my @ss_list = map {$_->[0]} @subsystems;
98                my @ss_list = map {"<a href='$FIG_Config::cgi_url/subsys.cgi?usr=&ssa_name="."$_->[0]"."&request=show_ssa&can_alter=&check=&sort=&show_clusters=&show_minus1="."'>$_->[0]</a>"} @subsystems;
99                my $ss_string = join(" ",@ss_list);
100              my $function = $fig->function_of($peg);              my $function = $fig->function_of($peg);
101              push @$html,"<tr><td>$peg</td><td>$function</td></tr>";              push @$html,"<tr><td>$organism</td><td>$peg_link</td><td>$ss_string</td><td>$function</td></tr>";
102          }          }
103      }      }
104    
# Line 104  Line 112 
112  sub analyze_domains  sub analyze_domains
113  {  {
114      my ($cgi,$fig,$given) =@_;      my ($cgi,$fig,$given) =@_;
115        my ($figfam_id,$figfam,$function,$set,$count);
116    
117        if ($cgi->param('figfam_id')){
118            $figfam_id = $cgi->param('figfam_id');
119            $figfam = FigFam->new($fig,$figfam_id);
120            $function = $figfam->family_function();
121            $set = $figfam->pegs_of();
122        }
123    
124        else{
125            my @temp = ();
126            foreach $g (@$given){
127                if($g=~/(fig\|\d+.\d.peg.\d+)/){push(@temp,$1)}
128            }
129            $set = [@temp];
130            $figfam_id = "Arbitrary Set";
131            $function = "Mixed Set";
132        }
133        $count = scalar(@$set);
134    
     my $sops = $cgi->param('set_of_pegs');  
     my $figfam_id = $cgi->param('figfam_id');  
     my $figfam = FigFam->new($fig,$figfam_id);  
     my $function = $figfam->family_function();  
135      my %peg_to_domain;      my %peg_to_domain;
136      my %peg_to_score;      my %peg_to_score;
137      my %domain;      my %domain;
# Line 123  Line 146 
146          my $domain = $parts[0];          my $domain = $parts[0];
147          my $prob = $parts[1];          my $prob = $parts[1];
148          $prob{$domain} = $prob;          $prob{$domain} = $prob;
         #print STDERR "prob:$domain $prob";  
149      }      }
150      close(PROB);      close(PROB);
151    
# Line 136  Line 158 
158      }      }
159      close(IN);      close(IN);
160    
     my $set = $figfam->pegs_of();  
     my  $count = scalar(@$set);  
   
161      push @$html,      push @$html,
162      "<h3>Domain Analysis Results for $count pegs in $figfam_id</h3>",      "<h3>Domain Analysis Results for $count pegs in $figfam_id</h3>",
163      "<h3>Family Function: $function</h3>",      "<h3>Family Function: $function</h3>",
164      "<br>";      "<br>";
165    
   
166      my @databases = ('CDD','PIR','PROSITE','PRODOM');      my @databases = ('CDD','PIR','PROSITE','PRODOM');
167      if($figfam_id){      if($count > 0){
168            #print STDERR "some in set\n";
169          foreach my $db (@databases){          foreach my $db (@databases){
170              foreach $key (keys(%peg_to_score)){delete($peg_to_score{$key})}              foreach $key (keys(%peg_to_score)){delete($peg_to_score{$key})}
171              foreach $key (keys(%peg_to_domain)){delete($peg_to_domain{$key})}              foreach $key (keys(%peg_to_domain)){delete($peg_to_domain{$key})}
172              foreach $key (keys(%domain)){delete($domain{$key})}              foreach $key (keys(%domain)){delete($domain{$key})}
173    
174              push @$html, "<table border>";              push @$html, "<p>","<table border>";
175              my @returns = $fig->get_attributes($set,$db);              my @returns = $fig->get_attributes($set,$db);
176              foreach my $return (@returns){              foreach my $return (@returns){
177                  my $peg = @$return[0];                  my $peg = @$return[0];
# Line 216  Line 235 
235                  my $prob = $prob{$dom};                  my $prob = $prob{$dom};
236                  my $single_family = "multiple";                  my $single_family = "multiple";
237                  if($single{$dom}){$single_family = $single{$dom};}                  if($single{$dom}){$single_family = $single{$dom};}
238                  my $link;                  my $link,$link_text;
239                  if($db eq "CDD"){$link ="http://0-www.ncbi.nlm.nih.gov.library.vu.edu.au:80/Structure/cdd/cddsrv.cgi?uid=";}                  if($db eq "CDD"){$link ="http://0-www.ncbi.nlm.nih.gov.library.vu.edu.au:80/Structure/cdd/cddsrv.cgi?uid=";$link_text="CDD::$dom";}
240                  elsif($db eq "PIR"){$link = "http://pir.georgetown.edu/cgi-bin/ipcSF?id=PIRSF";}                  elsif($db eq "PIR"){$link = "http://pir.georgetown.edu/cgi-bin/ipcSF?id=PIRSF";$link_text="PIR::PIRSF$dom";}
241                  elsif($db eq "PRODOM"){$link = "http://prodom.prabi.fr/prodom/current/cgi-bin/request.pl?question=DBEN&query=PD";}                  elsif($db eq "PRODOM"){$link = "http://prodom.prabi.fr/prodom/current/cgi-bin/request.pl?question=DBEN&query=PD";$link_text="PRODOM::PD$dom";}
242                  else{$link ="http://expasy.org/prosite/PS";}                  else{$link ="http://expasy.org/prosite/PS";$link_text ="PROSITE::PS$dom";}
243                  my $tag = "<a href='$link$dom'>$dom</a>";                  my $tag = "<a href='$link$dom'>$link_text</a>";
244                  push @$html,"<tr><td>$tag</td><td>$instances</td><td>$length</td><td>$begin</td><td>$end</td><td>$prob</td><td>$single_family</td></tr>";                  push @$html,"<tr><td>$tag</td><td>$instances</td><td>$length</td><td>$begin</td><td>$end</td><td>$prob</td><td>$single_family</td></tr>";
245              }              }
246              push @$html,"</table>";              push @$html,"</table>";
247                push @html,"</p>";
248          }          }
249    
250    
251          push @$html,          push @$html,
252            "<h3>Search for Pegs with Domain Not in Family</h3>",
253          $cgi->start_multipart_form(),          $cgi->start_multipart_form(),
254          "<br><table border><tr><td>Search Pegs with Domain Not in Family</td><td>",          "<br><table border><tr><td>Enter Domain using format of Database::ID </td><td>",
255          $cgi->textarea(-name=>"query_domain", -rows=>1, -columns=>15),          $cgi->textarea(-name=>"query_domain", -rows=>1, -columns=>15),
256          "</td><td>",          "</td><td>",
257          $cgi->submit(-name=>'domain_search', -value=>'Not In Family'),          $cgi->submit(-name=>'domain_search', -value=>'Not In Family'),

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3