[Patchwork-commits] r95 - pkg/patchworkCG/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 15 17:37:07 CET 2012


Author: mayrhofer
Date: 2012-02-15 17:37:07 +0100 (Wed, 15 Feb 2012)
New Revision: 95

Modified:
   pkg/patchworkCG/R/patchwork.CGCNV.r
Log:
changes

Modified: pkg/patchworkCG/R/patchwork.CGCNV.r
===================================================================
--- pkg/patchworkCG/R/patchwork.CGCNV.r	2012-02-15 16:31:22 UTC (rev 94)
+++ pkg/patchworkCG/R/patchwork.CGCNV.r	2012-02-15 16:37:07 UTC (rev 95)
@@ -285,8 +285,15 @@
 	xdelta <- weightedMean(regions$ratio[ix2],regions$np[ix2]) - weightedMean(regions$ratio[ix1],regions$np[ix1])
 	expected_delta <- 1/meanCn
 	
-	tumor_percent <- xdelta / expected_delta
+	tumor_percentDNA <- xdelta / expected_delta
+    tumor_percent <- tumor_percentDNA/(meanCn/2) / ( tumor_percentDNA/(meanCn/2) + (1-tumor_percentDNA) )
 
+    regions$meanCn <- meanCn
+    regions$tumor_percent <- tumor_percent
+ 
+    write.csv(regions,file='Copynumbers.csv')
+    
+
 	CG_Ka_check(regions$chr,regions$start,regions$end,regions$ratio,regions$ai,
 					regions$Cn,regions$mCn,list(int=int,ai=ai),name=name,
 					xlim=c(0,2.4),ylim=c(0,1))



More information about the Patchwork-commits mailing list