[Patchwork-commits] r43 - in pkg/patchwork: . R inst/python man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 8 17:21:21 CET 2011


Author: sebastian_d
Date: 2011-12-08 17:21:20 +0100 (Thu, 08 Dec 2011)
New Revision: 43

Added:
   pkg/patchwork/README
Modified:
   pkg/patchwork/R/patchwork.CNA.r
   pkg/patchwork/R/patchwork.createreference.r
   pkg/patchwork/inst/python/Pysamloader.py
   pkg/patchwork/man/patchwork.CNA.Rd
   pkg/patchwork/man/patchwork.findCNs.Rd
Log:
some changes to pysamloader so it can take chromosomes both with names chr1..chr22 and 1..22

Modified: pkg/patchwork/R/patchwork.CNA.r
===================================================================
--- pkg/patchwork/R/patchwork.CNA.r	2011-12-08 09:59:09 UTC (rev 42)
+++ pkg/patchwork/R/patchwork.CNA.r	2011-12-08 16:21:20 UTC (rev 43)
@@ -83,6 +83,7 @@
 		cat("Smoothing Complete \n")
 		}
 	
+	segs = NULL
 	try( load("Segments.Rdata"), silent=TRUE )
 	
 	if(length(segs) == 0)

Modified: pkg/patchwork/R/patchwork.createreference.r
===================================================================
--- pkg/patchwork/R/patchwork.createreference.r	2011-12-08 09:59:09 UTC (rev 42)
+++ pkg/patchwork/R/patchwork.createreference.r	2011-12-08 16:21:20 UTC (rev 43)
@@ -5,21 +5,9 @@
 	
 	files = list(...)
 	
-	#packagepath = system.file(package="patchwork")
-	#load(paste(packagepath,"/data/ideogram.RData",sep=""))
-	alf = NULL
-	try( load("pile.alleles.Rdata"), silent=TRUE )
-	
-	if(length(alf) > 1)
-		{
-		chroms=as.character(unique(alf$achr))
-		chroms = chroms[chroms != chroms[grep("M",chroms)]]
-		}
-	else
-		{
-		data(ideogram,package="patchworkData")
-		chroms=as.character(unique(ideogram$chr))
-		}
+	data(ideogram,package="patchworkData")
+	chroms=as.character(unique(ideogram$chr))
+		
 	j = 0
 	
 	for (i in files)
@@ -67,6 +55,8 @@
 							counts_mean=data$counts,
 							norm_mean=data$norm)
 		}
+	
+	#conform chromosome naming to suit
 
 	
 	cat("Saving to ",output,".Rdata \n",sep="")

Added: pkg/patchwork/README
===================================================================
--- pkg/patchwork/README	                        (rev 0)
+++ pkg/patchwork/README	2011-12-08 16:21:20 UTC (rev 43)
@@ -0,0 +1,11 @@
+Welcome to Patchwork.
+
+For patchwork to run you will need to install DNACopy from Bioconductor.
+
+Installation Guide:
+
+1. Start R (as of writing version 2.14.0)
+2.  source("http://bioconductor.org/biocLite.R")
+3.    biocLite("DNAcopy")
+
+Good luck! =)

Modified: pkg/patchwork/inst/python/Pysamloader.py
===================================================================
--- pkg/patchwork/inst/python/Pysamloader.py	2011-12-08 09:59:09 UTC (rev 42)
+++ pkg/patchwork/inst/python/Pysamloader.py	2011-12-08 16:21:20 UTC (rev 43)
@@ -29,8 +29,13 @@
     
 outfile = open(".Tmp_chr_pos","w")
 
-for read in infile.fetch(sys.argv[2]):
-	outfile.write(str(read.pos) + "\n")
+try:
+	for read in infile.fetch(sys.argv[2]):
+		outfile.write(str(read.pos) + "\n")
+except:
+	a = re.split('chr',sys.argv[2])
+	for read in infile.fetch(a[1]):
+		outfile.write(str(read.pos) + "\n")
 	
 infile.close()
 outfile.close()

Modified: pkg/patchwork/man/patchwork.CNA.Rd
===================================================================
--- pkg/patchwork/man/patchwork.CNA.Rd	2011-12-08 09:59:09 UTC (rev 42)
+++ pkg/patchwork/man/patchwork.CNA.Rd	2011-12-08 16:21:20 UTC (rev 43)
@@ -50,18 +50,26 @@
 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:
+Upon completion of the the method you may receive the following kinds of warnings:
 
 Warning messages: \cr
 1: In readChar(con, 5L, useBytes = TRUE) : \cr
   cannot open compressed file 'data.Rdata', probable reason 'No such file or directory' \cr
 2: In readChar(con, 5L, useBytes = TRUE) : \cr
   cannot open compressed file 'pile.alleles.Rdata', probable reason 'No such file or directory' \cr
+  2: In readChar(con, 5L, useBytes = TRUE) : \cr
+  cannot open compressed file 'Segments.Rdata.Rdata', probable reason 'No such file or directory' \cr
 
+etc...  
+
 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 
+The patchwork function will check if you have data.Rdata or pile.alleles.Rdata etc
 in your working directory to avoid remaking these, should they already exist.
+
+\bold{This also means that to make a completely clean run of patchwork.CNA you need to
+delete data.Rdata, findCNs.Rdata,pile.alleles.Rdata,smoothed.Rdata,Segments.Rdata from your
+working directory!!}
 }
 
 %\value{

Modified: pkg/patchwork/man/patchwork.findCNs.Rd
===================================================================
--- pkg/patchwork/man/patchwork.findCNs.Rd	2011-12-08 09:59:09 UTC (rev 42)
+++ pkg/patchwork/man/patchwork.findCNs.Rd	2011-12-08 16:21:20 UTC (rev 43)
@@ -23,10 +23,11 @@
 
 \arguments{
   \item{cn2}{
-	The approximate position of copy number two on total intensity axis.
+	The approximate position of copy number 2,diploid, on total intensity axis.
 	}
   \item{delta}{
 	The difference in total intensity between consecutive copy numbers. For example 1 and 2 or 2 and 3.
+	If copy number 2 has total intensity ~0.6 and copy number 3 har total intensity ~0.8 then delta would be 0.2.
 	}
   \item{het}{
 	Allelic imbalance ratio of heterozygous copy number 2.



More information about the Patchwork-commits mailing list