[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

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

revision 1.126, Fri Jul 16 21:58:03 2004 UTC revision 1.127, Sun Jul 18 22:58:36 2004 UTC
# Line 5447  Line 5447 
5447      my $spreadsheet = [];      my $spreadsheet = [];
5448      my $notes = [];      my $notes = [];
5449    
5450      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5451      if (open(SSA,"<$FIG_Config::data/Subsystems/$ssa/spreadsheet"))      if (open(SSA,"<$FIG_Config::data/Subsystems/$ssa/spreadsheet"))
5452      {      {
5453          my $version = $self->subsystem_version($ssa);          my $version = $self->subsystem_version($ssa);
# Line 5554  Line 5554 
5554  sub is_exchangable_subsystem :scalar {  sub is_exchangable_subsystem :scalar {
5555      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
5556      my $ssa = (@_ == 1) ? $_[0] : $_[1];      my $ssa = (@_ == 1) ? $_[0] : $_[1];
5557      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5558      if (open(TMP,"<$FIG_Config::data/Subsystems/$ssa/EXCHANGABLE"))      if (open(TMP,"<$FIG_Config::data/Subsystems/$ssa/EXCHANGABLE"))
5559      {      {
5560          my $line;          my $line;
# Line 5595  Line 5595 
5595  sub subsystem_version :scalar {  sub subsystem_version :scalar {
5596      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
5597      my $ssa = (@_ == 1) ? $_[0] : $_[1];      my $ssa = (@_ == 1) ? $_[0] : $_[1];
5598      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5599    
5600      if (open(VER,"<$FIG_Config::data/Subsystems/$ssa/VERSION"))      if (open(VER,"<$FIG_Config::data/Subsystems/$ssa/VERSION"))
5601      {      {
# Line 5624  Line 5624 
5624      my($self, $ssa) = @_;      my($self, $ssa) = @_;
5625      my($who) = "";      my($who) = "";
5626    
5627      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5628    
5629      if (open(DATA,"<$FIG_Config::data/Subsystems/$ssa/curation.log"))      if (open(DATA,"<$FIG_Config::data/Subsystems/$ssa/curation.log"))
5630      {      {
# Line 5655  Line 5655 
5655      my($self,$ssa) = @_;      my($self,$ssa) = @_;
5656      my($version, $curator, $pedigree, $roles);;      my($version, $curator, $pedigree, $roles);;
5657    
5658      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5659    
5660      $roles = [];      $roles = [];
5661    
# Line 5718  Line 5718 
5718      my($self,$ssa) = @_;      my($self,$ssa) = @_;
5719      my($genomes);      my($genomes);
5720    
5721        $ssa =~ s/[ \/]/_/g;
5722      $genomes = [];      $genomes = [];
5723    
5724      if (open(SSA,"<$FIG_Config::data/Subsystems/$ssa/spreadsheet"))      if (open(SSA,"<$FIG_Config::data/Subsystems/$ssa/spreadsheet"))
# Line 5772  Line 5773 
5773      my($self, $subsystem, $force_load) = @_;      my($self, $subsystem, $force_load) = @_;
5774      my $sub;      my $sub;
5775    
5776        $subsystem =~ s/[ \/]/_/g;
5777      my $cache = $self->cached('_Subsystems');      my $cache = $self->cached('_Subsystems');
5778      if ($force_load || !($sub = $cache->{$subsystem}))      if ($force_load || !($sub = $cache->{$subsystem}))
5779      {      {
# Line 5784  Line 5786 
5786  sub subsystem_to_roles  sub subsystem_to_roles
5787  {  {
5788      my($self, $subsystem) = @_;      my($self, $subsystem) = @_;
5789        $subsystem =~ s/[ \/]/_/g;
5790    
5791      my $sub = $self->get_subsystem($subsystem);      my $sub = $self->get_subsystem($subsystem);
5792    
# Line 5795  Line 5798 
5798  sub pegs_in_subsystem_cell  sub pegs_in_subsystem_cell
5799  {  {
5800      my($self, $subsystem, $genome, $role) = @_;      my($self, $subsystem, $genome, $role) = @_;
5801        $subsystem =~ s/[ \/]/_/g;
5802    
5803      my $sub = $self->get_subsystem($subsystem);      my $sub = $self->get_subsystem($subsystem);
5804    
# Line 5834  Line 5838 
5838      my ($self, $ssa, $url) = @_;      my ($self, $ssa, $url) = @_;
5839      my ($id, $token);      my ($id, $token);
5840    
5841      $ssa =~ s/ /_/g;      $ssa =~ s/[ \/]/_/g;
5842    
5843      my $ch = $self->get_clearinghouse($url);      my $ch = $self->get_clearinghouse($url);
5844    
# Line 5916  Line 5920 
5920      return map { $_->[0] } @sublist;      return map { $_->[0] } @sublist;
5921  }  }
5922    
5923    sub write_subsystem_spreadsheet {
5924        my($self,$ssa,$roles,$genomes,$pegs_in_cells) = @_;
5925        my(@genomes,$genome,$role,@pegs,$pair,$gs);
5926    
5927        $ssa =~ s/[ \/]/_/g;
5928        &verify_dir("$FIG_Config::data/Subsystems/$ssa");
5929        open(SSA,">$FIG_Config::data/Subsystems/$ssa/spreadsheet") || die "Cannot open $FIG_Config::data/Subsystems/$ssa/spreadsheet";
5930        foreach $pair (@$roles)
5931        {
5932            print SSA join("\t",@$pair),"\n";
5933        }
5934        print SSA "//\n";
5935        print SSA "All\n\nAll\n//\n";
5936        @genomes = map { $_->[1] }
5937                   sort { ($a->[0] cmp $b->[0]) or ($a->[1] <=> $b->[1]) }
5938                   map {$genome = $_; $gs = $self->genus_species($genome); [$gs,$genome] }
5939                   @$genomes;
5940        foreach $genome (@genomes)
5941        {
5942            print SSA "$genome\t0";
5943            foreach $role (@$roles)
5944            {
5945                $_ = $pegs_in_cells->{"$genome\t$role->[1]"};
5946                @pegs = $_ ? sort { &by_fig_id($a,$b) } @{$_} : ();
5947                print SSA "\t",join(",",map { $_ =~ /^fig\|\d+\.\d+\.peg\.(\d+)/; $1 } @pegs);
5948            }
5949            print SSA "\n";
5950        }
5951        close(SSA);
5952        chmod(0777,"$FIG_Config::data/Subsystems/$ssa");
5953    }
5954    
5955  ################################# PEG Translation  ####################################  ################################# PEG Translation  ####################################
5956    

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.127

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3