[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.7, Mon Jan 24 18:16:35 2011 UTC revision 1.8, Mon Jan 24 19:42:26 2011 UTC
# Line 598  Line 598 
598                 { stdout => $sif2peg });                 { stdout => $sif2peg });
599      }      }
600    
601      #      $self->compute_rma_normalized_using_sif2peg($sif2peg, $expt_dir);
     # We need to build the R library for this cdf.  
     #  
     my($fh, $tempfile) = tempfile();  
 #m = make.cdf.package("S_aureus.cdf", cdf.path="..",packagename="foo",package.path="/tmp")  
   
     my $cdf_path = $self->expr_dir;  
     my $libdir = catfile($self->expr_dir, "r_lib");  
     -d $libdir or mkdir $libdir;  
     my $pkgdir = catfile($self->expr_dir, "r_pkg");  
     -d $pkgdir or mkdir $pkgdir;  
   
     print $fh "library(makecdfenv);\n";  
     print $fh qq(make.cdf.package("expr.cdf", cdf.path="$cdf_path", packagename="datacdf", package.path="$pkgdir", species="genome name");\n);  
     close($fh);  
     system("Rscript", $tempfile);  
     system("R", "CMD", "INSTALL", "-l", $libdir, "$pkgdir/datacdf");  
   
     local($ENV{R_LIBS}) = $libdir;  
     $self->run([executable_for("RunRMA_SIF_format"),  
                 "data",  
                 $expt_dir,  
                 $self->expr_dir]);  
   
     my $output = catfile($self->expr_dir, "rma_normalized.tab");  
     if (! -f $output)  
     {  
         confess("Output file $output was not generated");  
     }  
602  }  }
603    
604  sub compute_rma_normalized_from_locus_tags  sub compute_rma_normalized_from_locus_tags
# Line 691  Line 663 
663              {              {
664                  print "Dup: chip_id=$chip_id tag=$tag  old=$locus_map{$tag}\n";                  print "Dup: chip_id=$chip_id tag=$tag  old=$locus_map{$tag}\n";
665                  next if $chip_id =~ /_s_/;                  next if $chip_id =~ /_s_/;
666                    next if $chip_id =~ /^Rick/ && $self->genome_id eq '452659.3';
667              }              }
668              $locus_map{$tag} = $chip_id;              $locus_map{$tag} = $chip_id;
669          }          }
# Line 713  Line 686 
686          confess "No probe to peg mappings were found\n";          confess "No probe to peg mappings were found\n";
687      }      }
688    
689        $self->compute_rma_normalized_using_sif2peg($sif2peg, $expt_dir);
690    }
691    
692    sub compute_rma_normalized_from_pegidcorr
693    {
694        my($self, $cdf_file, $corr_file, $expt_dir) = @_;
695    
696        my $my_cdf = catfile($self->expr_dir, "expr.cdf");
697        copy($cdf_file, $my_cdf) or confess "Cannot copy $cdf_file to $my_cdf: $!";
698    
699        my $my_corr = catfile($self->expr_dir, "peg.id.corr");
700        copy($corr_file, $my_corr) or confess "Cannot copy $corr_file to $my_corr: $!";
701        my $sif2peg = catfile($self->expr_dir, "sif2peg");
702        #
703        # Create the sif2peg mapping.
704        #
705    
706        my $sif2peg = catfile($self->expr_dir, "sif2peg");
707    
708        #
709        # The peg.id.corr table is of the form peg \t chip-id \t something-else
710        # Just rewrite into chip-id \t peg.
711        #
712    
713        my $out = FileHandle->new($sif2peg, ">") or confess "Cannot open $sif2peg for writing: $!";
714        my $in = FileHandle->new($my_corr, "<") or confess "Cannot open $my_corr: $!";
715        while (<$in>)
716        {
717            chomp;
718            my($peg, $chip_id, undef) = split(/\t/);
719    
720            print $out "$chip_id\t$peg\n";
721        }
722        close($in);
723        close($out);
724    
725        if (! -s $sif2peg)
726        {
727            confess "No probe to peg mappings were found\n";
728        }
729        $self->compute_rma_normalized_using_sif2peg($sif2peg, $expt_dir);
730    }
731    
732    sub compute_rma_normalized_using_sif2peg
733    {
734        my($self, $sif2peg, $expt_dir) = @_;
735    
736      #      #
737      # We need to build the R library for this cdf.      # We need to build the R library for this cdf.
738      #      #

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3