comparison corr.R @ 9:ecad2cd5038f

debug message was making truble
author Ido Tamir <ido.tamir@imp.ac.at>
date Sun, 18 Aug 2013 18:03:53 +0200
parents fcf85568a102
children 74bfa2464411
comparison
equal deleted inserted replaced
8:44920cae2f4d 9:ecad2cd5038f
28 suppressWarnings(Reduce(union, coverages)) #supress because missing chromosomes spit warinings 28 suppressWarnings(Reduce(union, coverages)) #supress because missing chromosomes spit warinings
29 } 29 }
30 30
31 ## adds mappable regions as 0 coverage to track 31 ## adds mappable regions as 0 coverage to track
32 covWith0 <- function(cov, mappable){ 32 covWith0 <- function(cov, mappable){
33 print(paste("cov:",cov)) 33 print(paste("cov:", summary(cov)))
34 c0 <- setdiff(mappable, cov) 34 c0 <- setdiff(mappable, cov)
35 cus <- if(length(c0) > 0){ 35 cus <- if(length(c0) > 0){
36 elementMetadata(c0)$score <- 0 36 elementMetadata(c0)$score <- 0
37 sort(c(c0, cov)) 37 sort(c(c0, cov))
38 }else{ 38 }else{
123 getCoverages <- function(infiles, formats){ 123 getCoverages <- function(infiles, formats){
124 apply(data.frame(file=infiles,format=formats),1, function(row){ getCoverage(row['file'], row['format']) }) 124 apply(data.frame(file=infiles,format=formats),1, function(row){ getCoverage(row['file'], row['format']) })
125 } 125 }
126 126
127 getMappable <- function(coverages, mappable){ 127 getMappable <- function(coverages, mappable){
128 print(paste("creating mappability", mappable)) 128 print(paste("creating mappability", length(coverages), mappable))
129 if(is.na(mappable)){ 129 if(is.na(mappable)){
130 createMappable(coverages) 130 createMappable(coverages)
131 }else{ 131 }else{
132 import(mappable, format="bed", asRangedData = FALSE) 132 import(mappable, format="bed", asRangedData = FALSE)
133 } 133 }