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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 28 17:34:09 CET 2011


Author: sebastian_d
Date: 2011-11-28 17:34:09 +0100 (Mon, 28 Nov 2011)
New Revision: 31

Modified:
   pkg/patchwork/R/karyotype.r
   pkg/patchwork/R/karyotype_chroms.r
   pkg/patchwork/R/karyotype_chromsCN.r
   pkg/patchwork/R/patchwork.CNA.r
   pkg/patchwork/R/patchwork.findCNs.r
   pkg/patchwork/man/chr1.mark.Rd
   pkg/patchwork/man/chr10.mark.Rd
   pkg/patchwork/man/chr11.mark.Rd
   pkg/patchwork/man/chr12.mark.Rd
   pkg/patchwork/man/chr13.mark.Rd
   pkg/patchwork/man/chr14.mark.Rd
   pkg/patchwork/man/chr15.mark.Rd
   pkg/patchwork/man/chr16.mark.Rd
   pkg/patchwork/man/chr17.mark.Rd
   pkg/patchwork/man/chr18.mark.Rd
   pkg/patchwork/man/chr19.mark.Rd
   pkg/patchwork/man/chr2.mark.Rd
   pkg/patchwork/man/chr20.mark.Rd
   pkg/patchwork/man/chr21.mark.Rd
   pkg/patchwork/man/chr22.mark.Rd
   pkg/patchwork/man/chr3.mark.Rd
   pkg/patchwork/man/chr4.mark.Rd
   pkg/patchwork/man/chr5.mark.Rd
   pkg/patchwork/man/chr6.mark.Rd
   pkg/patchwork/man/chr7.mark.Rd
   pkg/patchwork/man/chr8.mark.Rd
   pkg/patchwork/man/chr9.mark.Rd
   pkg/patchwork/man/chrX.mark.Rd
   pkg/patchwork/man/chrY.mark.Rd
   pkg/patchwork/man/ideogram.Rd
   pkg/patchwork/man/karyotype.Rd
   pkg/patchwork/man/karyotype_check.Rd
   pkg/patchwork/man/karyotype_chroms.Rd
   pkg/patchwork/man/karyotype_chromsCN.Rd
   pkg/patchwork/man/patchwork.CNA.Rd
   pkg/patchwork/man/patchwork.applyref.Rd
   pkg/patchwork/man/patchwork.createreference.Rd
   pkg/patchwork/man/patchwork.findCNs.Rd
   pkg/patchwork/man/patchwork.readChroms.Rd
   pkg/patchwork/man/patchwork.segment.Rd
   pkg/patchwork/man/subfunctions_findCNs.Rd
Log:
Extensive work on some functions handling of chr object in karyotype and on documentation

Modified: pkg/patchwork/R/karyotype.r
===================================================================
--- pkg/patchwork/R/karyotype.r	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/R/karyotype.r	2011-11-28 16:34:09 UTC (rev 31)
@@ -1,4 +1,5 @@
-karyotype <- function(chr,start,end,int,ai,ideogram=NULL,name='',xlim=c(-1.02,1.02),ylim=0:1) 
+karyotype <- function(chr,start,end,int,ai,chroms,
+						name='',xlim=c(-1.02,1.02),ylim=0:1) 
 	{   
     png(paste(name,'.karyotype.png',sep=''),width=1300,height=1300)
  
@@ -6,6 +7,11 @@
  	
     	load(paste(packagepath,"/data/ideogram.RData",sep=""))
     	
+    	#substitute ideogram chr names with chroms-object chr names
+    	# so it will work independent of chr field name.
+    
+    	ideogram$chr = chroms
+    	
 		colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
     	colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb")
 
@@ -26,7 +32,7 @@
     	size[length>10000000]=3
  
     
-    	for (c in 1:24) 
+    	for (c in chroms) 
     		{
 
         	this <- ideogram[ideogram$c==c,]

Modified: pkg/patchwork/R/karyotype_chroms.r
===================================================================
--- pkg/patchwork/R/karyotype_chroms.r	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/R/karyotype_chroms.r	2011-11-28 16:34:09 UTC (rev 31)
@@ -1,10 +1,18 @@
-karyotype_chroms <- function(chr,start,end,int,ai,ideogram=NULL,mchr,mpos,mval,schr,spos,sval,name='',xlim=c(0,2.4),ylim=c(0.3,1))  
+karyotype_chroms <- function(chr,start,end,int,ai,chroms,mchr,mpos,mval,
+								schr,spos,sval,name='',xlim=c(0,2.4),ylim=c(0.3,1))  
 	{   
     
     packagepath = system.file(package="patchwork")
  	
     load(paste(packagepath,"/data/ideogram.RData",sep=""))
     
+    #substitute ideogram chr names with chroms-object chr names
+    # so it will work independent of chr field name.
+    
+    ideogram$chr = chroms
+    
+    #create a color ramp palette to segue the color scheme for plot.
+    
     colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
     colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb")
 
@@ -23,7 +31,7 @@
     size[length>5000000]=3
     size[length>10000000]=4
        
-    for (c in 1:23) 
+    for (c in chroms) 
     	{
         this <- ideogram[ideogram$c==c,]
         

Modified: pkg/patchwork/R/karyotype_chromsCN.r
===================================================================
--- pkg/patchwork/R/karyotype_chromsCN.r	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/R/karyotype_chromsCN.r	2011-11-28 16:34:09 UTC (rev 31)
@@ -1,10 +1,19 @@
-karyotype_chromsCN <- function(chr,start,end,int,ai,Cn,mCn,ideogram=NULL,mchr,mpos,mval,schr,spos,sval,name='',xlim=c(-1.02,1.82),ylim=0:1, maxCn=8)  
+karyotype_chromsCN <- function(chr,start,end,int,ai,Cn,mCn,mchr,mpos,mval,
+								schr,spos,sval,name='',xlim=c(-1.02,1.82),ylim=0:1,
+								maxCn=8)  
 	{   
     
     packagepath = system.file(package="patchwork")
  	
     load(paste(packagepath,"/data/ideogram.RData",sep=""))
     
+    #substitute ideogram chr names with chroms-object chr names
+    # so it will work independent of chr field name.
+    
+    chroms = as.character(unique(schr))
+    
+    ideogram$chr = chroms
+    
     colors_p <- colorRampPalette(c("#6600FF","#9900CC"),space="rgb")
     colors_q <- colorRampPalette(c("#CC0099","#CC0000"),space="rgb")
 
@@ -25,7 +34,7 @@
     size[length>5000000]=3
     size[length>10000000]=4
        
-    for (c in 1:23) 
+    for (c in chroms) 
     	{
         this <- ideogram[ideogram$c==c,]
         

Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/R/patchwork.CNA.r	2011-11-28 16:34:09 UTC (rev 31)
@@ -91,10 +91,10 @@
 	#Plot it
 	cat("Initiating Plotting \n")
 	karyotype(segs$chr,segs$start,segs$end,segs$median,segs$ai,
-			ideogram=ideogram,name=as.character(BamFile),
+			chroms,name=as.character(BamFile),
 			xlim=c(0,2.4),ylim=c(0.3,1))
 	karyotype_chroms(segs$chr,segs$start,segs$end,segs$median,segs$ai,
-			ideogram=ideogram,kbsegs$chr,kbsegs$pos,kbsegs$ratio,
+			chroms,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))

Modified: pkg/patchwork/R/patchwork.findCNs.r
===================================================================
--- pkg/patchwork/R/patchwork.findCNs.r	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/R/patchwork.findCNs.r	2011-11-28 16:34:09 UTC (rev 31)
@@ -275,7 +275,7 @@
 					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,ideogram=ideogram,kbsegs$chr,
+						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),
 						ylim=c(0.3,1))

Modified: pkg/patchwork/man/chr1.mark.Rd
===================================================================
--- pkg/patchwork/man/chr1.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr1.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 1.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr10.mark.Rd
===================================================================
--- pkg/patchwork/man/chr10.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr10.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 10.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr11.mark.Rd
===================================================================
--- pkg/patchwork/man/chr11.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr11.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 11.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr12.mark.Rd
===================================================================
--- pkg/patchwork/man/chr12.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr12.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 12.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr13.mark.Rd
===================================================================
--- pkg/patchwork/man/chr13.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr13.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 13.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr14.mark.Rd
===================================================================
--- pkg/patchwork/man/chr14.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr14.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 14.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr15.mark.Rd
===================================================================
--- pkg/patchwork/man/chr15.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr15.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 15.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr16.mark.Rd
===================================================================
--- pkg/patchwork/man/chr16.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr16.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 16.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr17.mark.Rd
===================================================================
--- pkg/patchwork/man/chr17.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr17.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 17.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr18.mark.Rd
===================================================================
--- pkg/patchwork/man/chr18.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr18.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 18.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr19.mark.Rd
===================================================================
--- pkg/patchwork/man/chr19.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr19.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 19.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr2.mark.Rd
===================================================================
--- pkg/patchwork/man/chr2.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr2.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 2.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr20.mark.Rd
===================================================================
--- pkg/patchwork/man/chr20.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr20.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 20.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr21.mark.Rd
===================================================================
--- pkg/patchwork/man/chr21.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr21.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 21.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr22.mark.Rd
===================================================================
--- pkg/patchwork/man/chr22.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr22.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 22.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr3.mark.Rd
===================================================================
--- pkg/patchwork/man/chr3.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr3.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 3.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr4.mark.Rd
===================================================================
--- pkg/patchwork/man/chr4.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr4.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 4.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr5.mark.Rd
===================================================================
--- pkg/patchwork/man/chr5.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr5.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 5.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr6.mark.Rd
===================================================================
--- pkg/patchwork/man/chr6.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr6.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 6.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr7.mark.Rd
===================================================================
--- pkg/patchwork/man/chr7.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr7.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 7.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr8.mark.Rd
===================================================================
--- pkg/patchwork/man/chr8.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr8.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 8.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chr9.mark.Rd
===================================================================
--- pkg/patchwork/man/chr9.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chr9.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome 9.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chrX.mark.Rd
===================================================================
--- pkg/patchwork/man/chrX.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chrX.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome X.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/chrY.mark.Rd
===================================================================
--- pkg/patchwork/man/chrY.mark.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/chrY.mark.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,6 +8,7 @@
 
 \description{
 GC content data for chromosome Y.
+Loaded during patchwork.readChroms.
 }
 
 

Modified: pkg/patchwork/man/ideogram.Rd
===================================================================
--- pkg/patchwork/man/ideogram.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/ideogram.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -11,7 +11,7 @@
 }
 
 
-\usage{data(ideogram,package="patchwork")}
+\usage{ideogram}
 
 \format{
   A data frame with the following 6 variables.

Modified: pkg/patchwork/man/karyotype.Rd
===================================================================
--- pkg/patchwork/man/karyotype.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/karyotype.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -3,28 +3,54 @@
 
 
 \title{
-karyotype main function
+karyotype plotting function
 }
 
 \description{
-description
+Plots each,color coded by chromosomal coordinate, chromosome against a 
+background of the complete genome.
 }
 
 \usage{
-karyotype(chr,start,end,int,ai,ideogram,name,xlim,ylim)
+karyotype(chr,start,end,int,ai,name,xlim,ylim)
 }
 
 \arguments{
-  \item{name}{
-  	description
+  	\item{chr}{					%segs$chr
+  	Chromosomes name of segs object. Final version of segs created from patchwork.Medians_n_AI().
 	}
-  \item{name2}{
-	description
+  	\item{start}{				%segs$start
+	Start position of segment.
 	}
+	\item{end}{					%segs$end
+  	End position of segment.	
+	}
+	\item{int}{					%segs$mean
+  	Median.
+	}
+	\item{ai}{					%segs$ai
+  	Allelic imbalance.
+	}
+	\item{chroms}{
+  	Object created in patchwork.CNA which holds chromosome names.
+	}
+	\item{name}{
+  	Default is the name of the input BamFile from patchwork.CNA().
+  	Plot generated as "name.karyotype.png" in your working directory.
+	}
+  	\item{xlim}{
+  	Default is c(0,2.4). Limit of x axis.
+	}
+  	\item{ylim}{
+  	Default is c(0.3,1). Limit of y axis.
+	}
 }
 
 \details{
-Details
+Vertical axis: Allelic imbalance. \\
+Horizontal axis: Total intensity. \\
+
+The plot is a overview, for a closer look see the plots generated by karyotype_chroms().
 }
 
 %\value{
@@ -49,9 +75,10 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-%\seealso{
-%% ~~objects to See Also as \code{\link{help}}, ~~~
-%}
+\seealso{
+\code{\link{patchwork.CNA}}
+\code{\link{karyotype_chroms}}
+}
 
 %\examples{
 %##---- Should be DIRECTLY executable !! ----

Modified: pkg/patchwork/man/karyotype_check.Rd
===================================================================
--- pkg/patchwork/man/karyotype_check.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/karyotype_check.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -14,7 +14,7 @@
 }
 
 \usage{
-karyotype_check(chr,start,end,int,ai,Cn,mCn,t,ideogram=NULL,name='',xlim=c(-1.02,1.02),ylim=0:1)
+karyotype_check(chr,start,end,int,ai,Cn,mCn,t,name='',xlim=c(-1.02,1.02),ylim=0:1)
 }
 
 \arguments{
@@ -46,14 +46,29 @@
   	Default is BamFile argument from patchwork.CNA is used as argument.
 	}
   	\item{xlim}{
-  	Default is c(0,2.4). Limit of x axis.
+  	Default is c(-1.02,1.02). Limit of x axis.
 	}
   	\item{ylim}{
-  	Default is c(0.3,1). Limit of y axis.
+  	Default is 0:1. Limit of y axis.
 	}
 }
 
+
 \details{
+Vertical axis: Allelic Imbalance. \\
+Horizontal axis: Relative coverage. \\ %Ask Marcus about this.
+
+The naming scheme is Copynumber-m-LesserAlleleDistribution
+So for example 2m0 means copynumber = 2, both allels are the same
+whereas 2m1 means copynumber = 2, 1 allele each.
+
+Another example:
+4m0, copynumber = 4, All allels are the same. (Loss of heterozygosity).
+4m1, copynumber = 4, 3 alleles are the same, one is different.
+4m2, copynumber = 4, 2 alleles each.
+
+The total number of alleles present are always the copynumber.
+
 Run within patchwork.findCNs function. findCNs.Rdata must be in working directory for that function
 to run, and thus this one aswell as most of its input is taken from segs.
 }
@@ -80,9 +95,9 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-%\seealso{
-%% ~~objects to See Also as \code{\link{help}}, ~~~
-%}
+\seealso{
+\code{\link{patchwork.findCNs}}
+}
 
 %\examples{
 %##---- Should be DIRECTLY executable !! ----

Modified: pkg/patchwork/man/karyotype_chroms.Rd
===================================================================
--- pkg/patchwork/man/karyotype_chroms.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/karyotype_chroms.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -1,29 +1,92 @@
 \name{karyotype_chroms}
 \alias{karyotype_chroms}
+\alias{patchwork.plot}
 
 \title{
-karyotype chroms function
+Karyotype plotting of each chromosome
 }
 
 \description{
-description
+Visualises the calculated data of patchwork.CNA() for each chromosome.
+See details for a walkthrough of the plot.
 }
 
 \usage{
-karyotype_chroms(chr,start,end,int,ai,ideogram,name,xlim,ylim)
+karyotype_chroms(chr,start,end,int,ai,chroms,mchr,mpos,mval,schr,spos,sval,name,xlim,ylim)
 }
 
 \arguments{
-  \item{name}{
-  	description
+  	\item{chr}{					%segs$chr
+  	Chromosomes name of segs object. Final version of segs created from patchwork.Medians_n_AI().
 	}
-  \item{name2}{
-	description
+  	\item{start}{				%segs$start
+	Start position of segment.
 	}
+	\item{end}{					%segs$end
+  	End position of segment.	
+	}
+	\item{int}{					%segs$mean
+  	Median.
+	}
+	\item{ai}{					%segs$ai
+  	Allelic imbalance.
+	}
+	\item{chroms}{
+  	Object created in patchwork.CNA which holds chromosome names.
+	}
+	\item{mchr}{
+	Chromosomes name of kbsegs object. Final version of kbsegs created from patchwork.smoothing().
+	}
+	\item{mpos}{
+  	Middle position of kbsegs segments.
+	}
+	\item{mval}{
+  	Ratio between kbsegs coverage and refcoverage.
+	}
+	\item{schr}{
+  	Chromosome names of alf object. Final version of alf created from patchwork.alleledata().
+	}
+	\item{spos}{
+  	Positions in alf.
+	}
+	\item{sval}{
+	Inverse ratio between allele maximum and allele minimum.
+	}
+	\item{name}{
+  	Name of sample. patchwork.CNA sends it as name of the bamfile.
+	}
+  	\item{xlim}{
+  	Default is c(0,2.4). Limit of x axis.
+	}
+  	\item{ylim}{
+  	Default is c(0.3,1). Limit of y axis.
+	}
 }
 
 \details{
-Details
+Walkthrough of the plot:
+
+\textbf{TOP} \\
+Vertical axis: Allelic Imbalance \\
+Horizontal axis: Total Intensity \\
+
+The chromosome plotted against the complete genome background. The separation between
+clusters within the plot are due to the fluctuating intensity and allelic imbalance
+and as such display the varying allele counts and copy numbers.
+Longer/larger segments have bigger circles. Darker circles show more content as they are
+ontop of eachother.
+
+\textbf{MIDDLE} \\
+Vertical axis: Total Intensity \\
+Horizontal axis: Chromosomal coordinate \\
+
+The chromosome in questions total intensity plotted against the position on the chromosome.
+
+\textbf{BOTTOM} \\
+Vertical axis: Allelic Imbalance \\
+Horizontal axis: Chromosomal coordinate \\
+
+The chromosome in questions allelic imbalance plotted against the position on the chromosome.
 }
 
 %\value{
@@ -48,9 +111,10 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-%\seealso{
-%% ~~objects to See Also as \code{\link{help}}, ~~~
-%}
+\seealso{
+\code{\link{patchwork.CNA}}
+\code{\link{karyotype}}
+}
 
 %\examples{
 %##---- Should be DIRECTLY executable !! ----

Modified: pkg/patchwork/man/karyotype_chromsCN.Rd
===================================================================
--- pkg/patchwork/man/karyotype_chromsCN.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/karyotype_chromsCN.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -4,28 +4,99 @@
 
 
 \title{
-karyotype chroms CN function
+Karyotype plotting for each chromosome post patchwork.findCNs().
 }
 
 \description{
-description
+Visualises the calculated data of patchwork.CNA() + patchwork.findCns() for each chromosome.
+See details for a walkthrough of the plot.
 }
 
 \usage{
-karyotype_chromsCN(chr,start,end,int,ai,ideogram,name,xlim,ylim)
+karyotype_chromsCN(chr,start,end,int,ai,chroms,mchr,mpos,mval,schr,spos,sval,name,xlim,ylim,maxCN=8)
 }
 
 \arguments{
-  \item{name}{
-  	description
+  	\item{chr}{					%segs$chr
+  	Chromosomes name of segs object. Final version of segs created from patchwork.Medians_n_AI().
 	}
-  \item{name2}{
-	description
+  	\item{start}{				%segs$start
+	Start position of segment.
 	}
+	\item{end}{					%segs$end
+  	End position of segment.	
+	}
+	\item{int}{					%segs$mean
+  	Mean.
+	}
+	\item{ai}{					%segs$ai
+  	Allelic imbalance.
+	}
+	\item{chroms}{
+  	Object created in patchwork.CNA which holds chromosome names.
+	}
+	\item{mchr}{
+	Chromosomes name of kbsegs object. Final version of kbsegs created from patchwork.smoothing().
+	}
+	\item{mpos}{
+  	Middle position of kbsegs segments.
+	}
+	\item{mval}{
+  	Ratio between kbsegs coverage and refcoverage.
+	}
+	\item{schr}{
+  	Chromosome names of alf object. Final version of alf created from patchwork.alleledata().
+	}
+	\item{spos}{
+  	Positions in alf.
+	}
+	\item{sval}{
+	Inverse ratio between allele maximum and allele minimum.
+	}
+	\item{name}{
+  	Name of sample. patchwork.CNA sends it as name of the bamfile.
+	}
+  	\item{xlim}{
+  	Default is c(0,2.4). Limit of x axis.
+	}
+  	\item{ylim}{
+  	Default is c(0.3,1). Limit of y axis.
+	}
+	\item{maxCN}{
+	Default is 8. The highest copynumber of the sample to check for.
+	}
 }
 
 \details{
-Details
+Walkthrough of the plot:
+
+\textbf{TOP} \\
+Vertical axis: Allelic Imbalance \\
+Horizontal axis: Total Intensity \\
+
+The chromosome plotted against the complete genome background. The separation between
+clusters within the plot are due to the fluctuating intensity and allelic imbalance
+and as such display the varying allele counts and copy numbers.
+Longer/larger segments have bigger circles. Darker circles show more content as they are
+ontop of eachother.
+
+\textbf{TOP MIDDLE} \\
+Vertical axis: Copynumber \\
+Horizontal axis: Chromosomal coordinate \\
+
+Displays the total and minor copynumbers for different segments of the chromosome in question.
+
+\textbf{LOWER MIDDLE} \\
+Vertical axis: Total Intensity \\
+Horizontal axis: Chromosomal coordinate \\
+
+The chromosome in questions total intensity plotted against the position on the chromosome.
+
+\textbf{BOTTOM} \\
+Vertical axis: Allelic Imbalance \\
+Horizontal axis: Chromosomal coordinate \\
+
+The chromosome in questions allelic imbalance plotted against the position on the chromosome.
 }
 
 %\value{

Modified: pkg/patchwork/man/patchwork.CNA.Rd
===================================================================
--- pkg/patchwork/man/patchwork.CNA.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.CNA.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -9,52 +9,59 @@
 
 \description{
 The main function of patchwork.
+In details there is some very important information, highly recommended!
 
 For now the package is only able to run on unix based systems since it uses
 several system commands when executing such as cp and rm.
-
-Make sure to only run one sample at a time in a single working directory
-as standard file names are created. If you do not heed this warning you
-will end up with a complete mess and probably runtime errors as patchwork.readChroms
-tries to run simultaniously for multiple samples in the same working directory.
-
-Upon completion of the the method you may receive the following warnings:
-
-Warning messages:
-1: In readChar(con, 5L, useBytes = TRUE) :
-  cannot open compressed file 'data.Rdata', probable reason 'No such file or directory'
-2: In readChar(con, 5L, useBytes = TRUE) :
-  cannot open compressed file 'pile.alleles.Rdata', probable reason 'No such file or directory'
-
-This is not unusal, it just means its the first time you've run the patchwork.CNA
-function in this directory.
-The patchwork function will check if you have data.Rdata or pile.alleles.Rdata 
-in your working directory to avoid remaking these, should they already exist.
 }
 
 \usage{
-patchwork.CNA(Bam,Pileup,solid = FALSE,reference = NULL)
+patchwork.CNA(BamFile,Pileup,reference,Alpha=0.0001,SD=1)
 }
 
 \arguments{
-  \item{Bam}{
+  \item{BamFile}{
   	Aligned, Sorted Bam-file.
 	}
   \item{Pileup}{
 	Pileup file generated through 
 	samtools -vcf reference.fasta bamfile > outfile.
 	}
-  \item{solid}{
-	True or False. Default is false, in which case illumina will be assumed.
-	}
   \item{reference}{
+  	Choose "solid" or "illumina".
 	If a normal reference has been created using patchwork.createreference()
-	you can point to the file here. Default is NULL.
+	you can point to the file here.
 	}
+	\item{Alpha}{
+	Default 0.0001, change if you want to try to get a better segmentation from patchwork.segment().
+	From DNAcopy (?segment):
+	 alpha: significance levels for the test to accept change-points.
+	}
+	\item{SD}{
+	Default 1, change if you want to try to get a better segmentation from patchwork.segment().
+	From DNAcopy (?segment):
+	undo.SD: the number of SDs between means to keep a split if undo.splits="sdundo".
+	}
 }
 
 \details{
-Details
+\textbf{Make sure to only run one sample at a time in a single working directory
+as standard file names are created. If you do not heed this warning you
+will end up with a complete mess and probably runtime errors as patchwork.readChroms
+tries to run simultaniously for multiple samples in the same working directory.}
+
+Upon completion of the the method you may receive the following warnings:
+
+Warning messages:
+1: In readChar(con, 5L, useBytes = TRUE) :
+  cannot open compressed file 'data.Rdata', probable reason 'No such file or directory'
+2: In readChar(con, 5L, useBytes = TRUE) :
+  cannot open compressed file 'pile.alleles.Rdata', probable reason 'No such file or directory'
+
+This is not unusal, it just means its the first time you've run the patchwork.CNA
+function in this directory.
+The patchwork function will check if you have data.Rdata or pile.alleles.Rdata 
+in your working directory to avoid remaking these, should they already exist.
 }
 
 %\value{

Modified: pkg/patchwork/man/patchwork.applyref.Rd
===================================================================
--- pkg/patchwork/man/patchwork.applyref.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.applyref.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -4,35 +4,30 @@
 
 
 \title{
-patchwork application of reference function
+Apply reference to query data
 }
 
 \description{
-description
+Applies reference data depending on the sequencing type of the data.
 }
 
 \usage{
-patchwork.applyref(object,solid=NULL,reference=NULL)
+patchwork.applyref(data,reference)
 }
 
 \arguments{
-  \item{object}{
-  	description
+  \item{data}{
+  	The data object generated from patchwork.GCNorm().
 	}
-  \item{solid}{
-	Default is FALSE. If TRUE it will use solid data as normal reference
-	unless the reference parameter, see below, is defined.
-	}
   \item{reference}{
-	Default is NULL. If set it be used as normal reference and override
-	the solid parameter, see above, no matter what the solid parameter
-	is set to.
+	Either "illumina","solid" or the path to a file that you have created using
+	patchwork.createreference().
 	}
 }
 
 \details{
 This function applies a normal reference from Solexa (Illumina), SOLiD or
-a reference that you have created to the data.
+a reference that you have created for the data.
 }
 
 %\value{

Modified: pkg/patchwork/man/patchwork.createreference.Rd
===================================================================
--- pkg/patchwork/man/patchwork.createreference.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.createreference.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -4,34 +4,39 @@
 
 
 \title{
-patchwork function to create your own normal reference file.
+Patchwork function to create your own normal reference file.
 }
 
 \description{
-description
+Create your own normal reference file for use with patchwork.CNA(). This may have advantages over using the
+standard issue references. It is recommended to use atleast 3 bamfiles to create a
+reference file.
 }
 
 \usage{
-patchwork.createreference("file1.bam","file2.bam",\dots)
+patchwork.createreference(\dots,output="REFOUT")
 }
 
 \arguments{
-  \item{file.bam}{
+  \item{\dots}{
   	The full path and filename to all of the BAM files
   	that you wish to use for creating the reference file.
+  	ex patchwork.createreference("file1.bam","file2.bam","file3.bam",etc)
 	}
+	\item{output}{
+	Default is "REFOUT". This will result in REFOUT.RData being created in your working
+	directory.
+	}
 }
 
 \details{
 This function will take as its arguments a number of bamfiles that you
 specify, normalize them according to patchwork.readChroms and
-patchwork.GCNorm. Normal_Reference.Rdata is created in your
-working directory for further use. This file will need to be loaded into
-your R session using load("Normal_Reference.RData") which will
-put the object "normaldata" in your workspace. This object should then
+patchwork.GCNorm. REFOUT.Rdata, or whichever name you chose, is created in your
+working directory for further use. This file should then
 be sent in patchwork.CNA to be used as a reference file.
 
-patchwork.CNA(bamfile,pileup,reference=normaldata)
+patchwork.CNA(bamfile,pileup,reference="path/to/your/REFOUT.RData")
 }
 
 %\value{

Modified: pkg/patchwork/man/patchwork.findCNs.Rd
===================================================================
--- pkg/patchwork/man/patchwork.findCNs.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.findCNs.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -15,25 +15,10 @@
 }
 
 \usage{
-patchwork.findCNs(cn2=1,delta=0.5,het=0.5,hom=0.7,maxCn=8,ceiling=1))
+patchwork.findCNs(cn2=NULL,delta=NULL,het=NULL,hom=NULL,maxCn=8,ceiling=1))
 }
 
 \arguments{
-%\item{segs}{
-%	Segment data for your sample.
-%	Generated through patchwork.segment and patchwork.Medians_n_AI.
-%	Saved to findCNs.Rdata and Segments.Rdata.
-%	}
-%\item{alf}{
-%	Allele information from pileup for your sample.
-%	Generated through patchwork.alleledata.
-%	Saved to findCNs.Rdata and pile.alleles.Rdata.
-%	}
-%\item{kbsegs}{
-%	Smoothed segment data for your sample.
-%	Generated through pathwork.smoothing.
-%	Saved to findCNs.Rdata and smoothed.Rdata.
-%	}
   \item{cn2}{
 	description
 	}
@@ -83,9 +68,10 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-%\seealso{
-%% ~~objects to See Also as \code{\link{help}}, ~~~
-%}
+\seealso{
+\code{\link{patchwork.CNA}}
+\code{\link{subfunctions_findCNss}}
+}
 
 %\examples{
 %##---- Should be DIRECTLY executable !! ----

Modified: pkg/patchwork/man/patchwork.readChroms.Rd
===================================================================
--- pkg/patchwork/man/patchwork.readChroms.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.readChroms.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -8,24 +8,25 @@
 }
 
 \description{
-description
+Internal function of patchwork.CNA().
 }
 
 \usage{
-patchwork.readChroms(Bam,chroms)
+patchwork.readChroms(BamFile,chroms)
 }
 
 \arguments{
-  \item{Bam}{
+  \item{BamFile}{
   	Input Bam from patchwork.CNA().
 	}
   \item{chroms}{
-	chroms is an object generated from ideogram.RData's ideogram\$chr attribute.
+	chroms is an object generated from pile.alleles.RData's alf\$achr attribute.
 	}
 }
 
 \details{
-Details
+Reads GC values regarding each chromosome and attaches it to the data. Also uses the python
+script "Pysamloader.py" to generate a position file for each chromosome in turn.
 }
 
 %\value{
@@ -50,9 +51,9 @@
 
 %% ~Make other sections like Warning with \section{Warning }{....} ~
 
-%\seealso{
-%% ~~objects to See Also as \code{\link{help}}, ~~~
-%}
+\seealso{
+\code{\link{patchwork.CNA}}
+}
 
 %\examples{
 %##---- Should be DIRECTLY executable !! ----

Modified: pkg/patchwork/man/patchwork.segment.Rd
===================================================================
--- pkg/patchwork/man/patchwork.segment.Rd	2011-11-25 15:59:12 UTC (rev 30)
+++ pkg/patchwork/man/patchwork.segment.Rd	2011-11-28 16:34:09 UTC (rev 31)
@@ -1,18 +1,16 @@
 \name{patchwork.segment}
 \alias{patchwork.segment}
-\alias{segment}
 
-
 \title{
 patchwork segmentation function
 }
 
 \description{
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/patchwork -r 31


More information about the Patchwork-commits mailing list