[Patchwork-commits] r82 - in pkg: patchwork/R patchwork/man patchworkCG/R patchworkCG/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 8 12:13:03 CET 2012


Author: sebastian_d
Date: 2012-02-08 12:13:03 +0100 (Wed, 08 Feb 2012)
New Revision: 82

Modified:
   pkg/patchwork/R/karyotype_chroms.r
   pkg/patchwork/R/karyotype_chromsCN.r
   pkg/patchwork/R/patchwork.findCNs.r
   pkg/patchwork/R/zzz.R
   pkg/patchwork/man/patchwork.findCNs.Rd
   pkg/patchworkCG/R/CG_KaCh.r
   pkg/patchworkCG/R/CG_KaChCN.r
   pkg/patchworkCG/R/CG_Ka_check.r
   pkg/patchworkCG/man/patchwork.CGCNV.Rd
Log:
Better axis intervalls and axis label distances for all patchworks

Modified: pkg/patchwork/R/karyotype_chroms.r
===================================================================
--- pkg/patchwork/R/karyotype_chroms.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchwork/R/karyotype_chroms.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -49,16 +49,17 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
 		    	main = "",
-		    	xlab = "Coverage, all segments",
+		    	xlab = "",
 		    	ylab = '',
 		    	col = c(col[!ix],col[ix]),
 		    	xlim = xlim,
 		    	ylim = ylim,
 		    	yaxt="n",
         		xaxt="n")
-        	axis(1,cex.axis=2)
-        	axis(2,cex.axis=2)
+        	axis(1,at=seq(0,2.5,0.1),cex.axis=2)
+        	axis(2,at=seq(0,1,0.1),cex.axis=2)
         	mtext(text="Allelic imbalance",side=2,line=4,las=3,cex=2)
+        	mtext(text="Coverage, all segments",side=1,line=4,cex=2,las=1)
 		
         	par(new=F)
         	mix <- mchr==as.character(this$chr)
@@ -75,7 +76,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = paste("Coverage,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -84,6 +85,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Coverage,",this$chr),side=1,line=4,cex=2,las=1)
 		    
         	segments(x0=start[ix],x1=end[ix],
         	    y0=int[ix],y1=int[ix],                
@@ -98,7 +100,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
             	main = "",
-		    	xlab = paste("Allelic imbalance,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -107,6 +109,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Allelic imbalance,",this$chr),side=1,line=3.5,cex=2,las=1)
     	dev.off()
     	}
 	}
\ No newline at end of file

Modified: pkg/patchwork/R/karyotype_chromsCN.r
===================================================================
--- pkg/patchwork/R/karyotype_chromsCN.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchwork/R/karyotype_chromsCN.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -50,16 +50,17 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = "Coverage, all segments",
+		    	xlab = "",
 		    	ylab = '',
 		    	col = c(col[!ix],col[ix]),
 		    	xlim = xlim,
 		    	ylim = ylim,
 		    	yaxt="n",
         		xaxt="n")
-        	axis(1,cex.axis=2)
-        	axis(2,cex.axis=2)
+        	axis(1,at=seq(0,2.5,0.1),cex.axis=2)
+        	axis(2,at=seq(0,1,0.1),cex.axis=2)
         	mtext(text="Allelic imbalance",side=2,line=4,las=3,cex=2)
+        	mtext(text="Coverage, all segments",side=1,line=4,cex=2,las=1)
 		    	
 			col=rep('#000000',sum(ix))
         	col[pos[ix] < this$mid] <- colors_p(sum(pos[ix] < this$mid))
@@ -67,7 +68,7 @@
         	par(new=F)
         	
         	plot(1,1,type='n',
-            	xlab=paste('Total and minor copy number', this$chr),
+            	xlab="",
             	ylab='',
             	cex.lab=3,
             	xlim = c(0,this$length),
@@ -76,6 +77,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste('Total and minor copy number', this$chr),side=1,line=4,cex=2,las=1)
             	
         	segments(x0=start[ix],x1=end[ix],
          	   y0=Cn[ix],y1=Cn[ix],                
@@ -95,7 +97,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = paste("Coverage,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -104,6 +106,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Coverage,",this$chr),side=1,line=4,cex=2,las=1)
 		    	
         	segments(x0=start[ix],x1=end[ix],
             	y0=int[ix],y1=int[ix],                
@@ -119,7 +122,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
             	main = "",
-		    	xlab = paste("Allelic imbalance,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -128,6 +131,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Allelic imbalance,",this$chr),side=1,line=3.5,cex=2,las=1)
         dev.off()
     	}
 	}
\ No newline at end of file

Modified: pkg/patchwork/R/patchwork.findCNs.r
===================================================================
--- pkg/patchwork/R/patchwork.findCNs.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchwork/R/patchwork.findCNs.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -1,4 +1,4 @@
-patchwork.findCNs = function(cn2,delta,het,hom,maxCn=8,ceiling=1)
+patchwork.findCNs = function(name = "findCNs_",cn2,delta,het,hom,maxCn=8,ceiling=1)
 	{
 	
 	#packagepath = system.file(package="patchwork")
@@ -272,12 +272,12 @@
 	tumor_percent <- xdelta / expected_delta
 
 	karyotype_check(regions$chr,regions$start,regions$end,regions$mean,regions$ai,
-					regions$Cn,regions$mCn,list(int=int,ai=ai),name=as.character(BamFile),
+					regions$Cn,regions$mCn,list(int=int,ai=ai),name=name,
 					xlim=c(0,2.4),ylim=c(0.3,1))
 					
 	karyotype_chromsCN(regions$chr,regions$start,regions$end,regions$mean,regions$ai,
 						regions$Cn,regions$mCn,kbsegs$chr,
 						kbsegs$pos,kbsegs$ratio,alf$achr,alf$apos,
-						(1-alf$amin/alf$amax),name=as.character(BamFile),xlim=c(0,2.4),
+						(1-alf$amin/alf$amax),name=name,xlim=c(0,2.4),
 						ylim=c(0.3,1))
 	}
\ No newline at end of file

Modified: pkg/patchwork/R/zzz.R
===================================================================
--- pkg/patchwork/R/zzz.R	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchwork/R/zzz.R	2012-02-08 11:13:03 UTC (rev 82)
@@ -1,6 +1,6 @@
 .onLoad <- function(...){
 	packageStartupMessage(
-	"Welcome to patchwork for CompleteGenomics data! \n 
+	"Welcome to patchwork! \n 
 	cite us! \n 
 	How to run this \n"
 	)

Modified: pkg/patchwork/man/patchwork.findCNs.Rd
===================================================================
--- pkg/patchwork/man/patchwork.findCNs.Rd	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchwork/man/patchwork.findCNs.Rd	2012-02-08 11:13:03 UTC (rev 82)
@@ -22,6 +22,9 @@
 }
 
 \arguments{
+	\item{name}{
+	Default is "findCNs_". First part of output name for plots generated from patchwork.findCNs().
+	}
   \item{cn2}{
 	The approximate position of copy number 2,diploid, on total intensity axis.
 	}

Modified: pkg/patchworkCG/R/CG_KaCh.r
===================================================================
--- pkg/patchworkCG/R/CG_KaCh.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchworkCG/R/CG_KaCh.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -51,16 +51,17 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
 		    	main = "",
-		    	xlab = "Coverage, all segments",
+		    	xlab = "",
 		    	ylab = '',
 		    	col = c(col[!ix],col[ix]),
 		    	xlim = xlim,
 		    	ylim = ylim,
 		    	yaxt="n",
         		xaxt="n")
-        	axis(1,cex.axis=2)
-        	axis(2,cex.axis=2)
+        	axis(1,at=seq(0,2.5,0.1),cex.axis=2)
+        	axis(2,at=seq(0,1,0.1),cex.axis=2)
         	mtext(text="Allelic imbalance",side=2,line=4,las=3,cex=2)
+        	mtext(text="Coverage, all segments",side=1,line=4,cex=2,las=1)
 		
         	par(new=F)
         	mix <- mchr==as.character(this$chr)
@@ -77,7 +78,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = paste("Coverage,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -86,6 +87,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Coverage,",this$chr),side=1,line=4,cex=2,las=1)
 		    
         	segments(x0=start[ix],x1=end[ix],
         	    y0=int[ix],y1=int[ix],                
@@ -100,7 +102,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
             	main = "",
-		    	xlab = paste("Allelic imbalance,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -109,6 +111,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Allelic imbalance,",this$chr),side=1,line=3.5,cex=2,las=1)
         	
         	segments(x0=start[ix],x1=end[ix],
         	    y0=ai[ix],y1=ai[ix],                
@@ -117,5 +120,4 @@
             	
     	dev.off()
     	}
-    rm(ideogram)
 	}

Modified: pkg/patchworkCG/R/CG_KaChCN.r
===================================================================
--- pkg/patchworkCG/R/CG_KaChCN.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchworkCG/R/CG_KaChCN.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -51,7 +51,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = "Coverage, all segments",
+		    	xlab = "",
 		    	#ylab = "Allelic imbalance -->",
 		    	ylab = '',
 		    	col = c(col[!ix],col[ix]),
@@ -59,9 +59,10 @@
 		    	ylim = ylim,
 		    	yaxt="n",
         		xaxt="n")
-        	axis(1,cex.axis=2)
-        	axis(2,cex.axis=2)
+        	axis(1,at=seq(0,2.5,0.1),cex.axis=2)
+        	axis(2,at=seq(0,1,0.1),cex.axis=2)
         	mtext(text="Allelic imbalance",side=2,line=4,las=3,cex=2)
+        	mtext(text="Coverage, all segments",side=1,line=4,cex=2,las=1)
 		    	
 			col=rep('#000000',sum(ix))
         	col[pos[ix] < this$mid] <- colors_p(sum(pos[ix] < this$mid))
@@ -69,7 +70,7 @@
         	par(new=F)
         	
         	plot(1,1,type='n',
-            	xlab=paste('Total and minor copy number', this$chr),
+            	xlab="",
             	ylab='',
             	cex.lab=3,
             	xlim = c(0,this$length),
@@ -78,6 +79,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste('Total and minor copy number', this$chr),side=1,line=4,cex=2,las=1)
             	
         	segments(x0=start[ix],x1=end[ix],
          	   y0=Cn[ix],y1=Cn[ix],                
@@ -97,7 +99,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
     	    	main = "",
-		    	xlab = paste("Coverage,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -106,6 +108,7 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Coverage,",this$chr),side=1,line=4,cex=2,las=1)
 		    	
         	segments(x0=start[ix],x1=end[ix],
             	y0=int[ix],y1=int[ix],                
@@ -121,7 +124,7 @@
             	cex.lab=3,
             	#mar=c(0.1,0.1,0.1,0.1),
             	main = "",
-		    	xlab = paste("Allelic imbalance,",this$chr),
+		    	xlab = "",
 		    	ylab = "",
 		    	col = '#00000010',
 		    	xlim = c(0,this$length),
@@ -130,7 +133,8 @@
         		xaxt="n")
         	axis(1,cex.axis=2)
         	axis(2,cex.axis=2)
+        	mtext(text=paste("Allelic imbalance,",this$chr),side=1,line=3.5,cex=2,las=1)
+        	
         dev.off()
     	}
-     rm(ideogram)
 	}
\ No newline at end of file

Modified: pkg/patchworkCG/R/CG_Ka_check.r
===================================================================
--- pkg/patchworkCG/R/CG_Ka_check.r	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchworkCG/R/CG_Ka_check.r	2012-02-08 11:13:03 UTC (rev 82)
@@ -65,5 +65,4 @@
         	cex=2)
     
     dev.off()
-    rm(ideogram)
 	}

Modified: pkg/patchworkCG/man/patchwork.CGCNV.Rd
===================================================================
--- pkg/patchworkCG/man/patchwork.CGCNV.Rd	2012-02-08 09:51:48 UTC (rev 81)
+++ pkg/patchworkCG/man/patchwork.CGCNV.Rd	2012-02-08 11:13:03 UTC (rev 82)
@@ -50,7 +50,7 @@
 	\item{CGfile}{
 	Default is NULL. If your CG.Rdata file is not in your working directory, and you dont wish to move
 	it to your working directory, you can simply input the path here as CGfile = "path/to/file/CG.Rdata"
-	so patchwork.CGCNV can find its data.
+	so patchwork.CGCNV() can find its data.
 	}
 }
 



More information about the Patchwork-commits mailing list