[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.3, Fri May 2 22:17:50 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 => "./families_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'),

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3