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

Diff of /FigWebServices/families_on_tree.cgi

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

revision 1.1, Tue Apr 22 14:49:38 2014 UTC revision 1.4, Mon May 5 18:05:26 2014 UTC
# Line 205  Line 205 
205      push(@$html,"<pre>\n$tree\n</pre>\n");      push(@$html,"<pre>\n$tree\n</pre>\n");
206  }  }
207    
208    sub fam_in_set {
209        my($fam,$set) = @_;
210    
211        my @fams = split(/,/,$set);
212        my $i;
213        for ($i=0; ($i < @fams) && ($fam ne $fams[$i]); $i++) {}
214        return ($i < @fams);
215    }
216    
217  sub show_family1 {  sub show_family1 {
218      my($cgi,$dataDF,$html,$family) = @_;      my($cgi,$dataDF,$html,$families) = @_;
219    
220      $dataDF =~ /([^\/]+)$/;      $dataDF =~ /([^\/]+)$/;
221      my $dataD = $1;      my $dataD = $1;
# Line 214  Line 223 
223      my $func;      my $func;
224      foreach $_ (`cut -f1,2 $dataDF/families.all`)      foreach $_ (`cut -f1,2 $dataDF/families.all`)
225      {      {
226          if (($_ =~ /^(\d+)\t(\S[^\t]*\S)/) && ($1 == $family)) { $func = $2 }  #       if (($_ =~ /^(\d+)\t(\S[^\t]*\S)/) && ($1 == $families)) { $func = $2 }
227            if (($_ =~ /^(\d+)\t(\S[^\t]*\S)/) && &fam_in_set($1,$families)) { $func = $2 }
228      }      }
229      my %genome_names = map { ($_ =~ /^(\S+)\t(\S.*\S)/) ? ($1 => $2) : () } `cat $dataDF/genome.names`;      my %genome_names = map { ($_ =~ /^(\S+)\t(\S.*\S)/) ? ($1 => $2) : () } `cat $dataDF/genome.names`;
230      my $col_hdrs = ['','Genome','Genome Name','Peg'];      my $col_hdrs = ['','Genome','Genome Name','Peg'];
231      my @tuples   = map { my $tuple = $_; $tuple->[3] = &peg_link($tuple->[3]); $tuple }      my @tuples   = map { my $tuple = $_; $tuple->[3] = &peg_link($tuple->[3]); $tuple }
232                     sort { $a->[1] cmp $b->[1] }                     sort { $a->[1] cmp $b->[1] }
233                     map { (($_ =~ /^(\d+)\t([^\t]*)\t(fig\|(\d+\.\d+)\.peg\.\d+)/) && ($1 == $family)) ?                     map { (($_ =~ /^(\d+)\t([^\t]*)\t(fig\|(\d+\.\d+)\.peg\.\d+)/) && &fam_in_set($1,$families)) ?
234                               [$cgi->checkbox(-name => "check.$3",-checked => 1,-label => ''),                               [$cgi->checkbox(-name => "check.$3",-checked => 1,-label => ''),
235                                $4,                                $4,
236                                $genome_names{$4},                                $genome_names{$4},
237                                $3] : () }                                $3] : () }
238                     `cut -f1,2,4 $dataDF/families.all`;                     `cut -f1,2,4 $dataDF/families.all`;
239      push(@$html,$cgi->start_form(-action => "./families4_on_tree.cgi"));      push(@$html,$cgi->start_form(-action => "./families5_on_tree.cgi"));
240      push(@$html,"<br><br>\n",&HTML::make_table($col_hdrs,\@tuples,"Distribution of Family $family: $func"),$cgi->hr,"\n");      push(@$html,"<br><br>\n",&HTML::make_table($col_hdrs,\@tuples,"Distribution of Family $families: $func"),$cgi->hr,"\n");
241      push(@$html,"<input type=hidden name=dataD value=$dataD>\n");      push(@$html,"<input type=hidden name=dataD value=$dataD>\n");
242      push(@$html,"<input type=hidden name=request value=show_ali_or_occurs_tree>\n");      push(@$html,"<input type=hidden name=request value=show_ali_or_occurs_tree>\n");
243      push(@$html,$cgi->submit('alignment'),      push(@$html,$cgi->submit('alignment'),
# Line 457  Line 467 
467      $dataDF =~ /([^\/]+)$/;      $dataDF =~ /([^\/]+)$/;
468      my $dataD = $1;      my $dataD = $1;
469    
470      return ("<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_family_tree&family=$fam&dataD=$dataD>tree</a>",      return ("<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_family_tree&family=$fam&dataD=$dataD>tree</a>",
471              "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_family_pegs&family=$fam&pegs=1&dataD=$dataD>PEGs:$fam</a>");              "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_family_pegs&family=$fam&pegs=1&dataD=$dataD>PEGs:$fam</a>");
472  }  }
473    
474  sub show_fam_table_link {  sub show_fam_table_link {
# Line 467  Line 477 
477      $dataDF =~ /([^\/]+)$/;      $dataDF =~ /([^\/]+)$/;
478      my $dataD = $1;      my $dataD = $1;
479    
480      return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?family=$fam&pegs=1&request=show_family_pegs&dataD=$dataD>$fam: PEGs</a>";      return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?family=$fam&pegs=1&request=show_family_pegs&dataD=$dataD>$fam: PEGs</a>";
481  }  }
482    
483  sub show_func {  sub show_func {
# Line 526  Line 536 
536      foreach my $func (`svr_sphinx_indexing -k \'$keywords\' | cut -f1 | svr_function_of | cut -f2`)      foreach my $func (`svr_sphinx_indexing -k \'$keywords\' | cut -f1 | svr_function_of | cut -f2`)
537      {      {
538          chomp $func;          chomp $func;
539            $func =~ s/\s*\#.*$//;
540          if ($functions_in_fams->{$func})          if ($functions_in_fams->{$func})
541          {          {
542              $funcs_to_show{$func}++;              $funcs_to_show{$func}++;
# Line 682  Line 693 
693      print $cgi->header;      print $cgi->header;
694      print "<h3>$g</h3>\n";      print "<h3>$g</h3>\n";
695      print "<ol>\n";      print "<ol>\n";
696      print "<li> <a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_otu_tree&dataD=$g>Gains/losses of Gene Families</a>\n";      print "<li> <a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_otu_tree&dataD=$g>Gains/losses of Gene Families</a>\n";
697      print "<li><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_kovbassa&dataD=$g>Genes that Distinguishing Families (Genes as Signatures)</a>\n";      print "<li><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_kovbassa&dataD=$g>Genes that Distinguishing Families (Genes as Signatures)</a>\n";
698      print "<li><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_adjacency&dataD=$g>Changes in Adjacency</a>\n";      print "<li><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_adjacency&dataD=$g>Changes in Adjacency</a>\n";
699      print "</ol>\n";      print "</ol>\n";
700    
701      push(@$html,"<br>",      push(@$html,"<br>",
702                  $cgi->start_form(-action => "./families4_on_tree.cgi"),                  $cgi->start_form(-action => "./families_on_tree.cgi"),
703                  $cgi->textfield(-name => 'keywords',-size => 100),                  $cgi->textfield(-name => 'keywords',-size => 100),
704                  $cgi->hidden(-override => 1,-name => 'request',-value => 'show_indexed_funcs'),                  $cgi->hidden(-override => 1,-name => 'request',-value => 'show_indexed_funcs'),
705                  $cgi->hidden(-override => 1,-name => 'dataD',-value => $dataD),                  $cgi->hidden(-override => 1,-name => 'dataD',-value => $dataD),
# Line 740  Line 751 
751          print "<h2>Genera Available</h2>\n";          print "<h2>Genera Available</h2>\n";
752          foreach my $g (sort @genera)          foreach my $g (sort @genera)
753          {          {
754              print "<h3><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_options_for_otu&dataD=$g>$g</a>\n";              print "<h3><a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_options_for_otu&dataD=$g>$g</a>\n";
755          }          }
756      }      }
757      else      else
# Line 768  Line 779 
779    
780      if (! $function) { return '' }      if (! $function) { return '' }
781      my $functionQ = uri_escape($function);      my $functionQ = uri_escape($function);
782      return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_func&function=$functionQ&dataD=$dataD>$function</a>"      return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_func&function=$functionQ&dataD=$dataD>$function</a>"
783  }  }
784    
785  sub virulence_functions_link {  sub virulence_functions_link {
# Line 777  Line 788 
788      if ((-s "$dataDF/virulence.functions") && ($dataDF =~ /([^\/]+)$/))      if ((-s "$dataDF/virulence.functions") && ($dataDF =~ /([^\/]+)$/))
789      {      {
790          my $dataDQ = uri_escape($1);          my $dataDQ = uri_escape($1);
791          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_virulence_functions&dataD=$dataDQ>Some Posssible Functions Associated with Virulence</a>";          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_virulence_functions&dataD=$dataDQ>Some Posssible Functions Associated with Virulence</a>";
792      }      }
793      return '';      return '';
794  }  }
# Line 789  Line 800 
800      if ($dataDF =~ /([^\/]+)$/)      if ($dataDF =~ /([^\/]+)$/)
801      {      {
802          my $dataDQ = uri_escape($1);          my $dataDQ = uri_escape($1);
803          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?family=$fam&union=$union&dataD=$dataDQ&request=show_family_tree>Family on Tree</a>";          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?family=$fam&union=$union&dataD=$dataDQ&request=show_family_tree>Family on Tree</a>";
804      }      }
805      return '';      return '';
806  }  }
# Line 798  Line 809 
809      my($dataD,$node,$type) = @_;      my($dataD,$node,$type) = @_;
810      if ($type eq "families")      if ($type eq "families")
811      {      {
812          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_node&dataD=$dataD&node=$node&type=families>$node</a>";          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_node&dataD=$dataD&node=$node&type=families>$node</a>";
813      }      }
814      else      else
815      {      {
816          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_node&dataD=$dataD&node=$node&type=adjacency>$node</a>";          return "<a target=_blank href=http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_node&dataD=$dataD&node=$node&type=adjacency>$node</a>";
817      }      }
818  }  }
819    
# Line 810  Line 821 
821      my($dataD,$family,$coupled) = @_;      my($dataD,$family,$coupled) = @_;
822      my %tmp = map { $_ => 1 } ($family,@$coupled);      my %tmp = map { $_ => 1 } ($family,@$coupled);
823      my $families = join(",",sort { $a <=> $b} keys(%tmp));      my $families = join(",",sort { $a <=> $b} keys(%tmp));
824      return "<a target=_blank href=\"http://bioseed.mcs.anl.gov/ross/FIG/families4_on_tree.cgi?request=show_clusters&dataD=$dataD&families=$families\">$family</a>";      return "<a target=_blank href=\"http://bioseed.mcs.anl.gov/ross/FIG/families_on_tree.cgi?request=show_clusters&dataD=$dataD&families=$families\">$family</a>";
825  }  }
826    
827  sub show_clusters {  sub show_clusters {
# Line 891  Line 902 
902      }      }
903      my $tree = join("",@tree);      my $tree = join("",@tree);
904      push(@$html,"<br>",      push(@$html,"<br>",
905                  $cgi->start_form(-action => "./families4_on_tree.cgi"),                  $cgi->start_form(-action => "./families_on_tree.cgi"),
906                  $cgi->hidden(-override => 1,-name => 'request',-value => 'compute_kovbassa_sigs'),                  $cgi->hidden(-override => 1,-name => 'request',-value => 'compute_kovbassa_sigs'),
907                  $cgi->hidden(-override => 1,-name => 'dataD',-value => $dataD),                  $cgi->hidden(-override => 1,-name => 'dataD',-value => $dataD),
908                  "<pre>\n$tree\n</pre>\n",                  "<pre>\n$tree\n</pre>\n",

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3