# HG changeset patch # User peter-waltman # Date 1362185485 18000 # Node ID 563832f48c08284716b2c66ff71dca9c2837d09c # Parent b8f262149ee294e6a1bf1097b27c8ae78daa554d Uploaded diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/cluster.2.centroid.xml --- a/cluster.tools/cluster.2.centroid.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/cluster.2.centroid.xml Fri Mar 01 19:51:25 2013 -0500 @@ -8,8 +8,8 @@ + - diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/extract.TCGA.survival.data.R --- a/cluster.tools/extract.TCGA.survival.data.R Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/extract.TCGA.survival.data.R Fri Mar 01 19:51:25 2013 -0500 @@ -93,6 +93,7 @@ } clinical.data <- as.numeric( ! grepl( "(LIVING|Not)", clinical.data ) ) } + if ( is.null(opt$time.column ) ) { time.colname <- "CDE.clinical_time" diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/extract.TCGA.survival.data.xml --- a/cluster.tools/extract.TCGA.survival.data.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/extract.TCGA.survival.data.xml Fri Mar 01 19:51:25 2013 -0500 @@ -5,10 +5,10 @@ - + - + .. class:: infomark diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/fix.and.merge.TCGA.sample.IDs.R --- a/cluster.tools/fix.and.merge.TCGA.sample.IDs.R Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/fix.and.merge.TCGA.sample.IDs.R Fri Mar 01 19:51:25 2013 -0500 @@ -48,7 +48,6 @@ cat( err.msg, file=opt$output.fname ) stop( err.msg ) } - remove.periods.from.ids <- function( ids ) { return( gsub( "\\.", "-", ids ) ) } @@ -115,6 +114,7 @@ if ( nelts > 3 ) { normals <- grepl( "^TCGA-..-....-1", cnames ) data <- data[ , (! normals ), drop=FALSE ] + cnames <- cnames[ ! normals ] } } diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/fix.and.merge.TCGA.sample.IDs.xml --- a/cluster.tools/fix.and.merge.TCGA.sample.IDs.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/fix.and.merge.TCGA.sample.IDs.xml Fri Mar 01 19:51:25 2013 -0500 @@ -1,13 +1,13 @@ fix.and.merge.TCGA.sample.IDs.py --d $dataset -n ${num_components} ${remove_normals} +-d $dataset +-n ${num_components} -o ${output} - @@ -27,7 +27,5 @@ - **Number of barcode components to use** Specify the number of barcode components to use in new matrix that is produced **(min number is 3)** -- **Remove Normals from Matrix?** - Remove any normals from the matrix (if necessary) - diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/format.raw.TCGA.RNASeq.data.xml --- a/cluster.tools/format.raw.TCGA.RNASeq.data.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/format.raw.TCGA.RNASeq.data.xml Fri Mar 01 19:51:25 2013 -0500 @@ -9,8 +9,8 @@ + - diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/gen.matrix.heatmap.xml --- a/cluster.tools/gen.matrix.heatmap.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/gen.matrix.heatmap.xml Fri Mar 01 19:51:25 2013 -0500 @@ -26,12 +26,12 @@ + - + - diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/heatmap.from.cluster.result.R --- a/cluster.tools/heatmap.from.cluster.result.R Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/heatmap.from.cluster.result.R Fri Mar 01 19:51:25 2013 -0500 @@ -46,7 +46,7 @@ "survival.fname", "S", 2, "character", "survival.image", "I", 2, "character", "survival.mode", "M", 2, "character", - "title", "T", 2, "character" + "survival.title", "T", 2, "character" ), nc=4, byrow=TRUE @@ -332,6 +332,8 @@ cmd.string <- paste( cmd.string, "-C", opt$dataset ) cmd.string <- paste( cmd.string, "-S", opt$survival.fname ) cmd.string <- paste( cmd.string, "-M", opt$survival.mode ) + if ( ! is.null( opt$suvival.title ) ) + cmd.string <- paste( cmd.string, "-T", opt$suvival.title ) ## only call kms if we're the image is png if ( opt$image.format=="png" ) { diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/heatmap.from.cluster.result.xml --- a/cluster.tools/heatmap.from.cluster.result.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/heatmap.from.cluster.result.xml Fri Mar 01 19:51:25 2013 -0500 @@ -35,8 +35,8 @@ + - @@ -50,8 +50,8 @@ + - @@ -65,12 +65,12 @@ + - + - diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/remove.tcga.normals.R --- a/cluster.tools/remove.tcga.normals.R Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/remove.tcga.normals.R Fri Mar 01 19:51:25 2013 -0500 @@ -12,6 +12,14 @@ q(); } +## some helper fn's +write.2.tab <- function( mat, + fname ) { + mat <- rbind( colnames( mat ), mat ) + mat <- cbind( c( "ID", rownames( mat )[-1] ), + mat ) + write.table( mat, fname, sep="\t", row.names=FALSE, col.names=FALSE, quote=FALSE ) +} lib.load.quiet <- function( package ) { package <- as.character(substitute(package)) suppressPackageStartupMessages( do.call( "library", list( package=package ) ) ) @@ -19,7 +27,9 @@ lib.load.quiet(getopt) spec <- matrix( c( "data.fname", "d", 1, "character", - "output.fname", "o", 2, "character" + "output.fname", "o", 2, "character", + "return.normals", "r", 2, "character", + "out.norm.fname", "O", 2, "character" ), nc=4, byrow=TRUE @@ -27,15 +37,34 @@ opt <- getopt( spec=spec ) if ( is.null( opt$output.fname ) ) { opt$output.fname <- 'merge_merge.tumors.tab' } +if ( is.null( opt$return.normals ) ) { + opt$return.normals <- FALSE +} else { + opt$return.normals <- ( tolower( opt$return.normals ) %in% "yes" ) +} +if ( is.null( opt$out.norm.fname ) ) { opt$out.norm.fname <- 'merge_merge.normals.tab' } mat <- as.matrix( read.delim( opt$data.fname, row.names=1, check.names=FALSE ) ) -if ( length( strsplit( colnames( mat ), "-" )[[1]] ) == 4 ) { +norms <- matrix( NA, nc=0, nr=nrow( mat ), dimnames=list( rownames( mat ), c() ) ) +if ( length( strsplit( colnames( mat ), "-" )[[1]] ) > 3 ) { cnames <- sapply( strsplit( colnames( mat ), "-" ), function(x) x[4] ) norms <- grepl( "^1", cnames ) if ( sum( norms ) > 0 ) { tumors <- ! norms + norms <- mat[, norms ] mat <- mat[, tumors ] } +} else { + if ( opt$return.normals ) { + writeLines( "TCGA ID barcodes in supplied file only provide patient sample info (no aliquot components are in IDs)\n", opt$out.norm.fname ) + } } -write.table( mat, opt$output.fname, quote=FALSE, sep="\t", col.names=NA ) +write.2.tab( mat, opt$output.fname ) +if ( opt$return.normals ) { + if ( ncol( norms ) > 0 ) { + write.2.tab( norms, opt$out.norm.fname ) + } else { + writeLines( "no normals found in supplied matrix\n", opt$out.norm.fname ) + } +} diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/remove.tcga.normals.xml --- a/cluster.tools/remove.tcga.normals.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/remove.tcga.normals.xml Fri Mar 01 19:51:25 2013 -0500 @@ -1,14 +1,24 @@ remove.tcga.normals.py -d $dataset --o ${output} - - +-o ${output_tumor} +-r ${return_normal_matrix} +#if str($return_normal_matrix) == 'yes': +-O ${output_normal} +#end if + - + + + + + - + + + (return_normal_matrix)=="yes" + .. class:: infomark diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/rnaseq.feature.selection.R --- a/cluster.tools/rnaseq.feature.selection.R Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/rnaseq.feature.selection.R Fri Mar 01 19:51:25 2013 -0500 @@ -46,7 +46,7 @@ spec <- matrix( c( "data.fname", "d", 1, "character", "output.fname", "o", 2, "character", - "var.method", "m", 2, "character", ## must be either 'active', 'inactive' or 'modulated' + "var.method", "m", 2, "character", "z.transform", "z", 2, "character", "perc.pass", "p", 2, "numeric" ), diff -r b8f262149ee2 -r 563832f48c08 cluster.tools/rnaseq.feature.selection.xml --- a/cluster.tools/rnaseq.feature.selection.xml Fri Mar 01 10:17:24 2013 -0500 +++ b/cluster.tools/rnaseq.feature.selection.xml Fri Mar 01 19:51:25 2013 -0500 @@ -1,4 +1,4 @@ - + rnaseq.feature.selection.py -d $dataset -z ${z_transform} @@ -21,7 +21,7 @@ - + .. class:: infomark