[Patchwork-commits] r61 - in pkg/patchwork: R inst/python man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 21 09:43:05 CET 2011


Author: sebastian_d
Date: 2011-12-21 09:43:04 +0100 (Wed, 21 Dec 2011)
New Revision: 61

Modified:
   pkg/patchwork/R/patchwork.CNA.r
   pkg/patchwork/R/patchwork.applyref.r
   pkg/patchwork/R/patchwork.readChroms.r
   pkg/patchwork/inst/python/Pysamloader.py
   pkg/patchwork/man/patchwork.CNA.Rd
   pkg/patchwork/man/patchwork.applyref.Rd
Log:
good morning commit

Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/R/patchwork.CNA.r	2011-12-21 08:43:04 UTC (rev 61)
@@ -10,15 +10,10 @@
 	#load(paste(packagepath,"/data/ideogram.RData",sep=""))
 	#load(paste(packagepath,"/data/normaldata.RData",sep=""))
 	
-	#Inhibit error message from try.
-	options(show.error.messages=FALSE)
-	
 	#Attempt to read file pile.alleles, incase its already been created.
 	alf = NULL
 	try( load("pile.alleles.Rdata"), silent=TRUE )
 	
-	options(show.error.messages=TRUE)
-	
 	#If it wasnt created, create it using the perl script pile2alleles.pl
 	#which is included in the package. Creates pile.alleles in whichever folder
 	#you are running R from. (getwd())
@@ -35,16 +30,11 @@
 	data(ideogram,package="patchworkData")
 	
 	chroms = as.character(unique(ideogram$chr))	
-		
-	#Inhibit error message from try.
-	options(show.error.messages=FALSE)
 	
 	## Read coverage data. If already done, will load "data.Rdata" instead.
 	data=NULL
 	try ( load('data.Rdata'), silent=TRUE )
 	
-	options(show.error.messages=TRUE)
-	
 	#If data object does not exist, IE it was not loaded in the previous line
 	#perform the function on the chromosomes to create the object.
 	if(is.null(data))
@@ -77,14 +67,9 @@
 		save(data,file='data.Rdata')
 		}
 	
-	#Inhibit error message from try.
-	options(show.error.messages=FALSE)
-
 	kbsegs = NULL
 	try( load("smoothed.Rdata"), silent=TRUE )
 	
-	options(show.error.messages=TRUE)
-	
 	if(length(kbsegs) == 0)
 		{
 		#Apply smoothing to the data.
@@ -94,14 +79,9 @@
 		cat("Smoothing Complete \n")
 		}
 	
-	#Inhibit error message from try.
-	options(show.error.messages=FALSE)
-	
 	segs = NULL
 	try( load("Segments.Rdata"), silent=TRUE )
 	
-	options(show.error.messages=TRUE)
-	
 	if(length(segs) == 0)
 		{
 		#Segment the data.
@@ -137,9 +117,6 @@
 			ylim=c(0.3,1))
 	cat("Plotting Complete \n")
 	cat("Shutting down..... \n")
-	
-	options(show.error.messages=FALSE)
-	
 	}
 	
 	
\ No newline at end of file

Modified: pkg/patchwork/R/patchwork.applyref.r
===================================================================
--- pkg/patchwork/R/patchwork.applyref.r	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/R/patchwork.applyref.r	2011-12-21 08:43:04 UTC (rev 61)
@@ -1,29 +1,8 @@
 patchwork.applyref <- function(data,reference)
 	{
-	#Load data included in package
-	#packagepath = system.file(package="patchwork")
-	#load(paste(packagepath,"/data/commonSnps132.RData",sep=""))
-	#load(paste(packagepath,"/data/ideogram.RData",sep=""))
-	
-	if(tolower(reference) == "solid")
-		{
-		#load(paste(packagepath,"/data/datasolid.RData",sep=""))
-		data(datasolid,package="patchworkData")
-		normaldata = datasolid
-		}
-	else if(tolower(reference) %in% c("solexa","illumina"))
-		{
-		#load(paste(packagepath,"/data/datasolexa.RData",sep=""))
-		data(datasolexa,package="patchworkData")
-		normaldata = datasolexa
-		}
-	else
-		{
-		load(reference)
-		}
 
-	## read and apply normal/reference
-	#load('/proj/b2010074/GC/normaldata.Rdata')				
+	load(reference)
+		
 	data <- merge(data[,1:7],normaldata,all=F,by=1:2)
 	#data$ratio <- data$norm / data$norm_mean
 	data$reference <- data$norm_mean  ## thats temporary

Modified: pkg/patchwork/R/patchwork.readChroms.r
===================================================================
--- pkg/patchwork/R/patchwork.readChroms.r	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/R/patchwork.readChroms.r	2011-12-21 08:43:04 UTC (rev 61)
@@ -25,9 +25,6 @@
 	#copy python folder
 	system(paste("cp -r ",packagepath,"/python .python",sep=""))
 	
-	#Inhibit error message from try.
-	options(show.error.messages=FALSE)
-	
 	#If import pysam doesnt work, ie pysam isnt installed yet, we install pysam.
 	if (system(paste("python ",getwd(),"/.python/Check.py",sep=""),intern=T) == "Pysam Not Available")
 			{
@@ -45,10 +42,7 @@
 			cat("Install complete. Output of install can be viewed in file pysam_install_output.txt. \n")
 			setwd("..")
 			}
-	
-	options(show.error.messages=TRUE)
 
-
 	readlength=80 # this is currently hard coded and may be adjusted.
 	seglength=200 # (do not change)
 	data=NULL

Modified: pkg/patchwork/inst/python/Pysamloader.py
===================================================================
--- pkg/patchwork/inst/python/Pysamloader.py	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/inst/python/Pysamloader.py	2011-12-21 08:43:04 UTC (rev 61)
@@ -2,23 +2,6 @@
 import re
 import os
 
-#If pysam already installed....
-# soemthing like try(import pysam) 
-# if nono install it.
-
-	#library(patchwork)
-	#patchwork.CNA("cancer.bam","pile.up",reference="illumina")
-
-#try:
-#	import pysam
-#except:
-	#p = "export PYTHONPATH=$PYTHONPATH:%s" % os.path.dirname(os.path.abspath(sys.argv[0]))
-	#os.system(p)
-#	a = "python %s/.python/setup.py build" % os.path.dirname(os.path.abspath(sys.argv[0]))
-#	os.system(a)
-#	b = "python %s/python/setup.py install" % os.path.dirname(os.path.abspath(sys.argv[0]))
-#	print b
-#	os.system(b)
 import pysam
 
 try:

Modified: pkg/patchwork/man/patchwork.CNA.Rd
===================================================================
--- pkg/patchwork/man/patchwork.CNA.Rd	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/man/patchwork.CNA.Rd	2011-12-21 08:43:04 UTC (rev 61)
@@ -28,9 +28,8 @@
 	samtools -vcf reference.fasta bamfile > outfile.
 	}
   \item{reference}{
-  	Choose "solid" or "illumina".
-	If a normal reference has been created using patchwork.createreference()
-	you can point to the file here.
+	Path to a reference file that you have either downloaded from us or created yourself with
+	patchwork.createreference().
 	}
 	\item{Alpha}{
 	Default 0.0001, change if you want to try to get a better segmentation from patchwork.segment().

Modified: pkg/patchwork/man/patchwork.applyref.Rd
===================================================================
--- pkg/patchwork/man/patchwork.applyref.Rd	2011-12-20 09:59:11 UTC (rev 60)
+++ pkg/patchwork/man/patchwork.applyref.Rd	2011-12-21 08:43:04 UTC (rev 61)
@@ -20,7 +20,7 @@
   	The data object generated from patchwork.GCNorm().
 	}
   \item{reference}{
-	Either "illumina","solid" or the path to a file that you have created using
+	Path to a reference file that you have either downloaded from us or created yourself with
 	patchwork.createreference().
 	}
 }



More information about the Patchwork-commits mailing list