[Patchwork-commits] r217 - .git .git/logs .git/logs/refs/heads .git/logs/refs/remotes/origin .git/refs/heads .git/refs/remotes/origin pkg/TAPS/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 26 09:33:33 CEST 2015


Author: sebastian_d
Date: 2015-06-26 09:33:33 +0200 (Fri, 26 Jun 2015)
New Revision: 217

Modified:
   .git/index
   .git/logs/HEAD
   .git/logs/refs/heads/master
   .git/logs/refs/remotes/origin/master
   .git/refs/heads/master
   .git/refs/remotes/origin/master
   pkg/TAPS/R/TAPS.r
Log:
TAPS update markus

Modified: .git/index
===================================================================
(Binary files differ)

Modified: .git/logs/HEAD
===================================================================
--- .git/logs/HEAD	2015-06-18 08:25:41 UTC (rev 216)
+++ .git/logs/HEAD	2015-06-26 07:33:33 UTC (rev 217)
@@ -99,3 +99,4 @@
 cefeee2662b45c7daf3b8916b967173f68b6ddcf e8cc7370da527f1d46bb81720f663ceed281e07d Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1409832387 +0200	pull: Fast-forward
 e8cc7370da527f1d46bb81720f663ceed281e07d b5798bb1874d9dc8e50fa5083961a8836d79f76c Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1411979666 +0200	pull: Fast-forward
 b5798bb1874d9dc8e50fa5083961a8836d79f76c 52402622419759bc3642b6f49dd0f4abd2003d38 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1434615906 +0200	pull: Fast-forward
+52402622419759bc3642b6f49dd0f4abd2003d38 4bbde19cc8582ba3fb6caf01b1b01165c5db15d6 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1435303966 +0200	pull: Fast-forward

Modified: .git/logs/refs/heads/master
===================================================================
--- .git/logs/refs/heads/master	2015-06-18 08:25:41 UTC (rev 216)
+++ .git/logs/refs/heads/master	2015-06-26 07:33:33 UTC (rev 217)
@@ -99,3 +99,4 @@
 cefeee2662b45c7daf3b8916b967173f68b6ddcf e8cc7370da527f1d46bb81720f663ceed281e07d Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1409832387 +0200	pull: Fast-forward
 e8cc7370da527f1d46bb81720f663ceed281e07d b5798bb1874d9dc8e50fa5083961a8836d79f76c Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1411979666 +0200	pull: Fast-forward
 b5798bb1874d9dc8e50fa5083961a8836d79f76c 52402622419759bc3642b6f49dd0f4abd2003d38 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1434615906 +0200	pull: Fast-forward
+52402622419759bc3642b6f49dd0f4abd2003d38 4bbde19cc8582ba3fb6caf01b1b01165c5db15d6 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1435303966 +0200	pull: Fast-forward

Modified: .git/logs/refs/remotes/origin/master
===================================================================
--- .git/logs/refs/remotes/origin/master	2015-06-18 08:25:41 UTC (rev 216)
+++ .git/logs/refs/remotes/origin/master	2015-06-26 07:33:33 UTC (rev 217)
@@ -96,3 +96,4 @@
 cefeee2662b45c7daf3b8916b967173f68b6ddcf e8cc7370da527f1d46bb81720f663ceed281e07d Sebastian DiLorenzo <S_D at array-47-13.medsci.uu.se> 1409832387 +0200	pull: fast-forward
 e8cc7370da527f1d46bb81720f663ceed281e07d b5798bb1874d9dc8e50fa5083961a8836d79f76c Sebastian DiLorenzo <S_D at array-47-13.medsci.uu.se> 1411979666 +0200	pull: fast-forward
 b5798bb1874d9dc8e50fa5083961a8836d79f76c 52402622419759bc3642b6f49dd0f4abd2003d38 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1434615905 +0200	pull: fast-forward
+52402622419759bc3642b6f49dd0f4abd2003d38 4bbde19cc8582ba3fb6caf01b1b01165c5db15d6 Sebastian DiLorenzo <dilorenzo.sebastian at gmail.com> 1435303966 +0200	pull: fast-forward

Modified: .git/refs/heads/master
===================================================================
--- .git/refs/heads/master	2015-06-18 08:25:41 UTC (rev 216)
+++ .git/refs/heads/master	2015-06-26 07:33:33 UTC (rev 217)
@@ -1 +1 @@
-52402622419759bc3642b6f49dd0f4abd2003d38
+4bbde19cc8582ba3fb6caf01b1b01165c5db15d6

Modified: .git/refs/remotes/origin/master
===================================================================
--- .git/refs/remotes/origin/master	2015-06-18 08:25:41 UTC (rev 216)
+++ .git/refs/remotes/origin/master	2015-06-26 07:33:33 UTC (rev 217)
@@ -1 +1 @@
-52402622419759bc3642b6f49dd0f4abd2003d38
+4bbde19cc8582ba3fb6caf01b1b01165c5db15d6

Modified: pkg/TAPS/R/TAPS.r
===================================================================
--- pkg/TAPS/R/TAPS.r	2015-06-18 08:25:41 UTC (rev 216)
+++ pkg/TAPS/R/TAPS.r	2015-06-26 07:33:33 UTC (rev 217)
@@ -15,6 +15,7 @@
 TAPS_plot <- function(#samples='all',
                      directory=NULL,autoEstimate=FALSE,
                       bin=250,cores=1,matched=FALSE,allelePeaks=FALSE) {
+    cores=1
     #Automatically check, and if needed install, packages stats and fields
     
     #Load stats. It should be in all, at least semi-new, R distributions so we dont need to install.package it or
@@ -155,10 +156,12 @@
         Log2=Log2[!is.nan(Log2$Value),]
         Log2=Log2[!is.na(Log2$Value),]
         Log2 <- Log2[which(Log2$Value != -Inf & Log2$Value != +Inf ),]
+        Log2=chromFix(Log2)
         alf=alf[!is.nan(alf$Value),]
         alf=alf[!is.na(alf$Value),]
         alf$Value[alf$Value<0]=0; alf$Value[alf$Value>1]=1
         alf <- alf[which(alf$Value != -Inf & alf$Value != +Inf ),]
+        alf=chromFix(alf)
         
         segments <- readSegments()                                ## segments if available (CBS recommended)
  
@@ -266,6 +269,7 @@
 
 ###
 TAPS_call <- function(samples='all',directory=getwd(),cores=1) {
+    cores=1
     minseg=1
     maxCn=12
     #suppressPackageStartupMessages(library(xlsx))    
@@ -330,20 +334,32 @@
             
                 # cat(' ..loading', subs[i])
             print(paste(i,'/',length(subs),': ',subs[i],' Loading',sep=''))
-            Log2 <- readLog2()
-            alf <- readAlf(localDir)
+            if (file.exists('rawcopy.Rdata')) {
+                load('rawcopy.Rdata')
+                Log2=probes.txt[,2:5]
+                alf=snps.txt[,2:5]
+            } else {
+                Log2 <- readLog2()
+                alf <- readAlf(localDir)
+            }
             segments <- readSegments()
             
             #Some samples contain NA values, we simply remove these.
             Log2=Log2[!is.nan(Log2$Value),]
+            Log2=chromFix(Log2)
+            
             Log2=Log2[!is.na(Log2$Value),]
             
             alf=alf[!is.nan(alf$Value),]
             alf=alf[!is.na(alf$Value),]
+            alf=chromFix(alf)
             
+            
             segments <- segments[!is.nan(segments$Value),]
             segments <- segments[!is.na(segments$Value),]    
+            segments=chromFix(segments)
             
+            
             segments$Value <- segments$Value-mean(Log2$Value) 
             Log2$Value <- Log2$Value-mean(Log2$Value)
             
@@ -1533,7 +1549,7 @@
 ### Function for summarizing alteration frquencies in X samples
 TAPS_freq <- function(samples='all', outdir='frequencies', hg19=T) {
     #suppressPackageStartupMessages(library(xlsx))    
-    
+    #browser()
     sampleData <- load.txt('SampleData.csv')
     olddir <- getwd()
     if (!is.na(outdir)) {
@@ -1556,14 +1572,17 @@
     ## Load and parse all samples
     samples <- meanCns <- NULL
     
-    for (i in 1:nSamples) {
+    for (i in 1:nSamples) try( {
+        #cat(subs[i],'\n')
         table <- load.txt(paste(olddir,'/',subs[i],'/',subs[i],'_segmentCN.txt',sep=''))
         table$n <- i
         table$name <- as.character(subs[i])    
         ix <- as.numeric(deChrom_ucsc(table$Chromosome)) <= 22
+        table=table[!is.na(ix),]
+        ix <- as.numeric(deChrom_ucsc(table$Chromosome)) <= 22
         table$meanCn <- meanCns[i] <- round(weightedMean(table$Cn_[ix], table$lengthMB[ix]),2)    
         samples <- rbind(samples,table) 
-    }
+    }, silent=T)
 
     samples=samples[!is.na(samples$Cn),]
     regs=samples[samples$Chromosome!='chrY',]
@@ -4056,3 +4075,8 @@
 
 }
 
+chromFix <- function(data) {
+    if (any(data$Chromosome=='1'))
+        data$Chromosome=paste('chr',data$Chromosome,sep='')
+    return(data)
+}
\ No newline at end of file



More information about the Patchwork-commits mailing list