# HG changeset patch # User artbio # Date 1603325918 0 # Node ID 7995a949189fe9cb8fa5c1573538c3a030e73024 # Parent 59c0e2a7965c0a8513a222977c4c76e29f0089b9 "planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/mutational_patterns commit 94919d0f442fe7059afa2e07898c149b126a5460" diff -r 59c0e2a7965c -r 7995a949189f mutational_patterns.R --- a/mutational_patterns.R Mon Oct 19 23:34:58 2020 +0000 +++ b/mutational_patterns.R Thu Oct 22 00:18:38 2020 +0000 @@ -85,6 +85,12 @@ help = "path to output dataset" ), make_option( + "--sig_contrib_matrix", + default = NA, + type = 'character', + help = "path to signature contribution matrix" + ), + make_option( c("-r", "--rdata"), type="character", default=NULL, @@ -343,6 +349,14 @@ grid.arrange(p8) } + # export relative contribution matrix + if (!is.na(opt$sig_contrib_matrix)) { + output_table <- t(fit_res$contribution)/rowSums(t(fit_res$contribution)) + colnames(output_table) <- paste0("s", colnames(output_table)) + output_table <- data.frame(sample=rownames(output_table), output_table) + write.table(output_table, file = opt$sig_contrib_matrix, sep = "\t", quote = F, row.names = F) + } + # calculate all pairwise cosine similarities cos_sim_ori_rec <- cos_sim_matrix(pseudo_mut_mat, fit_res$reconstructed) # extract cosine similarities per sample between original and reconstructed diff -r 59c0e2a7965c -r 7995a949189f mutational_patterns.xml --- a/mutational_patterns.xml Mon Oct 19 23:34:58 2020 +0000 +++ b/mutational_patterns.xml Thu Oct 22 00:18:38 2020 +0000 @@ -1,4 +1,4 @@ - + from genomic variations in vcf files bioconductor-mutationalpatterns @@ -47,9 +47,12 @@ #end if #if $set_cosmic.choices == 'yes': - --cosmic_version $set_cosmic.cosmic_version + --cosmic_version '$set_cosmic.cosmic_version' --signum '$set_cosmic.signum' --output_cosmic $cosmic + #if $set_cosmic.contrib_matrix_out + --sig_contrib_matrix $sig_contrib_matrix + #end if #end if #if $rdata_out @@ -129,6 +132,8 @@ + @@ -147,6 +152,10 @@ set_cosmic['choices'] == "yes" + + set_cosmic['contrib_matrix_out'] + + rdata_out @@ -175,7 +184,7 @@ - + @@ -202,8 +211,8 @@ - - + + @@ -227,9 +236,11 @@ + - + + @@ -249,7 +260,7 @@ - + diff -r 59c0e2a7965c -r 7995a949189f test-data/sig_contrib_table.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/sig_contrib_table.tsv Thu Oct 22 00:18:38 2020 +0000 @@ -0,0 +1,5 @@ +sample s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 +I.vcf 0.110142906240717 0.0107179228940658 0.250337884546217 0 0.123574305205091 0.00064433123164414 0 0.132427942951795 0.0645286099734586 0 0.0449394465051191 0.0482562813691387 0.0021792135773442 0 0.0208527968750023 0.113202769843279 0 0 0 0 0 0 0 0 0.0534957402074307 0 0 0.0246998485796975 0 0 +H.vcf 0.105077406305297 0.0161426031811577 0.213744671485429 0 0.267847442499011 0 0 0.0744758833337775 0.0589788373729043 0 0.0260566297995198 0.00332317088253305 0.0101947253359771 0 0 0.165596602885273 0 0 0 0 0 0 0 0 0.0157724425494898 0 0.0064649564106814 0.0363246279589487 0 0 +G.vcf 0.211033078587086 0.0166966912787851 0.172186940126079 0 0.286633042356631 0 0 0.00842344130070046 0.11400762247453 0 0.0288922172140213 0.0327352792025852 0 0 0 0.034128625357202 0 0 0.0288565039877324 0 0 0 0 0 0.0631355806535697 0 0.000844012191577089 0.00242696526950036 0 0 +F.vcf 0.275881644071761 0.00660164806875313 0.17426347088712 0 0.102714094410494 0 0 0.0917555941611345 0.0202950075653247 0 0.0296908924905143 0.0090315352239272 0 0 0 0.188940992761965 0 0 0 0 0 0 0 0 0.0273695319074987 0 0.00555599996394483 0.0404508145574958 0 0.0274487739300663