Mercurial > repos > stef > qdnaseq
comparison QDNAseq.R @ 30:647143d0c884 draft
Uploaded
author | stef |
---|---|
date | Wed, 18 Jun 2014 05:45:02 -0400 |
parents | 4c4e4d88779c |
children | 2517af3f3475 |
comparison
equal
deleted
inserted
replaced
29:4c4e4d88779c | 30:647143d0c884 |
---|---|
114 ## have to set R output options otherwise scientific method is used at some point | 114 ## have to set R output options otherwise scientific method is used at some point |
115 options( "scipen"=100 ) | 115 options( "scipen"=100 ) |
116 | 116 |
117 sampleCount <- length( regionsList ) | 117 sampleCount <- length( regionsList ) |
118 sampleNames <- names( regionsList ) | 118 sampleNames <- names( regionsList ) |
119 systemUser <- system("whoami",T) | |
120 bedgraphColumns <- c( 'chr', 'start', 'end', 'segmentval' ) | 119 bedgraphColumns <- c( 'chr', 'start', 'end', 'segmentval' ) |
121 | 120 |
122 cat( MAIN_NAME, " Hello ", systemUser, "!!\n", sep="") | |
123 cat( MAIN_NAME, " There are ", sampleCount, " samples found in input list...\n", sep="") | 121 cat( MAIN_NAME, " There are ", sampleCount, " samples found in input list...\n", sep="") |
124 | 122 |
125 for ( sample in sampleNames ){ | 123 for ( sample in sampleNames ){ |
126 cat( MAIN_NAME, " Working on sample ", sample, "\n", sep="") | 124 cat( MAIN_NAME, " Working on sample ", sample, "\n", sep="") |
127 regionCount <- nrow( regionsList[[sample]] ) | 125 regionCount <- nrow( regionsList[[sample]] ) |
177 MAIN_NAME <- '[INFO] ' | 175 MAIN_NAME <- '[INFO] ' |
178 CSS_FILE <- paste( TOOL_PATH, '/QDNAseq.css', sep="" ) | 176 CSS_FILE <- paste( TOOL_PATH, '/QDNAseq.css', sep="" ) |
179 DECIMALS <- 3 | 177 DECIMALS <- 3 |
180 WEB_LINK <- 'http://www.bioconductor.org/packages/release/bioc/html/QDNAseq.html' | 178 WEB_LINK <- 'http://www.bioconductor.org/packages/release/bioc/html/QDNAseq.html' |
181 | 179 |
180 | |
181 | |
182 catMsg( "Starting QDNAseq wrapper" ) | 182 catMsg( "Starting QDNAseq wrapper" ) |
183 catMsg( "Loading R libraries" ) | 183 catMsg( "Loading R libraries" ) |
184 suppressWarnings( suppressMessages( library( QDNAseq, quietly = TRUE ) ) ) | 184 suppressWarnings( suppressMessages( library( QDNAseq, quietly = TRUE ) ) ) |
185 suppressWarnings( suppressMessages( library( CGHcall, quietly = TRUE ) ) ) | 185 suppressWarnings( suppressMessages( library( CGHcall, quietly = TRUE ) ) ) |
186 | 186 |
187 systemUser <- system("whoami",T) | |
187 qdnaseqVersion <- packageDescription( "QDNAseq" )$Version | 188 qdnaseqVersion <- packageDescription( "QDNAseq" )$Version |
188 qdnaseqDate <- packageDescription( "QDNAseq" )$Date | 189 catMsg( c(" Hello ", systemUser ) ) |
189 catMsg( paste("QDNAseq info: version(", qdnaseqVersion, ") and date (", qdnaseqDate, ")", sep="") ) | 190 catMsg( c("QDNAseq version loaded: ", qdnaseqVersion) ) |
190 | 191 |
191 ## only one param: the tmp config file | 192 ## only one param: the tmp config file |
192 cmdLineArgs <- commandArgs(TRUE) | 193 cmdLineArgs <- commandArgs(TRUE) |
193 config <- cmdLineArgs[1] | 194 config <- cmdLineArgs[1] |
194 | 195 |
348 region_count <- nrow( data.frame( regions[[ sample ]] ) ) | 349 region_count <- nrow( data.frame( regions[[ sample ]] ) ) |
349 cat( MAIN_NAME, ' sample "', sample, '" has ', region_count, " regions\n", sep="" ) | 350 cat( MAIN_NAME, ' sample "', sample, '" has ', region_count, " regions\n", sep="" ) |
350 plotted_images[[ sample ]][[ 'region_count' ]] <- region_count | 351 plotted_images[[ sample ]][[ 'region_count' ]] <- region_count |
351 } | 352 } |
352 | 353 |
353 ## add read counts | 354 ## add USED read counts |
354 catMsg( "Used") | |
355 catMsg( usedReads ) | |
356 | |
357 plotted_images[[ sample ]][[ 'usedReads' ]] <- usedReads | 355 plotted_images[[ sample ]][[ 'usedReads' ]] <- usedReads |
358 } | 356 } |
359 #cat( MAIN_NAME, "PLOTTED_IMAGES: ", names(plotted_images), "\n", sep="" ) | |
360 | 357 |
361 if ( doCall ){ | 358 if ( doCall ){ |
362 saveRDS( regions, robjRegionPath ) | 359 saveRDS( regions, robjRegionPath ) |
363 printedFiles <- outputRegionsFromList( regions, outputBasename=outputName, outputDir=outputPath ) | 360 printedFiles <- outputRegionsFromList( regions, outputBasename=outputName, outputDir=outputPath ) |
364 } | 361 } |