comparison mutational_patterns.R @ 13:6741b819cc15 draft

"planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/mutational_patterns commit 372eb902f528baa8b5465b83d992a1d146343dfe"
author artbio
date Thu, 22 Oct 2020 23:29:28 +0000
parents 7954f0d3517f
children 56c8869a231e
comparison
equal deleted inserted replaced
12:7954f0d3517f 13:6741b819cc15
352 # export relative contribution matrix 352 # export relative contribution matrix
353 if (!is.na(opt$sig_contrib_matrix)) { 353 if (!is.na(opt$sig_contrib_matrix)) {
354 output_table <- t(fit_res$contribution)/rowSums(t(fit_res$contribution)) 354 output_table <- t(fit_res$contribution)/rowSums(t(fit_res$contribution))
355 colnames(output_table) <- paste0("s", colnames(output_table)) 355 colnames(output_table) <- paste0("s", colnames(output_table))
356 if (length(levels(factor(levels_table$level))) > 1) { 356 if (length(levels(factor(levels_table$level))) > 1) {
357 output_table <- data.frame(sample=worklist$sample, output_table) 357 output_table <- data.frame(sample=paste0(metadata_table[metadata_table$element_identifier==colnames(fit_res$contribution),
358 3], "-", colnames(fit_res$contribution) ),
359 output_table)
358 } else { 360 } else {
359 output_table <- data.frame(sample=rownames(output_table), output_table) 361 output_table <- data.frame(sample=rownames(output_table), output_table)
360 } 362 }
361 write.table(output_table, file = opt$sig_contrib_matrix, sep = "\t", quote = F, row.names = F) 363 write.table(output_table, file = opt$sig_contrib_matrix, sep = "\t", quote = F, row.names = F)
362 } 364 }