[Patchwork-commits] r101 - pkg/patchwork/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 16 17:38:33 CET 2012


Author: mayrhofer
Date: 2012-02-16 17:38:33 +0100 (Thu, 16 Feb 2012)
New Revision: 101

Modified:
   pkg/patchwork/R/patchwork.CNA.r
   pkg/patchwork/R/patchwork.alleledata.r
   pkg/patchwork/R/zzz.R
Log:
got that one!

Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r	2012-02-16 16:36:07 UTC (rev 100)
+++ pkg/patchwork/R/patchwork.CNA.r	2012-02-16 16:38:33 UTC (rev 101)
@@ -1,15 +1,6 @@
 patchwork.CNA <- function(BamFile,Pileup,reference=NULL,normal.bam=NULL,normal.pileup=NULL,Alpha=0.0001,SD=1)
 	{
-	#library(patchwork)
-	#patchwork.CNA("cancer.bam","pile.up",reference="illumina")
-	#Load DNAcopy
-	library(DNAcopy)
-	#Load data included in package
-	#packagepath = system.file(package="patchwork")
-	#load(paste(packagepath,"/data/commonSnps132.RData",sep=""))
-	#load(paste(packagepath,"/data/ideogram.RData",sep=""))
-	#load(paste(packagepath,"/data/normaldata.RData",sep=""))
-	
+		
 	#Attempt to read file pile.alleles, incase its already been created.
 	alf <- normalalf <- NULL
 	try( load("pile.alleles.Rdata"), silent=TRUE )
@@ -20,7 +11,7 @@
 	if(is.null(alf))
 		{
 		cat("Initiating Allele Data Generation \n")
-		normalalf <- ifelse(is.null(normal.pileup), NULL, patchwork.alleledata(normal.pileup))
+		if (!is.null(normal.pileup)) normalalf <- patchwork.alleledata(normal.pileup)
 		alf = patchwork.alleledata(Pileup, normalalf=normalalf)
 		cat("Allele Data Generation Complete \n")
 		save(alf,file="pile.alleles.Rdata")
@@ -87,6 +78,7 @@
 		}
 	
 	#Segment the data.
+	library(DNAcopy)
 	segs = NULL
 	try( load("Segments.Rdata"), silent=TRUE )
 	if(length(segs) == 0)

Modified: pkg/patchwork/R/patchwork.alleledata.r
===================================================================
--- pkg/patchwork/R/patchwork.alleledata.r	2012-02-16 16:36:07 UTC (rev 100)
+++ pkg/patchwork/R/patchwork.alleledata.r	2012-02-16 16:38:33 UTC (rev 101)
@@ -16,7 +16,6 @@
 	#	system("rm -r .perl")
 	#	}
 	
-	
 	system(paste("cp -r ",packagepath,"/perl .perl",sep=""))
 	system(paste("cat ",Pileup," | perl .perl/pile2alleles.pl > ",getwd(),"/pile.alleles",sep=""))
 	system("rm -r .perl")

Modified: pkg/patchwork/R/zzz.R
===================================================================
--- pkg/patchwork/R/zzz.R	2012-02-16 16:36:07 UTC (rev 100)
+++ pkg/patchwork/R/zzz.R	2012-02-16 16:38:33 UTC (rev 101)
@@ -1,5 +1,5 @@
 .onLoad <- function(...){
-	supressMessages(library(DNAcopy))
+	#supressMessages(library(DNAcopy))
 	packageStartupMessage(
 	"Welcome to patchwork! \n 
 	cite us! \n 



More information about the Patchwork-commits mailing list