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

Diff of /FigKernelPackages/ExpressionDir.pm

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

revision 1.9, Fri Feb 4 22:55:11 2011 UTC revision 1.10, Mon Mar 21 18:08:40 2011 UTC
# Line 497  Line 497 
497    
498      $self->run([executable_for("remove_multiple_occurring_probes"),      $self->run([executable_for("remove_multiple_occurring_probes"),
499                  $peg_probe_table,                  $peg_probe_table,
500                  $probe_occ_table],                  ],
501             { stdout => catfile($self->expr_dir, 'peg.probe.table.no.multiple') } );             { stdout => catfile($self->expr_dir, 'peg.probe.table.no.multiple') } );
502    
503      $self->make_missing_probes($peg_probe_table, $probes_fasta,      $self->make_missing_probes($peg_probe_table, $probes_fasta,
504                                 catfile($self->expr_dir, 'probe.no.match'));                                 catfile($self->expr_dir, 'probe.no.match'));
505        $self->make_missing_probes(catfile($self->expr_dir, 'peg.probe.table.no.multiple'), $probes_fasta,
506                                   catfile($self->expr_dir, 'probe.no.multiple.no.match'));
507  }  }
508    
509  sub make_missing_probes  sub make_missing_probes
# Line 563  Line 565 
565      local($ENV{R_LIBS}) = $libdir;      local($ENV{R_LIBS}) = $libdir;
566      $self->run([executable_for("RunRMA"),      $self->run([executable_for("RunRMA"),
567                  "data",                  "data",
568                  catfile($self->expr_dir, "peg.probe.table"),                  catfile($self->expr_dir, "peg.probe.table.no.multiple"),
569                  catfile($self->expr_dir, "probe.no.match"),                  catfile($self->expr_dir, "probe.no.multiple.no.match"),
570                  $expt_dir,                  $expt_dir,
571                  $self->expr_dir]);                  $self->expr_dir]);
572    
# Line 785  Line 787 
787             { stdout => $merged_clusters });             { stdout => $merged_clusters });
788      $self->run([executable_for("get_ON_probes"), $self->expr_dir, $probes_always_on, $pegs_always_on]);      $self->run([executable_for("get_ON_probes"), $self->expr_dir, $probes_always_on, $pegs_always_on]);
789    
790      if (-s $probes_always_on == 0)      if (-s $pegs_always_on == 0)
791      {      {
792          confess "No always-on probes were found";          confess "No always-on pegs were found";
793      }      }
794    
795      $self->run([executable_for("Pipeline"), $pegs_always_on, $merged_clusters, $self->expr_dir],      $self->run([executable_for("Pipeline"), $pegs_always_on, $merged_clusters, $self->expr_dir],
# Line 946  Line 948 
948  {  {
949      my($self) = @_;      my($self) = @_;
950    
951        my $dir = $self->genome_dir;
952        my $fh;
953        if (!open($fh, "<", "$dir/Subsystems/bindings"))
954        {
955            warn "No bindings file, falling back to old method\n";
956            return $self->ids_in_subsystems_old();
957        }
958    
959        my $res;
960        while (<$fh>)
961        {
962            chomp;
963            my($ss, $role, $fid) = split(/\t/);
964            $ss =~ s/\s+/_/g;
965            push(@{$res->{$ss}->{$role}}, $fid);
966        }
967        close($fh);
968        return $res;
969    }
970    
971    sub ids_to_subsystems
972    {
973        my($self, $ids) = @_;
974    
975        my $dir = $self->genome_dir;
976        my $fh;
977        if (!open($fh, "<", "$dir/Subsystems/bindings"))
978        {
979            warn "No bindings file, falling back to old method\n";
980            return $self->ids_to_subsystems_old($ids);
981        }
982    
983        my %ids;
984        $ids{$_} = 1 for @$ids;
985    
986        my $res = {};
987        while (<$fh>)
988        {
989            chomp;
990            my($ss, $role, $fid) = split(/\t/);
991            if ($ids{$fid})
992            {
993                push(@{$res->{$fid}}, $ss);
994            }
995        }
996        close(SS);
997    
998        return $res;
999    }
1000    
1001    sub ids_in_subsystems_old
1002    {
1003        my($self) = @_;
1004    
1005      open(SS, "<", catfile($self->genome_dir, "subsystem.data"));      open(SS, "<", catfile($self->genome_dir, "subsystem.data"));
1006      my $res = {};      my $res = {};
1007      while (<SS>)      while (<SS>)
# Line 959  Line 1015 
1015      return $res;      return $res;
1016  }  }
1017    
1018  sub ids_to_subsystems  sub ids_to_subsystems_old
1019  {  {
1020      my($self, $ids) = @_;      my($self, $ids) = @_;
1021    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3