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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 25 16:58:39 CET 2012


Author: sebastian_d
Date: 2012-01-25 16:58:39 +0100 (Wed, 25 Jan 2012)
New Revision: 75

Modified:
   pkg/patchworkCG/R/patchwork.CG.r
   pkg/patchworkCG/man/CG_Ka_check.Rd
   pkg/patchworkCG/man/patchwork.CG.Rd
   pkg/patchworkCG/man/patchwork.CGCNV.Rd
Log:
Added 3 plots to a folder in patchworkCG so people can compare and see what it could look like. Added example text to patchwork.CGCNV and patchwork.CG

Modified: pkg/patchworkCG/R/patchwork.CG.r
===================================================================
--- pkg/patchworkCG/R/patchwork.CG.r	2012-01-25 13:53:13 UTC (rev 74)
+++ pkg/patchworkCG/R/patchwork.CG.r	2012-01-25 15:58:39 UTC (rev 75)
@@ -114,7 +114,7 @@
 			}
 		skip_dc = i + 1
 		
-		cat("\n","Reading files: \n",mv,"\n",sm,"\n",dc,"\n")
+		cat("Reading files: \n",mv,"\n",sm,"\n",dc,"\n")
 		#Read mastervarbeta file in ASM folder
 		mastervar = read.table(masterVarBeta,
 						sep="\t",
@@ -173,7 +173,7 @@
 		skip_dc = i + 1
 	
 	
-		cat("\n","Reading files from ASM folder \n")
+		cat("Reading files from ASM folder \n")
 	
 		#Read mastervarbeta file in ASM folder
 		mastervar = read.table(paste(path,"/",mastervar_,sep=""),

Modified: pkg/patchworkCG/man/CG_Ka_check.Rd
===================================================================
--- pkg/patchworkCG/man/CG_Ka_check.Rd	2012-01-25 13:53:13 UTC (rev 74)
+++ pkg/patchworkCG/man/CG_Ka_check.Rd	2012-01-25 15:58:39 UTC (rev 75)
@@ -99,13 +99,10 @@
 \code{\link{patchwork.CGCNV}}
 }
 
-%\examples{
-%##---- Should be DIRECTLY executable !! ----
-%##-- ==>  Define data, use random,
-%##--	or do  help(data=index)  for the standard data sets.
-%Run examples of karyotype stuff. or not, maybe just point back to CNA.
-%}
+%%\examples{
 
+%%}
+
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
 %\keyword{ ~kwd1 }

Modified: pkg/patchworkCG/man/patchwork.CG.Rd
===================================================================
--- pkg/patchworkCG/man/patchwork.CG.Rd	2012-01-25 13:53:13 UTC (rev 74)
+++ pkg/patchworkCG/man/patchwork.CG.Rd	2012-01-25 15:58:39 UTC (rev 75)
@@ -14,7 +14,9 @@
 }
 
 \usage{
-patchwork.CG(path,name='CG_sample_',manual_file_input=FALSE,masterVarBeta=NULL,somaticCnvSegments=NULL,depthOfCoverage=NULL)
+patchwork.CG(path,name='CG_sample_',manual_file_input=FALSE,
+			masterVarBeta=NULL,somaticCnvSegments=NULL,
+			depthOfCoverage=NULL)
 }
 
 \arguments{
@@ -91,13 +93,67 @@
 %% ~~objects to See Also as \code{\link{help}}, ~~~
 %}
 
-%\examples{
-%##---- Should be DIRECTLY executable !! ----
-%##-- ==>  Define data, use random,
-%##--	or do  help(data=index)  for the standard data sets.
-%Run examples of karyotype stuff. or not, maybe just point back to CNA.
-%}
+\examples{
+\dontrun{
 
+#Load patchworkCG
+>library(patchworkCG)
+
+#An example of running patchwork.CG. Note that the path is to the ASM folder
+#of the default CompleteGenomics File structure.
+>patchwork.CG(path="Data/HCC2218/GS00258-DNA_B03/GS00258-DNA_B03/ASM",
+				name="HCC2218_")
+
+Reading files from ASM folder 
+File input complete 
+Performing calculations 
+Calculations complete 
+Saving objects to CG.Rdata 
+Initiating Plotting 
+Plotting Complete 
+patchwork.CG Complete 
+Please read documentation on running patchwork.CGCNV
+
+#The values used to generate the plots are saved in three objects,
+#mastervar,segs and depcov, and can be viewed loading CG.Rdata.
+>load("CG.Rdata")
+
+> head(mastervar)
+      chr begin   end vartype ref_count tot_count ref_countN tot_countN
+876  chr1 46669 46670     snp         1         1          2          3
+912  chr1 49313 49315     sub        69       129         71        123
+1030 chr1 55387 55388     snp        64       211         78        247
+1042 chr1 55815 55816     snp         5        12          3         10
+1054 chr1 56484 56485     snp         0        11          2          6
+1082 chr1 57989 57990     snp        58       187         56        177
+     mut_count max min      ratio
+876          0   1   0 0.01635786
+912         60  69  60 2.11016381
+1030       147 147  64 3.45150825
+1042         7   7   5 0.19629431
+1054        11  11   0 0.17993645
+1082       129 129  58 3.05891963
+
+> head(segs)
+   chr   start     end avgnormcov relcov     ratio snvs        ai
+1 chr1   10000  177417       88.2   1.36 1.0434479   42 0.5449591
+2 chr1  227417  267719       88.2   1.36 1.0434479    0 0.0000000
+3 chr1  317719  471368       88.2   1.36 1.0434479    2 1.0000000
+4 chr1  521368  600000       61.4   0.95 0.8015226    1 1.0000000
+5 chr1  600000 2634220       93.9   1.45 1.0965535  895 0.6904948
+6 chr1 2684220 3845268       93.9   1.45 1.0965535  570 0.8107859
+
+> head(depcov)
+   chr  begin    end avgnormcov     ratio
+1 chr1  10000 100000       94.8 1.0897044
+2 chr1 100000 177417      102.9 1.1622234
+3 chr1 227417 267719      124.4 1.3547120
+4 chr1 317719 400000       99.5 1.1317833
+5 chr1 400000 471368       83.9 0.9921172
+6 chr1 521368 600000       70.1 0.8685663 
+}
+}
+
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
 %\keyword{ ~kwd1 }

Modified: pkg/patchworkCG/man/patchwork.CGCNV.Rd
===================================================================
--- pkg/patchworkCG/man/patchwork.CGCNV.Rd	2012-01-25 13:53:13 UTC (rev 74)
+++ pkg/patchworkCG/man/patchwork.CGCNV.Rd	2012-01-25 15:58:39 UTC (rev 75)
@@ -18,7 +18,8 @@
 }
 
 \usage{
-patchwork.CGCNV(cn2,delta,het,hom,maxCn=8,ceiling=1,name="CGCNV_",CGfile=NULL)
+patchwork.CGCNV(cn2,delta,het,hom,maxCn=8,ceiling=1,name="CGCNV_",
+				CGfile=NULL)
 }
 
 \arguments{
@@ -52,10 +53,10 @@
 }
 
 \details{
-1. Run the patchwork.CG correctly. This will generate CG.Rdata.
-2. View your plots and decide the correct parameters for the other arguments of this function.
-3. Make sure CG.Rdata is in your working directory.
-4. Run the function.
+1. Run the patchwork.CG correctly. This will generate CG.Rdata. \cr
+2. View your plots and decide the correct parameters for the other arguments of this function. \cr
+3. Make sure CG.Rdata is in your working directory. \cr
+4. Run the function. \cr
 }
 
 %\value{
@@ -85,13 +86,79 @@
 \code{\link{subfunctions_CGCNV}}
 }
 
-%\examples{
-%##---- Should be DIRECTLY executable !! ----
-%##-- ==>  Define data, use random,
-%##--	or do  help(data=index)  for the standard data sets.
-%Run examples of karyotype stuff. or not, maybe just point back to CNA.
-%}
+\examples{
+\dontrun{
+>library(patchwork.CG)
 
+#With CG.Rdata in working directory. Values for parameters estimated from
+#HCC2218 chromosome 1. 
+#See plot patchworkCG/example_plots/HCC2218_KaCh_chr1.png
+>patchwork.CGCNV(cn2=0.85,delta=0.35,het=0.25,hom=0.95,name="HCC2218_")
+
+#Pointing to location of CG.Rdata file
+>patchwork.CGCNV(cn2=0.85,delta=0.35,het=0.25,hom=0.95,name="HCC2218_",
+				CGfile="path/to/CG.Rdata")
+
+#Load the objects generated from patchwork.CGCNV
+#For comparison purposes only
+>load("CGCNV.Rdata")
+
+> head(ai)
+$cn2m1
+[1] 0.2460513
+
+$cn2m0
+[1] 0.95
+
+$cn1m0
+[1] 0.9690196
+
+$cn0m0
+[1] NA
+
+$cn3m1
+[1] 0.2677295
+
+$cn3m0
+[1] 0.9671712
+
+> head(int)
+$cn2
+[1] 0.85
+
+$cn1
+[1] 0.5
+
+$cn0
+[1] 0.15
+
+$cn3
+[1] 1.2
+
+$cn4
+[1] 1.55
+
+$cn5
+[1] 1.9
+
+> head(regions)
+   chr  start    end avgnormcov relcov     ratio snvs        ai np Cn mCn
+1 chr1  10000 177417       79.0   1.05 0.9660335   24 0.5531915 17  2   1
+2 chr1 227417 267719       79.0   1.05 0.9660335    2 0.3243243  4  2   1
+3 chr1 317719 471368       79.0   1.05 0.9660335    2 0.7826087 15  2   0
+4 chr1 521368 600000      170.8   2.26 2.0792721    2 0.1944444  8  6   3
+5 chr1 600000 700000       74.6   0.99 0.9108316    2 0.5333333 10  2   1
+6 chr1 700000 900000       51.9   0.69 0.6348220  109 0.4960325 20  1   0
+  fullCN
+1  cn2m1
+2  cn2m1
+3  cn2m0
+4  cn6m3
+5  cn2m1
+6  cn1m0
+}
+}
+
 % Add one or more standard keywords, see file 'KEYWORDS' in the
 % R documentation directory.
 %\keyword{ ~kwd1 }



More information about the Patchwork-commits mailing list