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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 13 16:07:52 CET 2012


Author: mayrhofer
Date: 2012-02-13 16:07:52 +0100 (Mon, 13 Feb 2012)
New Revision: 88

Modified:
   pkg/patchwork/R/karyotype.r
   pkg/patchwork/R/karyotype_chroms.r
   pkg/patchwork/R/patchwork.CNA.r
   pkg/patchwork/R/patchwork.applyref.r
Log:
degugz

Modified: pkg/patchwork/R/karyotype.r
===================================================================
--- pkg/patchwork/R/karyotype.r	2012-02-13 10:26:44 UTC (rev 87)
+++ pkg/patchwork/R/karyotype.r	2012-02-13 15:07:52 UTC (rev 88)
@@ -1,5 +1,5 @@
 karyotype <- function(chr,start,end,int,ai,
-						name='',xlim=c(0,2.4),ylim=c(0.3,1)) 
+						name='',xlim=c(0,2.4),ylim=c(0,1)) 
 	{   
     png(paste(name,'.karyotype.png',sep=''),width=1300,height=1300)
  

Modified: pkg/patchwork/R/karyotype_chroms.r
===================================================================
--- pkg/patchwork/R/karyotype_chroms.r	2012-02-13 10:26:44 UTC (rev 87)
+++ pkg/patchwork/R/karyotype_chroms.r	2012-02-13 15:07:52 UTC (rev 88)
@@ -1,5 +1,5 @@
 karyotype_chroms <- function(chr,start,end,int,ai,mchr,mpos,mval,
-								schr,spos,sval,name='',xlim=c(0,2.4),ylim=c(0.3,1))  
+								schr,spos,sval,name='',xlim=c(0,2.4),ylim=c(0,1))  
 	{   
     
     #packagepath = system.file(package="patchwork")

Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r	2012-02-13 10:26:44 UTC (rev 87)
+++ pkg/patchwork/R/patchwork.CNA.r	2012-02-13 15:07:52 UTC (rev 88)
@@ -1,4 +1,4 @@
-patchwork.CNA <- function(BamFile,Pileup,reference='illumina',normal.bam=NULL,normal.pileup=NULL,Alpha=0.0001,SD=1)
+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")
@@ -108,24 +108,22 @@
 		save(data,file='data.Rdata')
 		}
 	
+	#Apply smoothing to the data.
 	kbsegs = NULL
-	try( load("smoothed.Rdata"), silent=TRUE )
-	
+	try( load("smoothed.Rdata"), silent=TRUE )	
 	if(length(kbsegs) == 0)
 		{
-		#Apply smoothing to the data.
 		cat("Initiating Smoothing \n")
 		kbsegs = patchwork.smoothing(data,chroms)
 		save(kbsegs,file="smoothed.Rdata")
 		cat("Smoothing Complete \n")
 		}
 	
+	#Segment the data.
 	segs = NULL
 	try( load("Segments.Rdata"), silent=TRUE )
-	
 	if(length(segs) == 0)
 		{
-		#Segment the data.
 		cat("Initiating Segmentation \n")
 		cat("Note: If segmentation fails to initiate the probable reason is that you have not ")
 		cat("installed the R package DNAcopy. See patchwork's README for installation instructions. \n")
@@ -150,12 +148,12 @@
 	cat("Initiating Plotting \n")
 	karyotype(segs$chr,segs$start,segs$end,segs$median,segs$ai,
 			name=as.character(BamFile),
-			xlim=c(0,2.4),ylim=c(0.3,1))
+			xlim=c(0,2.4),ylim=c(0,1))
 	karyotype_chroms(segs$chr,segs$start,segs$end,segs$median,segs$ai,
 			kbsegs$chr,kbsegs$pos,kbsegs$ratio,
 			alf$achr,alf$apos,(1-alf$amin/alf$amax),
 			name=as.character(BamFile),xlim=c(0,2.4),
-			ylim=c(0.3,1))
+			ylim=c(0,1))
 	cat("Plotting Complete \n")
 	cat("Shutting down..... \n")
 	}

Modified: pkg/patchwork/R/patchwork.applyref.r
===================================================================
--- pkg/patchwork/R/patchwork.applyref.r	2012-02-13 10:26:44 UTC (rev 87)
+++ pkg/patchwork/R/patchwork.applyref.r	2012-02-13 15:07:52 UTC (rev 88)
@@ -10,7 +10,7 @@
 
 	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
+	colnames(data)[8] = 'reference'
 	data=data[order(data$pos),]
 	data=data[order(data$chr),]
 	return(data)



More information about the Patchwork-commits mailing list