annotate correctReads.R @ 0:75c4a4c32bae draft default tip

planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
author morinlab
date Tue, 11 Oct 2016 14:18:25 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
1 library(TitanCNA)
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
2 version <- "0.1.1"
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
3 args <- commandArgs(TRUE)
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
4
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
5 tumWig <- args[1]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
6 normWig <- args[2]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
7 gc <- args[3]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
8 map <- args[4]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
9 target_list <- args[5]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
10 outfile <- args[6]
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
11
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
12 message('titan: Correcting GC content and mappability biases...')
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
13
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
14 if( !is.null(target_list) ){
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
15 target_list_data <- read.table(target_list, sep="\t", header=F, stringsAsFactors=F)
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
16 cnData <- correctReadDepth(tumWig, normWig, gc, map, targetedSequence = target_list_data)
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
17 } else {
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
18 cnData <- correctReadDepth(tumWig, normWig, gc, map)
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
19 }
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
20
75c4a4c32bae planemo upload for repository https://github.com/morinlab/tools-morinlab/tree/master/tools/correct_read_counter commit 4ef2d91b7c1686a2696b92fe538d4aec51d05e40-dirty
morinlab
parents:
diff changeset
21 write.table(cnData, file = outfile, col.names = TRUE, row.names = FALSE, quote = FALSE, sep ="\t")