# HG changeset patch # User Ido Tamir # Date 1379936784 -7200 # Node ID de452b96da8eb3907b9a8ad386c993ec23859a5c # Parent f3e037496c18b27d3a114ecc24ed588234bf8539 added bam input diff -r f3e037496c18 -r de452b96da8e corr.R --- a/corr.R Sun Aug 18 21:33:43 2013 +0200 +++ b/corr.R Mon Sep 23 13:46:24 2013 +0200 @@ -17,10 +17,13 @@ options("useFancyQuotes" = FALSE) +TEST=FALSE + library(rtracklayer) library(lattice) library(latticeExtra) library(hexbin) +library(Rsamtools) ## creates the union of coverages i.e. mappable regions ## todo: add mappability argument @@ -109,7 +112,11 @@ getCoverage <- function(infile, format){ print(paste("reading", infile, format)) - values <- import(infile, format=format, asRangedData = FALSE) + values <- if(format == "bam"){ + import(infile, format=format) + }else{ + import(infile, format=format, asRangedData = FALSE) + } if(tolower(format) %in% c("bigwig","wig")){ values }else{ @@ -157,6 +164,17 @@ args <- commandArgs(TRUE) +if(TEST){ + args[1] <- c("file1.bed,file2.bed,file3.bed,file4.bed") + args[1] <- c("file1.bam,file2.bam,file3.bam,file4.bam") + args[2] <- c("file1,file2,file3,file4") + args[3] <- c("bam,bam,bam,bam") + args[4] <- "out.pdf" + args[5] <- "mat.mat" + args[6] <- "title" + args[7] <- NA +} + infiles <- unlist(strsplit(args[1], ",")) outnames <- unlist(strsplit(args[2], ",")) formats <- unlist(strsplit(args[3], ",")) diff -r f3e037496c18 -r de452b96da8e corr.xml --- a/corr.xml Sun Aug 18 21:33:43 2013 +0200 +++ b/corr.xml Mon Sep 23 13:46:24 2013 +0200 @@ -40,7 +40,7 @@ Requirements: ------------- -At least two files of 6 column bed, wig(?) or bigWig format +At least two files of 6 column bed, wig, bam or bigWig format Outputs: -------- @@ -52,7 +52,6 @@ TODO: ----- - Add mappability track option -- Add bam as input