diff 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
line wrap: on
line diff
--- a/mutational_patterns.R	Thu Oct 22 21:47:48 2020 +0000
+++ b/mutational_patterns.R	Thu Oct 22 23:29:28 2020 +0000
@@ -354,7 +354,9 @@
         output_table <- t(fit_res$contribution)/rowSums(t(fit_res$contribution))
         colnames(output_table) <- paste0("s", colnames(output_table))
         if (length(levels(factor(levels_table$level))) > 1) {
-            output_table <- data.frame(sample=worklist$sample, output_table)
+            output_table <- data.frame(sample=paste0(metadata_table[metadata_table$element_identifier==colnames(fit_res$contribution),
+                                                                    3], "-", colnames(fit_res$contribution) ),
+                                       output_table)
             } else {
         output_table <- data.frame(sample=rownames(output_table), output_table)
         }