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

Diff of /FigWebServices/ss_directed_compare_regions.cgi

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

revision 1.2, Tue Feb 10 16:50:41 2015 UTC revision 1.3, Tue Feb 10 19:59:29 2015 UTC
# Line 1  Line 1 
 ########################################################################  
 use CGI;  
 use FIG_Config;  
   
   
 if (-f "$FIG_Config::data/Global/why_down")  
 {  
     local $/;  
     open my $fh, "<$FIG_Config::data/Global/why_down";  
     my $down_msg = <$fh>;  
   
     print CGI::header();  
     print CGI::head(CGI::title("SEED Server down"));  
     print CGI::start_body();  
     print CGI::h1("SEED Server down");  
     print CGI::p("The seed server is not currently running:");  
     print CGI::pre($down_msg);  
     print CGI::end_body();  
     exit;  
 }  
   
 if ($FIG_Config::readonly)  
 {  
     CGI::param("user", undef);  
 }  
1  # -*- perl -*-  # -*- perl -*-
2  #  #
3  # Copyright (c) 2003-2008 University of Chicago and Fellowship  # Copyright (c) 2003-2008 University of Chicago and Fellowship
# Line 86  Line 61 
61      &HTML::show_page($cgi,$html);      &HTML::show_page($cgi,$html);
62      exit;      exit;
63  }  }
64  my @pegs = &pegs_in_spreadsheet("$subsys/$ss",$abbr);  my @pegs = &pegs_in_spreadsheet("$subsys/$ss",$abbr,$fig);
65    
66  if (@pegs == 0)  if (@pegs == 0)
67  {  {
# Line 101  Line 76 
76  {  {
77      my $sz = (@pegs > $number_pegs) ? $number_pegs : @pegs;      my $sz = (@pegs > $number_pegs) ? $number_pegs : @pegs;
78      my @batch = splice(@pegs,0,$sz);      my @batch = splice(@pegs,0,$sz);
79      my $start_href = &link(\@batch);      my @bpegs = map { $_->[0] } @batch;
80      my $start_link = "<a target=_blank href=$start_href>$batch[0]</a>\n";      my $start_href = &link(\@bpegs);
81        my $start_link = "<a target=_blank href=$start_href>$batch[0]->[0] $batch[0]->[2]</a><br>\n";
82      push(@$html,"<br><br>",$start_link,"<br>\n");      push(@$html,"<br><br>",$start_link,"<br>\n");
83    
84        push(@$html, "<a target=_blank href='$FIG_Config::cgi_url/seedviewer.cgi?feature=$_->[0]'>$_->[0]</a><br>\n") foreach @batch;
85    
86  }  }
87    
88  &HTML::show_page($cgi,$html);  &HTML::show_page($cgi,$html);
# Line 117  Line 96 
96  }  }
97    
98  sub pegs_in_spreadsheet {  sub pegs_in_spreadsheet {
99      my($ssF,$abbr) = @_;      my($ssF,$abbr,$fig) = @_;
100    
101      my $spreadsheet = join("",`cat $ssF/spreadsheet`);      my $spreadsheet = join("",`cat $ssF/spreadsheet`);
102      my($hdrs,undef,$genomes) = split(/\n\/\/\n/,$spreadsheet);      my($hdrs,undef,$genomes) = split(/\n\/\/\n/,$spreadsheet);
# Line 132  Line 111 
111          shift @rows;  # dump variant code          shift @rows;  # dump variant code
112          push(@pegs,map { "fig|$g.peg.$_" } split(/,/,$rows[$i]));          push(@pegs,map { "fig|$g.peg.$_" } split(/,/,$rows[$i]));
113      }      }
114      return @pegs;      @pegs = grep { $fig->is_real_feature($_) } @pegs;
115        my @tuples = map { [$_,$fig->taxonomy_of(&SeedUtils::genome_of($_)),$fig->genus_species(&SeedUtils::genome_of($_))] } @pegs;
116        @tuples = sort { $a->[1] cmp $b->[1] } @tuples;
117        #print STDERR Dumper(\@tuples);
118        #return map { $_->[0] } @tuples;
119        return @tuples;
120  }  }

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3