Next changeset 1:db1d80e89156 (2016-08-06) |
Commit message:
planemo upload for repository https://github.com/workflow4metabolomics/heatmap.git commit 7e599d006e53fefb7e1b923ba8894b4fb19f9cfa-dirty |
added:
LICENSE.md README.md build.xml heatmap_config.xml heatmap_script.R heatmap_wrapper.R static/images/heatmap_workflowPositionImage.png static/images/heatmap_workingExampleImage.png test-data/input-dataMatrix.tsv test-data/input-sampleMetadata.tsv test-data/input-variableMetadata.tsv test-data/output-dataMatrix.tsv test-data/output-variableMetadata.tsv tests/exa1/dataMatrix.tsv tests/exa1/sampleMetadata.tsv tests/exa1/variableMetadata.tsv tests/exa2/dataMatrix.tsv tests/exa2/sampleMetadata.tsv tests/exa2/variableMetadata.tsv tests/heatmap_runtests.R tests/heatmap_tests.R tests/input/dataMatrix.tsv tests/input/sampleMetadata.tsv tests/input/variableMetadata.tsv tests/output/dataMatrix.tsv tests/output/essai.tsv tests/output/figure.pdf tests/output/information.txt tests/output/sampleMetadata.tsv tests/output/variableMetadata.tsv |
b |
diff -r 000000000000 -r ad06aeed02c9 LICENSE.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.md Tue Aug 02 06:26:41 2016 -0400 |
[ |
b'@@ -0,0 +1,517 @@\n+ CeCILL FREE SOFTWARE LICENSE AGREEMENT\n+\n+Version 2.1 dated 2013-06-21\n+\n+\n+ Notice\n+\n+This Agreement is a Free Software license agreement that is the result\n+of discussions between its authors in order to ensure compliance with\n+the two main principles guiding its drafting:\n+\n+ * firstly, compliance with the principles governing the distribution\n+ of Free Software: access to source code, broad rights granted to users,\n+ * secondly, the election of a governing law, French law, with which it\n+ is conformant, both as regards the law of torts and intellectual\n+ property law, and the protection that it offers to both authors and\n+ holders of the economic rights over software.\n+\n+The authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) \n+license are: \n+\n+Commissariat \xe0 l\'\xe9nergie atomique et aux \xe9nergies alternatives - CEA, a\n+public scientific, technical and industrial research establishment,\n+having its principal place of business at 25 rue Leblanc, immeuble Le\n+Ponant D, 75015 Paris, France.\n+\n+Centre National de la Recherche Scientifique - CNRS, a public scientific\n+and technological establishment, having its principal place of business\n+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.\n+\n+Institut National de Recherche en Informatique et en Automatique -\n+Inria, a public scientific and technological establishment, having its\n+principal place of business at Domaine de Voluceau, Rocquencourt, BP\n+105, 78153 Le Chesnay cedex, France.\n+\n+\n+ Preamble\n+\n+The purpose of this Free Software license agreement is to grant users\n+the right to modify and redistribute the software governed by this\n+license within the framework of an open source distribution model.\n+\n+The exercising of this right is conditional upon certain obligations for\n+users so as to preserve this status for all subsequent redistributions.\n+\n+In consideration of access to the source code and the rights to copy,\n+modify and redistribute granted by the license, users are provided only\n+with a limited warranty and the software\'s author, the holder of the\n+economic rights, and the successive licensors only have limited liability.\n+\n+In this respect, the risks associated with loading, using, modifying\n+and/or developing or reproducing the software by the user are brought to\n+the user\'s attention, given its Free Software status, which may make it\n+complicated to use, with the result that its use is reserved for\n+developers and experienced professionals having in-depth computer\n+knowledge. Users are therefore encouraged to load and test the\n+suitability of the software as regards their requirements in conditions\n+enabling the security of their systems and/or data to be ensured and,\n+more generally, to use and operate it in the same conditions of\n+security. This Agreement may be freely reproduced and published,\n+provided it is not altered, and that no provisions are either added or\n+removed herefrom.\n+\n+This Agreement may apply to any or all software for which the holder of\n+the economic rights decides to submit the use thereof to its provisions.\n+\n+Frequently asked questions can be found on the official website of the\n+CeCILL licenses family (http://www.cecill.info/index.en.html) for any \n+necessary clarification.\n+\n+\n+ Article 1 - DEFINITIONS\n+\n+For the purpose of this Agreement, when the following expressions\n+commence with a capital letter, they shall have the following meaning:\n+\n+Agreement: means this license agreement, and its possible subsequent\n+versions and annexes.\n+\n+Software: means the software in its Object Code and/or Source Code form\n+and, where applicable, its documentation, "as is" when the Licensee\n+accepts the Agreement.\n+\n+Initial Software: means the Software in its Source Code and possibly its\n+Object Code form and, where applicable, its documentation, "as is" when\n+it is first distributed under the terms and conditions of the Agreement.\n+\n+Modified Software: means the Software modified by at lea'..b"l be\n+decided on a case-by-case basis between the relevant Licensor and the\n+Licensee pursuant to a memorandum of understanding. The Licensor\n+disclaims any and all liability as regards the Licensee's use of the\n+name of the Software. No warranty is given as regards the existence of\n+prior rights over the name of the Software or as regards the existence\n+of a trademark.\n+\n+\n+ Article 10 - TERMINATION\n+\n+10.1 In the event of a breach by the Licensee of its obligations\n+hereunder, the Licensor may automatically terminate this Agreement\n+thirty (30) days after notice has been sent to the Licensee and has\n+remained ineffective.\n+\n+10.2 A Licensee whose Agreement is terminated shall no longer be\n+authorized to use, modify or distribute the Software. However, any\n+licenses that it may have granted prior to termination of the Agreement\n+shall remain valid subject to their having been granted in compliance\n+with the terms and conditions hereof.\n+\n+\n+ Article 11 - MISCELLANEOUS\n+\n+\n+ 11.1 EXCUSABLE EVENTS\n+\n+Neither Party shall be liable for any or all delay, or failure to\n+perform the Agreement, that may be attributable to an event of force\n+majeure, an act of God or an outside cause, such as defective\n+functioning or interruptions of the electricity or telecommunications\n+networks, network paralysis following a virus attack, intervention by\n+government authorities, natural disasters, water damage, earthquakes,\n+fire, explosions, strikes and labor unrest, war, etc.\n+\n+11.2 Any failure by either Party, on one or more occasions, to invoke\n+one or more of the provisions hereof, shall under no circumstances be\n+interpreted as being a waiver by the interested Party of its right to\n+invoke said provision(s) subsequently.\n+\n+11.3 The Agreement cancels and replaces any or all previous agreements,\n+whether written or oral, between the Parties and having the same\n+purpose, and constitutes the entirety of the agreement between said\n+Parties concerning said purpose. No supplement or modification to the\n+terms and conditions hereof shall be effective as between the Parties\n+unless it is made in writing and signed by their duly authorized\n+representatives.\n+\n+11.4 In the event that one or more of the provisions hereof were to\n+conflict with a current or future applicable act or legislative text,\n+said act or legislative text shall prevail, and the Parties shall make\n+the necessary amendments so as to comply with said act or legislative\n+text. All other provisions shall remain effective. Similarly, invalidity\n+of a provision of the Agreement, for any reason whatsoever, shall not\n+cause the Agreement as a whole to be invalid.\n+\n+\n+ 11.5 LANGUAGE\n+\n+The Agreement is drafted in both French and English and both versions\n+are deemed authentic.\n+\n+\n+ Article 12 - NEW VERSIONS OF THE AGREEMENT\n+\n+12.1 Any person is authorized to duplicate and distribute copies of this\n+Agreement.\n+\n+12.2 So as to ensure coherence, the wording of this Agreement is\n+protected and may only be modified by the authors of the License, who\n+reserve the right to periodically publish updates or new versions of the\n+Agreement, each with a separate number. These subsequent versions may\n+address new issues encountered by Free Software.\n+\n+12.3 Any Software distributed under a given version of the Agreement may\n+only be subsequently distributed under the same version of the Agreement\n+or a subsequent version, subject to the provisions of Article 5.3.4\n+<#compatibility>.\n+\n+\n+ Article 13 - GOVERNING LAW AND JURISDICTION\n+\n+13.1 The Agreement is governed by French law. The Parties agree to\n+endeavor to seek an amicable solution to any disagreements or disputes\n+that may arise during the performance of the Agreement.\n+\n+13.2 Failing an amicable solution within two (2) months as from their\n+occurrence, and unless emergency proceedings are necessary, the\n+disagreements or disputes shall be referred to the Paris Courts having\n+jurisdiction, by the more diligent Party.\n" |
b |
diff -r 000000000000 -r ad06aeed02c9 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Tue Aug 02 06:26:41 2016 -0400 |
[ |
@@ -0,0 +1,60 @@ +## Heatmap of the data matrix +#### A Galaxy module from the [Workflow4metabolomics](http://workflow4metabolomics.org) project + +Status: [![Build Status](https://travis-ci.org/workflow4metabolomics/heatmap.svg?branch=master)](https://travis-ci.org/workflow4metabolomics/heatmap). + +### Description + +**Version:** 2.2.0 +**Date:** 2016-07-30 +**Author:** Etienne A. Thevenot (CEA, LIST, MetaboHUB, W4M Core Development Team) +**Email:** [etienne.thevenot(at)cea.fr](mailto:etienne.thevenot@cea.fr) +**Citation:** Thevenot E.A., Roux A., Xu Y., Ezan E. and Junot C. (2015). Analysis of the human adult urinary metabolome variations with age, body mass index and gender by implementing a comprehensive workflow for univariate and OPLS statistical analyses. *Journal of Proteome Research*, **14**:3322-3335. [doi:10.1021/acs.jproteome.5b00354](http://dx.doi.org/10.1021/acs.jproteome.5b00354) +**Licence:** CeCILL +**Reference history:** [W4M00001a_sacurine-subset-statistics](http://galaxy.workflow4metabolomics.org/history/list_published) +**Funding:** Agence Nationale de la Recherche ([MetaboHUB](http://www.metabohub.fr/index.php?lang=en&Itemid=473) national infrastructure for metabolomics and fluxomics, ANR-11-INBS-0010 grant) + +### Installation + +* Configuration file: **heatmap_config.xml** +* Image files: + + **static/images/heatmap_workflowPositionImage.png** + + **static/images/heatmap_workingExampleImage.png** +* Wrapper file: **heatmap_wrapper.R** +* R packages + + **batch** from CRAN +> install.packages("batch", dep=TRUE) + +### Tests + +The code in the wrapper can be tested by running the **tests/heatmap_tests.R** in R + +### News + +##### CHANGES IN VERSION 2.2.0 + +NEW FEATURES + + o Default method for the correlation coefficient is now 'pearson', instead of 'spearman' previously (the latter can still be selected in the advanced parameters) + + o The 1-abs(correlation) dissimilarity is now available (in addition to the default '1-correlation') in case the sign of correlations between samples and between variables does not matter, as well as the euclidean, maximum, manhattan, canberra, binary, and minkowski dissimilarities + + o A new red-green color scale is available + +*** + +##### CHANGES IN VERSION 2.1.2 + +INTERNAL MODIFICATION + + o Creating additional files for planemo and travis validation + +*** + +##### CHANGES IN VERSION 2.0.2 + +INTERNAL MODIFICATION + + o Creating tests for R code + +*** \ No newline at end of file |
b |
diff -r 000000000000 -r ad06aeed02c9 build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build.xml Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,78 @@ +<project name="heatmap" default="all"> + + <property name="tool.xml" value="heatmap_config.xml"/> + <property name="conda.dir" value="${user.home}/w4m-conda"/> + + <!--~~~ + ~ ALL ~ + ~~~~~--> + + <target name="all"/> + + <!--~~~~ + ~ TEST ~ + ~~~~~--> + + <target name="test" depends="planemo.lint,planemo.test"/> + + <!--~~~~~~~~~~~~ + ~ PLANEMO LINT ~ + ~~~~~~~~~~~~~--> + + <target name="planemo.lint"> + <exec executable="planemo" failonerror="true"> + <arg value="lint"/> + <arg value="${tool.xml}"/> + </exec> + </target> + + <!--~~~~~~~~~~~~ + ~ PLANEMO TEST ~ + ~~~~~~~~~~~~~--> + + <target name="planemo.test" depends="planemo.conda.install"> + <exec executable="planemo" failonerror="true"> + <arg value="test"/> + <arg value="--conda_prefix"/> + <arg value="${conda.dir}"/> + <arg value="--galaxy_branch"/> + <arg value="release_16.01"/> + <arg value="--conda_dependency_resolution"/> + <arg value="${tool.xml}"/> + </exec> + </target> + + <!--~~~~~~~~~~~~~~~~~~~~~ + ~ PLANEMO CONDA INSTALL ~ + ~~~~~~~~~~~~~~~~~~~~~~--> + + <target name="planemo.conda.install" depends="planemo.conda.init"> + <exec executable="planemo" failonerror="true"> + <arg value="conda_install"/> + <arg value="--conda_prefix"/> + <arg value="${conda.dir}"/> + <arg value="${tool.xml}"/> + </exec> + </target> + + <!--~~~~~~~~~~~~~~~~~~ + ~ PLANEMO CONDA INIT ~ + ~~~~~~~~~~~~~~~~~~~--> + + <target name="planemo.conda.init"> + <exec executable="planemo" failonerror="true"> + <arg value="conda_init"/> + <arg value="--conda_prefix"/> + <arg value="${conda.dir}"/> + </exec> + </target> + + <!--~~~~~ + ~ CLEAN ~ + ~~~~~~--> + + <target name="clean"> + <delete dir="${conda.dir}"/> + </target> + +</project> |
b |
diff -r 000000000000 -r ad06aeed02c9 heatmap_config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/heatmap_config.xml Tue Aug 02 06:26:41 2016 -0400 |
[ |
b'@@ -0,0 +1,345 @@\n+<tool id="Heatmap" name="Heatmap" version="2.2.0">\n+ <description>Heatmap of the dataMatrix</description>\n+ \n+ <requirements>\n+ <requirement type="package" version="3.2.2">R</requirement>\n+ <requirement type="package">r-batch</requirement>\n+ </requirements>\n+ \n+ <command><![CDATA[\n+ Rscript $__tool_directory__/heatmap_wrapper.R\n+ dataMatrix_in "$dataMatrix_in"\n+ sampleMetadata_in "$sampleMetadata_in"\n+ variableMetadata_in "$variableMetadata_in"\n+ \n+ disC "$disC"\n+ cutSamN "$cutSamN"\n+ cutVarN "$cutVarN"\n+ \n+ #if $advPar.oppC == "full"\n+ corMetC "$advPar.corMetC"\n+ aggMetC "$advPar.aggMetC"\n+ colC "$advPar.colC"\n+ scaL "$advPar.scaL"\n+ cexN "$advPar.cexN"\n+ #end if\n+ \n+ dataMatrix_out "$dataMatrix_out"\n+ sampleMetadata_out "$sampleMetadata_out"\n+ variableMetadata_out "$variableMetadata_out"\n+ figure "$figure"\n+ information "$information"\n+ ]]></command>\n+ \n+ <inputs>\n+ <param name="dataMatrix_in" type="data" label="Data matrix file" help="" format="tabular" />\n+ <param name="sampleMetadata_in" type="data" label="Sample metadata file" help="" format="tabular" />\n+ <param name="variableMetadata_in" type="data" label="Variable metadata file" help="" format="tabular" />\n+ \n+ <param name="disC" label="Dissimilarity to be used for clustering" type="select" help="If correlation is selected, the pearson method will be used by default unless a specific method is selected in the advanced parameters below">\n+ <option value="euclidean">euclidean</option>\n+ <option value="maximum">maximum</option>\n+ <option value="manhattan">manhattan</option>\n+ <option value="canberra">canberra</option>\n+ <option value="binary">binary</option>\n+ <option value="minkowski">minkowski</option>\n+ <option value="1-cor" selected="true">1-correlation</option>\n+ <option value="1-abs(cor)">1-abs(correlation)</option>\n+ </param>\n+ \n+ <param name="cutSamN" label="Number of sample clusters to identify" type="select" help="">\n+ <option value="1" selected="true">1</option>\n+ <option value="2">2</option>\n+ <option value="3">3</option>\n+ <option value="4">4</option>\n+ <option value="5">5</option>\n+ <option value="6">6</option>\n+ <option value="7">7</option>\n+ <option value="8">8</option>\n+ <option value="9">9</option>\n+ <option value="10">10</option>\n+ <option value="11">11</option>\n+ <option value="12">12</option>\n+ <option value="13">13</option>\n+ <option value="14">14</option>\n+ <option value="15">15</option>\n+ </param>\n+ \n+ <param name="cutVarN" label="Number of variable clusters to identify" type="select" help="">\n+ <option value="1" selected="true">1</option>\n+ <option value="2">2</option>\n+ <option value="3">3</option>\n+ <option value="4">4</option>\n+ <option value="5">5</option>\n+ <option value="6">6</option>\n+ <option value="7">7</option>\n+ <option value="8">8</option>\n+ <option value="9">9</option>\n+ <option value="10">10</option>\n+ <option value="11">11</option>\n+ <option value="12">12</option>\n+ <option value="13">13</option>\n+ <option value="14">14</option>\n+ <option value="15">15</option>\t\t\t\n+ </param>\n+\t\t\n+ <conditional name="advPar">\n+ <param name="oppC" type="select" label="Advanced parameters" >\n+\t<option value="default" selected="true">Use default</option>\n+\t<option value="full">Full list</option>\n+ </param>\n+ <when value="default">\n+\t<param name="corMetC" type="hidden" value="pearson"/>\n+\t<param name="aggMetC" type="hidden" value="ward"/>\n+\t<param name="colC" type="hidden" value="blueOrangeRed"/>\n+ <param name="scaL" type="hidden" value="TRUE"/>\n+\t<param name="cexN" type="hidden" value="0.8"/>\n+ </when>\t\n+ <when value="full">\n+\t<param name="corMetC" label="Method of correlation to be used" type="select" help="">\n+\t <option value="pearson" s'..b' main page of Workflow4Metabolomics.org; formats of the three files can be further checked with the \'Check Data\' module (in the \'Quality Control\' section)\n+|\n+\n+----------\n+Parameters\n+----------\n+\n+Number of sample clusters\n+\t| By default (cluster = 1), only dendrograms are displayed; when a specific number of sample clusters is selected, the sample dendrogram is cut at the corresponding level: the sample groups are displayed on the dendrogram and a "heat_clust" column is added in the sampleMetadata file with the group of each sample\n+\t|\n+\t\n+Number of variable clusters\n+\t| Same as above for variables\n+\t|\n+\t\n+Standardization (Full list)\n+\t| By default, variables are standardized for display to enhance contrast of the heatmap (note that standardization is performed after the clustering for display only and does not modify cluster computation nor intensities in the output files)\n+\t| \n+\t\n+Size of labels (Full list)\n+\t| The size of sample and variable names on the heatmap is 0.8 (note that names with more than 14 characters are truncated); this number may be lowered (or uppered) in case of many (few) names to display\n+\n+\n+------------\n+Output files\n+------------\n+\n+dataMatrix_out.tabular\n+\t| dataMatrix file with rows and columns sorted according to the dendrogram\n+\t| \n+\n+sampleMetadata_out.tabular\n+\t| sampleMetadata file with rows sorted according to the sample dendrogram; in case a number of sample groups is specified, and additional "heat_clust" column is added with the cluster group of each sample\n+\t| \n+\t\n+variableMetadata_out.tabular\n+\t| variableMetadata file with rows sorted according to the variable dendrogram; in case a number of variable groups is specified, and additional "heat_clust" column is added with the cluster group of each variable\n+\t| \n+\n+figure.pdf\n+\t| Heatmap\n+\t| \t\n+\n+information.txt\n+\t| File with all messages and warnings generated during the computation\n+\t|\n+\t\n+---------------------------------------------------\n+\n+---------------\n+Working example\n+---------------\n+\n+.. class:: infomark\n+\n+See the **W4M00001a_sacurine-subset-statistics** shared history in the **Shared Data/Published Histories** menu\n+\n+---------------------------------------------------\n+\n+----\n+NEWS\n+----\n+\n+CHANGES IN VERSION 2.2.0\n+========================\n+\n+NEW FEATURES\n+\n+Default method for the correlation coefficient is now \'pearson\', instead of \'spearman\' previously (the latter can still be selected in the advanced parameters)\n+\n+The 1-abs(correlation) dissimilarity is now available (in addition to the default \'1-correlation\') in case the sign of correlations between samples and between variables does not matter, as well as the euclidean, maximum, manhattan, canberra, binary, and minkowski dissimilarities\n+\n+A new red-green color scale is available\n+\n+\n+CHANGES IN VERSION 2.1.2\n+========================\n+\n+INTERNAL MODIFICATIONS\n+\n+Creating additional files for planemo and travis running and installation validation\n+\n+CHANGES IN VERSION 2.1.1\n+========================\n+\n+Internal replacement of the as.hclust function which happened to produce error messages\n+\n+ </help>\n+ \n+ <citations>\n+ <citation type="bibtex">@Article{Thevenot2015,\n+ Title = {Analysis of the human adult urinary metabolome variations with age, body mass index and gender by implementing a comprehensive workflow for univariate and OPLS statistical analyses},\n+ Author = {Thevenot, Etienne A. and Roux, Aurelie and Xu, Ying and Ezan, Eric and Junot, Christophe},\n+ Journal = {Journal of Proteome Research},\n+ Year = {2015},\n+ Note = {PMID: 26088811},\n+ Number = {8},\n+ Pages = {3322-3335},\n+ Volume = {14},\n+ \n+ Doi = {10.1021/acs.jproteome.5b00354},\n+ Url = {http://pubs.acs.org/doi/full/10.1021/acs.jproteome.5b00354}\n+ }</citation> \n+ </citations>\n+ \n+</tool>\n' |
b |
diff -r 000000000000 -r ad06aeed02c9 heatmap_script.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/heatmap_script.R Tue Aug 02 06:26:41 2016 -0400 |
[ |
@@ -0,0 +1,258 @@ +## Etienne Thevenot +## CEA, MetaboHUB +## W4M Core Development Team +## etienne.thevenot@cea.fr +## 2015-05-30 + + +heatmapF <- function(proMN, + obsDF, + feaDF, + disC, ## dissimilarity + cutSamN, ## number of sample clusters + cutVarN, ## number of variable clusters + fig.pdfC, + corMetC, ## correlation method + aggMetC, ## agglomeration method + colC, ## color scale + scaL, + cexN) { + + ncaN <- 14 ## Sample and variable name truncature for display + + if(aggMetC == "ward") { + + rvsLs <- R.Version() + aggMetC <- paste0(aggMetC, + ifelse(as.numeric(rvsLs[["major"]]) > 3 || + as.numeric(rvsLs[["major"]]) == 3 && as.numeric(rvsLs[["minor"]]) > 0.3, + ".D", + "")) + + } + + if(disC %in% c("euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski")) { + + obsHcl <- hclust(dist(proMN, method = disC), + method = aggMetC) + + feaHcl <- hclust(dist(t(proMN), method = disC), + method = aggMetC) + + } else if(disC == "1-cor") { + + obsHcl <- hclust(as.dist(1-cor(t(proMN), + method = corMetC, + use = "pairwise.complete.obs")), + method = aggMetC) + + feaHcl <- hclust(as.dist(1-cor(proMN, + method = corMetC, + use = "pairwise.complete.obs")), + method = aggMetC) + + } else if(disC == "1-abs(cor)") { + + obsHcl <- hclust(as.dist(1-abs(cor(t(proMN), + method = corMetC, + use = "pairwise.complete.obs"))), + method = aggMetC) + + feaHcl <- hclust(as.dist(1-abs(cor(proMN, + method = corMetC, + use = "pairwise.complete.obs"))), + method = aggMetC) + + } + + heaMN <- proMN <- proMN[obsHcl[["order"]], feaHcl[["order"]]] + + if(scaL) + heaMN <- scale(heaMN) + + heaMN <- heaMN[, rev(1:ncol(heaMN)), drop = FALSE] + + switch(colC, + blueOrangeRed = { + imaPalVn <- colorRampPalette(c("blue", "orange", "red"), + space = "rgb")(5)[1:5] + }, + redBlackGreen = { + imaPalVn <- colorRampPalette(c("red", "black", "green"), + space = "rgb")(5)[1:5] + }) + + + ## figure + ##------- + + pdf(fig.pdfC, + width = 14, + height = 14) + + layout(matrix(1:4, nrow = 2), + widths = c(1, 9), heights = c(1, 9)) + + ## Color scale + + scaN <- length(imaPalVn) + + par(mar = c(0.6, 0.6, 0.6, 4.1)) + + ylimVn <- c(0, scaN) + ybottomVn <- 0:(scaN - 1) + ytopVn <- 1:scaN + + plot(x = 0, + y = 0, + bty = "n", + font.axis = 2, + font.lab = 2, + type = "n", + xlim = c(0, 1), + ylim = ylimVn, + xlab = "", + ylab = "", + xaxs = "i", + yaxs = "i", + xaxt = "n", + yaxt = "n") + + rect(xleft = 0.8, + ybottom = ybottomVn, + xright = 1, + ytop = ytopVn, + col = imaPalVn, + border = NA) + + prtVn <- pretty(range(heaMN, na.rm = TRUE)) + axis(at = scaN / diff(range(prtVn)) * (prtVn - min(prtVn)), + font = 2, + font.axis = 2, + labels = prtVn, + las = 1, + lwd = 2, + lwd.ticks = 2, + side = 4, + xpd = TRUE) + + arrows(par("usr")[2], + par("usr")[4], + par("usr")[2], + par("usr")[3], + code = 0, + lwd = 2, + xpd = TRUE) + + ## Feature dendrogram + + par(mar = c(7.1, 0.6, 0, 0.1), + lwd = 2) + + plot(rev(as.dendrogram(feaHcl)), horiz = TRUE, + leaflab = "none", + main = "", xaxs = "i", yaxs = "i", + xaxt = "n", yaxt = "n", xlab = "", ylab = "") + + revFeaHcl <- list(merge = cbind(feaHcl[["merge"]][, 2], feaHcl[["merge"]][, 1]), + height = feaHcl[["height"]], + order = rev(feaHcl[["order"]]), + labels = feaHcl[["labels"]]) + + if(cutVarN > 1) { + cluFeaVn <- cutree(revFeaHcl, k = cutVarN)[revFeaHcl[["order"]]] + cutFeaVn <- which(abs(diff(cluFeaVn)) > 0) + cutFeaTxtVn <- c(cutFeaVn[1] / 2, cutFeaVn + diff(c(cutFeaVn, length(cluFeaVn))) / 2) + 0.5 + cutFeaLinVn <- cutFeaVn + 0.5 + text(par("usr")[1] + 0.2 * diff(par("usr")[1:2]), + cutFeaTxtVn, + labels = unique(cluFeaVn), + cex = 2, + font = 2, + las = 2) + } + + ## Observation dendrogram + + par(mar = c(0.1, 0, 0.6, 7.1), + lwd = 2) + + plot(as.dendrogram(obsHcl), leaflab = "none", + main = "", xaxs = "i", yaxs = "i", + yaxt = "n", xlab = "", ylab = "") + + if(cutSamN > 1) { + cluObsVn <- cutree(obsHcl, k = cutSamN)[obsHcl[["order"]]] + cutObsVn <- which(abs(diff(cluObsVn)) > 0) + cutObsTxtVn <- c(cutObsVn[1] / 2, cutObsVn + diff(c(cutObsVn, length(cluObsVn))) / 2) + 0.5 + cutObsLinVn <- cutObsVn + 0.5 + text(cutObsTxtVn, + 0.8 * par("usr")[4], + labels = unique(cluObsVn), + cex = 2, + font = 2) + } + + ## Heatmap + + par(mar = c(7.1, 0, 0, 7.1)) + + image(x = 1:nrow(heaMN), + y = 1:ncol(heaMN), + z = round(heaMN), + col = imaPalVn, + font.axis = 2, + font.lab = 2, + xaxt = "n", + yaxt = "n", + xlab = "", + ylab = "") + + obsOrdVc <- obsHcl[["labels"]][obsHcl[["order"]]] + obsOrdLenVn <- sapply(obsOrdVc, nchar) + obsOrdVc <- substr(obsOrdVc, 1, ncaN) + obsOrdVc <- paste0(obsOrdVc, ifelse(obsOrdLenVn > ncaN, ".", ""), " ") + + mtext(obsOrdVc, + at = 1:nrow(heaMN), + cex = cexN, + las = 2, + side = 1) + + feaOrdVc <- feaHcl[["labels"]][feaHcl[["order"]]] + feaOrdLenVn <- sapply(feaOrdVc, nchar) + feaOrdVc <- substr(feaOrdVc, 1, ncaN) + feaOrdVc <- paste0(" ", feaOrdVc, ifelse(feaOrdLenVn > ncaN, ".", "")) + + mtext(feaOrdVc, + at = ncol(heaMN):1, + cex = cexN, + las = 2, + side = 4) + + if(cutVarN > 1) + abline(h = cutFeaLinVn) + if(cutSamN > 1) + abline(v = cutObsLinVn) + + box() + + dev.off() + + ## Returning + ##---------- + + if(cutSamN > 1) + obsDF[, "heat_clust"] <- cutree(obsHcl, k = cutSamN) + obsDF <- obsDF[obsHcl[["order"]], , drop = FALSE] + + if(cutVarN > 1) + feaDF[, "heat_clust"] <- cutree(feaHcl, k = cutVarN) + feaDF <- feaDF[feaHcl[["order"]], , drop = FALSE] + + return(invisible(list(proMN = proMN, + obsDF = obsDF, + feaDF = feaDF))) + + +} ## end of heatmapF |
b |
diff -r 000000000000 -r ad06aeed02c9 heatmap_wrapper.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/heatmap_wrapper.R Tue Aug 02 06:26:41 2016 -0400 |
[ |
@@ -0,0 +1,156 @@ +#!/usr/bin/env Rscript + +library(batch) ## parseCommandArgs + +source_local <- function(fname){ + argv <- commandArgs(trailingOnly = FALSE) + base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) + source(paste(base_dir, fname, sep="/")) +} + +source_local("heatmap_script.R") + +argVc <- unlist(parseCommandArgs(evaluate=FALSE)) + + +##------------------------------ +## Initializing +##------------------------------ + +## options +##-------- + +strAsFacL <- options()[["stringsAsFactors"]] +options(stringsAsFactors=FALSE) + +## constants +##---------- + +modNamC <- "Heatmap" ## module name + +## log file +##--------- + +sink(argVc["information"]) + +cat("\nStart of the '", modNamC, "' module: ", + format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="") + +## loading +##-------- + +proMN <- t(as.matrix(read.table(argVc["dataMatrix_in"], + check.names = FALSE, + header = TRUE, + row.names = 1, + sep = "\t"))) + +obsDF <- read.table(argVc["sampleMetadata_in"], + check.names = FALSE, + header = TRUE, + row.names = 1, + sep = "\t") + +feaDF <- read.table(argVc["variableMetadata_in"], + check.names = FALSE, + header = TRUE, + row.names = 1, + sep = "\t") + +## adding default parameter values +##-------------------------------- + + +if(!("corMetC" %in% names(argVc))) + argVc["corMetC"] <- "pearson" +if(!("aggMetC" %in% names(argVc))) + argVc["aggMetC"] <- "ward" +if(!("colC" %in% names(argVc))) + argVc["colC"] <- "blueOrangeRed" +if(!("scaL" %in% names(argVc))) + argVc["scaL"] <- "TRUE" +if(!("cexN" %in% names(argVc))) + argVc["cexN"] <- "0.8" + +## checking +##--------- + +if(as.numeric(argVc["cutSamN"]) > nrow(proMN)) + stop("Number of sample clusters must be inferior to the number of samples") +if(as.numeric(argVc["cutVarN"]) > ncol(proMN)) + stop("Number of variable clusters must be inferior to the number of variables") + +## printing arguments +##------------------- + +cat("\nArguments used:\n\n") +argMC <- as.matrix(argVc) +colnames(argMC) <- "value" +argDatVl <- grepl("\\.dat$", argVc) ## discarding dataset file names +if(sum(argDatVl)) + argMC <- argMC[!argDatVl, , drop = FALSE] +print(argMC) + + +##------------------------------ +## Computation +##------------------------------ + + +heaLs <- heatmapF(proMN = proMN, + obsDF = obsDF, + feaDF = feaDF, + disC = argVc["disC"], + cutSamN = as.numeric(argVc["cutSamN"]), + cutVarN = as.numeric(argVc["cutVarN"]), + fig.pdfC = argVc["figure"], + corMetC = argVc["corMetC"], + aggMetC = argVc["aggMetC"], + colC = argVc["colC"], + scaL = as.logical(argVc["scaL"]), + cexN = as.numeric(argVc["cexN"])) + + +##------------------------------ +## Ending +##------------------------------ + + +## saving +##------- + +proDF <- cbind.data.frame(dataMatrix = colnames(heaLs[["proMN"]]), + as.data.frame(t(heaLs[["proMN"]]))) +write.table(proDF, + file = argVc["dataMatrix_out"], + quote = FALSE, + row.names = FALSE, + sep = "\t") + +obsDF <- cbind.data.frame(sampleMetadata = rownames(heaLs[["obsDF"]]), + heaLs[["obsDF"]]) +write.table(obsDF, + file = argVc["sampleMetadata_out"], + quote = FALSE, + row.names = FALSE, + sep = "\t") + +feaDF <- cbind.data.frame(variableMetadata = rownames(heaLs[["feaDF"]]), + heaLs[["feaDF"]]) +write.table(feaDF, + file = argVc["variableMetadata_out"], + quote = FALSE, + row.names = FALSE, + sep = "\t") + +## Ending +##------- + +cat("\nEnd of the '", modNamC, "' Galaxy module call: ", + format(Sys.time(), "%a %d %b %Y %X"), "\n", sep = "") + +sink() + +options(stringsAsFactors = strAsFacL) + +rm(list = ls()) |
b |
diff -r 000000000000 -r ad06aeed02c9 static/images/heatmap_workflowPositionImage.png |
b |
Binary file static/images/heatmap_workflowPositionImage.png has changed |
b |
diff -r 000000000000 -r ad06aeed02c9 static/images/heatmap_workingExampleImage.png |
b |
Binary file static/images/heatmap_workingExampleImage.png has changed |
b |
diff -r 000000000000 -r ad06aeed02c9 test-data/input-dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/input-dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +dataMatrix HU_017 HU_028 HU_034 HU_051 HU_060 HU_078 HU_091 HU_093 HU_099 HU_110 HU_130 HU_134 HU_138 HU_149 HU_152 HU_175 HU_178 HU_185 HU_204 HU_208 +HMDB03193 76043 412165 44943 27242 436566 173175 242549 57066 559869 3732 339188 471368 262271 127285 451270 212500 79673 NA 891129 43907 +HMDB01101 30689 6877586 52217 3158 10789748 229568 4763576 3878773 976436 831937 608298 1605075 72021 442510 1107705 1464339 31250 2724553 72900 32742 +HMDB10348 47259 544877 60885 34582 529874 168264 176500 76457 610110 16262 279156 524468 451573 591487 433529 161069 214392 13781 1580343 39315 +HMDB59717 357351 1030464 301983 67604 306862 1028110 1530493 270027 1378535 289677 808334 1132813 871209 895435 715190 1563158 784738 146195 994336 239030 +HMDB00822 483755 579287 1132413 157113 1577570 1469735 1085454 477909 814755 245417 610681 763706 2406336 827531 992508 569605 355321 150259 1334200 271010 +HMDB13189 2644620 727587 1661412 619181 136278 2755434 593863 837865 3526136 2003278 1608814 3446611 1941527 113937 3132404 2893445 2092753 1034666 1517319 841661 +HMDB00299 250551 1046138 456162 159386 1013302 808657 614370 250403 768004 242085 504108 1014041 1362408 1057660 1110050 566050 411886 142233 1992420 284775 +HMDB00191 560002 771533 575790 392284 888498 785428 645785 591569 960658 910201 639437 1092885 1409045 2292023 1246459 1945577 710519 773384 1061418 622898 +HMDB00518 34236 58249 85944 NA 342102 129886 175800 13154 230242 NA 440223 315368 10657 419508 48673 28361 514579 23108 867108 73831 +HMDB00715 1252089 2547452 905408 371059 4983588 5140022 2658555 814523 2558923 859466 4184204 3865723 3236644 2615560 3820724 3577833 2295288 625924 7517724 1341900 +HMDB01032 2569205 26023086 1604999 430453 8103558 26222916 257139 675754 59906109 263055 31151730 18648127 14989438 1554658 20249262 5588731 871010 15920 9120781 44276 +HMDB00208 747080 13420742 595872 1172376 7172632 3143654 4059767 1433702 5593888 5402629 2477288 3346077 4230072 7621236 8960828 10335722 7037373 1574738 3359238 2540044 +HMDB04824 374028 1144386 539206 178517 1046190 959381 605191 310260 1253319 477259 477995 825691 1157093 1089284 1411802 1020206 782673 346761 1824553 387811 +HMDB00512 53304 319783 280560 85009 1333877 556003 590779 209285 342532 198512 569970 525240 246282 1140422 542345 1171008 827723 222953 438839 85554 +HMDB00251 368600 616555 94936 622468 180988 293988 352855 767894 268331 167246 310918 1248919 577184 10985 335711 403815 80614 63393 454489 616061 |
b |
diff -r 000000000000 -r ad06aeed02c9 test-data/input-sampleMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/input-sampleMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,21 @@ +sampleMetadata injectionOrder mode age bmi gender +HU_017 2 pos 41 23.03 M +HU_028 7 pos 41 23.92 F +HU_034 9 pos 52 23.37 M +HU_051 20 pos 24 23.23 F +HU_060 24 pos 55 28.72 F +HU_078 34 pos 46 25.18 M +HU_091 42 pos 61 26.12 M +HU_093 43 pos 53 21.71 M +HU_099 46 pos 23 21.3 M +HU_110 53 pos 50 20.9 F +HU_130 63 pos 33 26.06 M +HU_134 67 pos 48 22.89 M +HU_138 68 pos 42 21.88 M +HU_149 72 pos 35 19.49 F +HU_152 75 pos 26 17.58 F +HU_175 87 pos 35 21.26 F +HU_178 88 pos 60 32.87 F +HU_185 95 pos 42 21.09 F +HU_204 104 pos 31 29.06 M +HU_208 106 pos 27 18.61 F |
b |
diff -r 000000000000 -r ad06aeed02c9 test-data/input-variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/input-variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +variableMetadata name +HMDB03193 Testosterone_glucuronide +HMDB01101 p-Anisic_acid +HMDB10348 Dehydroepiandrosterone_3-glucuronide +HMDB59717 Glu-Val +HMDB00822 p-Hydroxymandelic_acid +HMDB13189 3-Indole_carboxylic_acid_glucuronide +HMDB00299 Xanthosine +HMDB00191 L-Aspartic_acid +HMDB00518 Chenodeoxycholic_acid +HMDB00715 Kynurenic_acid +HMDB01032 Dehydroepiandrosterone_sulfate +HMDB00208 Oxoglutaric_acid +HMDB04824 N2,N2-Dimethylguanosine +HMDB00512 N-Acetyl-L-phenylalanine +HMDB00251 Taurine |
b |
diff -r 000000000000 -r ad06aeed02c9 test-data/output-dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output-dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +dataMatrix HU_051 HU_208 HU_178 HU_130 HU_175 HU_099 HU_152 HU_204 HU_017 HU_138 HU_034 HU_078 HU_060 HU_149 HU_028 HU_093 HU_134 HU_091 HU_110 HU_185 +HMDB13189 619181 841661 2092753 1608814 2893445 3526136 3132404 1517319 2644620 1941527 1661412 2755434 136278 113937 727587 837865 3446611 593863 2003278 1034666 +HMDB00251 622468 616061 80614 310918 403815 268331 335711 454489 368600 577184 94936 293988 180988 10985 616555 767894 1248919 352855 167246 63393 +HMDB01101 3158 32742 31250 608298 1464339 976436 1107705 72900 30689 72021 52217 229568 10789748 442510 6877586 3878773 1605075 4763576 831937 2724553 +HMDB00191 392284 622898 710519 639437 1945577 960658 1246459 1061418 560002 1409045 575790 785428 888498 2292023 771533 591569 1092885 645785 910201 773384 +HMDB00208 1172376 2540044 7037373 2477288 10335722 5593888 8960828 3359238 747080 4230072 595872 3143654 7172632 7621236 13420742 1433702 3346077 4059767 5402629 1574738 +HMDB59717 67604 239030 784738 808334 1563158 1378535 715190 994336 357351 871209 301983 1028110 306862 895435 1030464 270027 1132813 1530493 289677 146195 +HMDB00512 85009 85554 827723 569970 1171008 342532 542345 438839 53304 246282 280560 556003 1333877 1140422 319783 209285 525240 590779 198512 222953 +HMDB00518 NA 73831 514579 440223 28361 230242 48673 867108 34236 10657 85944 129886 342102 419508 58249 13154 315368 175800 NA 23108 +HMDB00822 157113 271010 355321 610681 569605 814755 992508 1334200 483755 2406336 1132413 1469735 1577570 827531 579287 477909 763706 1085454 245417 150259 +HMDB00715 371059 1341900 2295288 4184204 3577833 2558923 3820724 7517724 1252089 3236644 905408 5140022 4983588 2615560 2547452 814523 3865723 2658555 859466 625924 +HMDB01032 430453 44276 871010 31151730 5588731 59906109 20249262 9120781 2569205 14989438 1604999 26222916 8103558 1554658 26023086 675754 18648127 257139 263055 15920 +HMDB00299 159386 284775 411886 504108 566050 768004 1110050 1992420 250551 1362408 456162 808657 1013302 1057660 1046138 250403 1014041 614370 242085 142233 +HMDB04824 178517 387811 782673 477995 1020206 1253319 1411802 1824553 374028 1157093 539206 959381 1046190 1089284 1144386 310260 825691 605191 477259 346761 +HMDB03193 27242 43907 79673 339188 212500 559869 451270 891129 76043 262271 44943 173175 436566 127285 412165 57066 471368 242549 3732 NA +HMDB10348 34582 39315 214392 279156 161069 610110 433529 1580343 47259 451573 60885 168264 529874 591487 544877 76457 524468 176500 16262 13781 |
b |
diff -r 000000000000 -r ad06aeed02c9 test-data/output-variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/output-variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +variableMetadata name heat_clust +HMDB13189 3-Indole_carboxylic_acid_glucuronide 3 +HMDB00251 Taurine 3 +HMDB01101 p-Anisic_acid 2 +HMDB00191 L-Aspartic_acid 2 +HMDB00208 Oxoglutaric_acid 2 +HMDB59717 Glu-Val 2 +HMDB00512 N-Acetyl-L-phenylalanine 2 +HMDB00518 Chenodeoxycholic_acid 1 +HMDB00822 p-Hydroxymandelic_acid 1 +HMDB00715 Kynurenic_acid 1 +HMDB01032 Dehydroepiandrosterone_sulfate 1 +HMDB00299 Xanthosine 1 +HMDB04824 N2,N2-Dimethylguanosine 1 +HMDB03193 Testosterone_glucuronide 1 +HMDB10348 Dehydroepiandrosterone_3-glucuronide 1 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa1/dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa1/dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,39 @@ +dataMatrix S1 S2 S3 S4 S5 S6 +V1 196502 237810 198284 182894 105331 132150 +V2 2544571 2614302 2451909 3142179 3768416 3713752 +V3 1230784 1161975 1143745 1150915 1344578 1220503 +V4 1630089 1818363 1563465 2387030 3502620 2954208 +V5 2184963 2374515 1974647 2313226 1782744 1860757 +V6 5262172 6365930 5010369 9109487 6410977 6378638 +V7 2232587 2745906 2200995 3832216 2708070 2869295 +V8 483320 660332 433486 1062013 677822 748514 +V9 112905 136174 123604 162138 240686 195271 +V10 179154 195001 180519 98623 132470 123032 +V11 175220 169515 158401 111215 103539 159727 +V12 46503 55313 76310 46932 92318 43629 +V13 113796 91557 95960 92685 140973 112898 +V14 540798 596737 511783 876548 1626199 1385367 +V15 140806 135469 145016 229518 434119 398941 +V16 1334798 1318651 1308783 2345055 4068874 3565724 +V17 1083792 1145232 916864 838363 1678307 1304234 +V18 91671 101007 79999 85402 146939 126314 +V19 274181 282331 292645 394175 330817 293481 +V20 879658 809068 903330 1273966 959314 938277 +V21 608434 662366 727426 920178 1106194 1201520 +V22 1600960 1545158 1608816 1880288 2246189 2069613 +V23 2171614 2239769 2106004 2565354 4913676 4072322 +V24 4045143 3862213 4053630 7352540 5574415 6185035 +V25 202805 182042 165499 57267 86611 89320 +V26 586997 667911 522193 748212 595063 659353 +V27 229790 256287 253497 1189248 1025521 746948 +V28 1644853 1759382 1760494 3379214 4572430 4386799 +V29 8491372 9275641 8655578 12105700 13265172 13484917 +V30 724039 730730 640992 1475658 1191085 1213210 +V31 86524840 89500400 88593487 183705591 150949959 169189091 +V32 26916143 30167854 28256416 39049936 45546213 47237473 +V33 2683733 2654918 2386486 4786536 3622659 3879731 +V34 3919797 4529379 3595989 7965534 5963667 6339219 +V35 84384696 90691983 83322980 51888441 86013709 79735533 +V36 95751916 101056674 92760886 129551865 109580811 118980909 +V37 374328 416298 355931 255675 371223 338701 +V38 2219529 2333885 2206832 903780 981633 1136522 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa1/sampleMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa1/sampleMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,7 @@ +sampleMetadata smeta1 smeta2 +S1 196502 2544571 +S2 237810 2614302 +S3 198284 2451909 +S4 182894 3142179 +S5 105331 3768416 +S6 132150 3713752 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa1/variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa1/variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,39 @@ +variableMetadata vmeta1 vmeta2 vmeta3 vmeta4 vmeta5 vmeta6 +V1 196502 237810 198284 182894 105331 132150 +V2 2544571 2614302 2451909 3142179 3768416 3713752 +V3 1230784 1161975 1143745 1150915 1344578 1220503 +V4 1630089 1818363 1563465 2387030 3502620 2954208 +V5 2184963 2374515 1974647 2313226 1782744 1860757 +V6 5262172 6365930 5010369 9109487 6410977 6378638 +V7 2232587 2745906 2200995 3832216 2708070 2869295 +V8 483320 660332 433486 1062013 677822 748514 +V9 112905 136174 123604 162138 240686 195271 +V10 179154 195001 180519 98623 132470 123032 +V11 175220 169515 158401 111215 103539 159727 +V12 46503 55313 76310 46932 92318 43629 +V13 113796 91557 95960 92685 140973 112898 +V14 540798 596737 511783 876548 1626199 1385367 +V15 140806 135469 145016 229518 434119 398941 +V16 1334798 1318651 1308783 2345055 4068874 3565724 +V17 1083792 1145232 916864 838363 1678307 1304234 +V18 91671 101007 79999 85402 146939 126314 +V19 274181 282331 292645 394175 330817 293481 +V20 879658 809068 903330 1273966 959314 938277 +V21 608434 662366 727426 920178 1106194 1201520 +V22 1600960 1545158 1608816 1880288 2246189 2069613 +V23 2171614 2239769 2106004 2565354 4913676 4072322 +V24 4045143 3862213 4053630 7352540 5574415 6185035 +V25 202805 182042 165499 57267 86611 89320 +V26 586997 667911 522193 748212 595063 659353 +V27 229790 256287 253497 1189248 1025521 746948 +V28 1644853 1759382 1760494 3379214 4572430 4386799 +V29 8491372 9275641 8655578 12105700 13265172 13484917 +V30 724039 730730 640992 1475658 1191085 1213210 +V31 86524840 89500400 88593487 183705591 150949959 169189091 +V32 26916143 30167854 28256416 39049936 45546213 47237473 +V33 2683733 2654918 2386486 4786536 3622659 3879731 +V34 3919797 4529379 3595989 7965534 5963667 6339219 +V35 84384696 90691983 83322980 51888441 86013709 79735533 +V36 95751916 101056674 92760886 129551865 109580811 118980909 +V37 374328 416298 355931 255675 371223 338701 +V38 2219529 2333885 2206832 903780 981633 1136522 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa2/dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa2/dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
b'@@ -0,0 +1,117 @@\n+dataMatrix\tS1\tS2\tS3\tS4\tS5\tS6\tS7\tS8\tS9\tS10\tS11\tS12\tS13\tS14\tS15\tS16\tS17\tS18\tS19\tS20\tS21\tS22\tS23\tS24\tS25\tS26\tS27\tS28\n+V1\t1484.78\t1106.3\t1217.84\t1441.38\t1213.63\t1302.49\t1412.79\t1322.28\t1258.89\t1365.49\t1146.78\t1243\t1242.47\t1250.61\t1307.52\t1423.59\t1290.51\t1126.64\t1421.23\t1235.75\t1084.56\t1252.87\t1254.74\t1584.64\t1474.43\t1283.85\t1347.74\t1557.35\n+V2\t0\t0\t0\t13.14\t0\t0\t0\t16.36\t0\t0\t11.8\t0\t0\t0\t0\t12.34\t12.45\t0\t0\t6.87\t6.41\t0\t15.53\t12.87\t0\t14.58\t0\t0\n+V3\t0\t5.93\t7.82\t16.41\t7.58\t9.54\t8.25\t20.52\t5.89\t6.27\t20.86\t5.2\t8.97\t10.93\t6.51\t21.06\t25.05\t0\t0\t11.79\t16.97\t7.23\t19.58\t20.56\t11.07\t20.87\t0\t6.18\n+V4\t10.86\t12.56\t7.93\t14.32\t10.64\t11.38\t8.24\t15.8\t11.75\t11.29\t12\t6.34\t8.05\t16.12\t13.33\t18.81\t24.44\t8.26\t6.99\t9.76\t10.29\t9.11\t19.32\t26.55\t15.58\t17.38\t3.31\t7.2\n+V5\t9.49\t5.72\t6.96\t5.48\t6.38\t9.57\t6.31\t8.67\t8.21\t9.1\t9.23\t9.68\t7.1\t6.89\t4.39\t7.98\t11.58\t7.71\t10.99\t8.67\t13.18\t7.19\t10.96\t5.86\t7.98\t10.39\t4.69\t11.78\n+V6\t43.5\t19.95\t34.96\t31.98\t31.27\t49.9\t38.17\t26.44\t27.19\t40.64\t40.9\t47\t26.26\t30.31\t20.64\t49.54\t49.06\t26.73\t64.56\t43.29\t80.61\t38.08\t42.01\t37.22\t26.37\t25.97\t25.2\t41.05\n+V7\t333.79\t311.77\t321.24\t391.51\t297.03\t263.85\t246.39\t221.76\t447.49\t418.79\t300.37\t414.43\t262.68\t244.09\t213.24\t423.97\t523.16\t344.76\t413.98\t402.45\t251.38\t225.47\t300.48\t230.58\t301.51\t246.9\t361.04\t375.51\n+V8\t49.48\t20.81\t27.33\t17.44\t15.39\t14.84\t17.67\t13.41\t29.27\t63.13\t34.04\t23.41\t25.16\t16.2\t11.68\t42.53\t31.46\t12.83\t38.02\t40.28\t25.77\t12.44\t41.05\t15.25\t23.21\t27.11\t25.98\t22.33\n+V9\t2.56\t1.18\t1.07\t1.39\t2.59\t2.53\t1.98\t3.84\t1.61\t1.72\t1.76\t1.73\t0.63\t2.13\t2.02\t2.44\t0\t1.24\t1.22\t1.87\t7.83\t4.15\t5.88\t4.77\t5.77\t7.81\t0\t1.67\n+V10\t6.37\t4.55\t2.63\t5.09\t6.29\t6.32\t6.31\t6.61\t4.35\t5.98\t4.79\t6.3\t1.24\t6.98\t5.09\t6.64\t7.21\t3.63\t4.14\t5.47\t19.45\t8.4\t9.41\t10.83\t10.78\t11.98\t1.29\t3.86\n+V11\t11.9\t21.21\t10.67\t19.08\t17.84\t10.64\t13.61\t10.41\t17.75\t17.87\t13.24\t15.27\t7.83\t18.66\t13.5\t18.67\t26.37\t14.46\t13.18\t18.29\t26.21\t10.65\t16.46\t21.52\t19.57\t17.89\t8.81\t10.4\n+V12\t4.38\t8.56\t4.95\t8.83\t5.87\t3.53\t5.15\t0.45\t7.67\t5.85\t5.32\t4.88\t4.55\t5.87\t5.12\t6.16\t10.97\t6.67\t4.69\t6.11\t7.33\t3.34\t5.44\t8.94\t5.83\t5.07\t5.77\t3.8\n+V13\t0.78\t1.17\t0.61\t1.21\t0.89\t0\t0.56\t0.45\t1.04\t1.03\t0\t0.71\t0.62\t0.78\t0\t1.25\t0\t0.63\t1.1\t1.16\t1.13\t0\t0.87\t1.05\t1.06\t0.63\t0.36\t0.82\n+V14\t1511.11\t1158.59\t1529.32\t1471.39\t1654.17\t2320.94\t2630.11\t2148.49\t1248.21\t1590.03\t1120.83\t1388.4\t1523.12\t2293.02\t0\t1566.36\t1543.42\t842.31\t1421.66\t1850.9\t2870.84\t2338.83\t1979.28\t3581.78\t1757.49\t2983.66\t2967.62\t1392.97\n+V15\t638.35\t560.78\t803.6\t597.71\t719.25\t805.09\t773.49\t777.4\t566.6\t780.02\t607.71\t493.24\t655.73\t880.88\t0\t768.64\t625.98\t451.52\t443.79\t745.64\t692.9\t839.58\t727.49\t1376.26\t622.72\t1421.07\t997.77\t827.06\n+V16\t165.37\t51.55\t130.59\t57.95\t98.46\t310.56\t233.32\t147.43\t39.69\t109.04\t0\t101.57\t0\t97.94\t0\t107.15\t90.92\t0\t177.32\t137.54\t432.77\t267.66\t128.29\t331.03\t144.05\t118.52\t162.61\t64.33\n+V17\t1586.23\t2103.69\t1926.52\t1614.01\t2166.04\t2284.19\t2506.01\t2040.02\t1327.06\t1705.97\t1461.31\t1649.21\t1759.17\t2442.95\t0\t1875.52\t1881.42\t1512.88\t1520.67\t1981.82\t3021.6\t2389.78\t2088.67\t4697.26\t1646.11\t3269.32\t2805.59\t2315.4\n+V18\t243.32\t227.33\t349.71\t195.5\t327.78\t307.89\t703.12\t197.9\t0\t234.07\t330.09\t246.26\t256.2\t419.19\t0\t265.17\t192.4\t188.52\t255.13\t481.91\t462.41\t216.66\t336.29\t478.85\t152.09\t424.2\t257.62\t198.53\n+V19\t1921.6\t2015.61\t2872.21\t2975.67\t2406.07\t2438.08\t2381.42\t2789.98\t2881.8\t2119.69\t1953.23\t1880.63\t1985.58\t1819.19\t0\t2343.84\t2473.67\t1909.11\t1798.62\t2824.34\t1735\t2429.73\t1958.41\t4299.39\t2609.31\t3374.62\t2824.95\t3079.01\n+V20\t539.06\t432.85\t724.98\t347.76\t380.87\t522.5\t444.07\t550.04\t502.86\t576.95\t744.34\t410.58\t415.64\t321.36\t0\t805.68\t451.18\t292.67\t471.68\t793.63\t804.05\t679.41\t0\t1047.85\t444.04\t444.5\t547.87\t738.82\n+V21\t288.7\t0\t0\t0\t0\t0\t0\t0\t0\t144.5\t0\t0\t0\t154.85\t0\t119.48\t0\t0\t0\t0\t0\t0\t0\t179.2\t0\t208.44\t0\t0\n+V22\t273.95\t149.66\t287.92\t0\t327.34\t0\t717.56\t0\t0\t311.8\t0\t121.95\t0\t172.76\t0\t238.66\t161.38\t0\t0\t0\t0\t0\t608.86\t398.84\t173.3\t462.34\t347.64\t312.02\n+V23\t614.701\t98.849\t0\t217.085\t320.044\t246.769\t107.187\t114.252\t185.453\t0\t0\t179.589\t0\t0\t0\t169.996\t58.781\t133.231\t209.81\t106.94\t159.654\t97.758\t160.071\t0\t131.035\t0\t169.996\t0\n+V24\t7.329\t7.035\t6.437\t5.973\t6.656\t'..b'1.06\t2250.33\n+V93\t0\t354.36\t350.3\t379.16\t287.08\t292.88\t444.09\t303.69\t301.44\t132.41\t207.65\t392.54\t274.35\t267.83\t257.3\t382.95\t297.1\t74.08\t238.86\t145.6\t268.33\t189\t452.98\t351.16\t243.21\t1063.47\t369.08\t296.38\n+V94\t2856.36\t2456.4\t2540.2\t3367.98\t2179.99\t1475.83\t2299.58\t2163.25\t2417.45\t552.18\t1869.28\t2155.91\t1924.65\t1709.17\t1633.53\t3130.02\t2070.43\t550.12\t1852.97\t935.78\t2010.54\t1819.26\t2184.75\t2451.9\t1909.68\t5332.67\t2312.19\t1296.17\n+V95\t24091.97\t15443.29\t15942.72\t17970\t12145.72\t10870.02\t14682.71\t15930\t15884.55\t4008.56\t13247.25\t15454.42\t13712.53\t11623.37\t9969.61\t19752.29\t13959.91\t3398.12\t9621.47\t5782.84\t11913.08\t12015.65\t12566.22\t17116.78\t13006.74\t34928.36\t14618.89\t8804.83\n+V96\t60793.4\t33382.53\t33715.73\t32764.43\t24127.78\t25432.17\t29776.84\t35260.09\t34406.62\t11394.51\t28888.49\t34024.7\t31279.19\t25136.41\t21490.99\t42646.24\t30577.67\t7389.9\t16961.84\t12299.55\t24074.2\t26183.98\t25604.38\t38438.79\t28979.32\t78126.8\t31333.61\t20446.85\n+V97\t17570.51\t9240.64\t9721.88\t10284.94\t6788.15\t7088.16\t9220.42\t9323.72\t9904.8\t3334.56\t7668.14\t9513.44\t7976.91\t7000.53\t6579.27\t12453.69\t8532\t2170.52\t4915.75\t3693.18\t6545.25\t7271.72\t7741.63\t11272.66\t8234.6\t21625.05\t8912.48\t5612.76\n+V98\t0\t149.15\t135.65\t144.37\t124.09\t117.76\t110.31\t127.3\t113.58\t47.7\t128.4\t127.61\t126.27\t136.02\t105.67\t160.41\t130.73\t17.73\t118.88\t107.55\t121.9\t120.41\t133.07\t129.53\t119.35\t0\t106.34\t43.64\n+V99\t314.71\t233.89\t257.32\t290.71\t136.54\t131.91\t212.71\t151.12\t216.11\t70.67\t144.84\t161.98\t199.1\t177.26\t109.83\t276.15\t178.19\t56.71\t136.06\t92.56\t133.57\t240.27\t196.46\t181.17\t175.41\t0\t144.44\t73.62\n+V100\t1063.57\t888.31\t802.4\t899.21\t524.53\t465.73\t990.79\t508.3\t767.86\t235.42\t425.38\t531.11\t631.35\t755.31\t380.35\t795.06\t586.43\t170.6\t399.27\t323.3\t426.24\t771.87\t698.1\t557.47\t570.57\t1826.56\t696.67\t480.86\n+V101\t2587.9\t1673.54\t1654.1\t1984.41\t1404.72\t1474.72\t2767.56\t1490.35\t1879.66\t525.82\t725.28\t1591.13\t1128.98\t1962.5\t1210.7\t1571.45\t1365.01\t433.48\t897.88\t885.71\t1024.88\t1264.44\t2472.8\t1515.25\t1349.88\t4852\t1782.85\t1340.9\n+V102\t3565.72\t1975.42\t2013.22\t2140.6\t1668.46\t2455.07\t3602.33\t2361.46\t2472.79\t726.93\t769.9\t2420.79\t1099.54\t1908.1\t1814.65\t1765.41\t1629.73\t596.03\t990.98\t1185.95\t1435.53\t1123.37\t4179.54\t2564.22\t1660.72\t6490.51\t2453.85\t1944.54\n+V103\t0\t48.29\t0\t0\t0\t0\t70.19\t0\t14.81\t28.04\t0\t0\t0\t0\t0\t0\t0\t0\t0\t123.9\t0\t0\t0\t0\t0\t5.93\t16.23\t43.56\n+V104\t0\t123.49\t65.51\t80.81\t98.52\t68.99\t195.36\t83.25\t89.49\t55.5\t97.05\t128.29\t99.81\t113.05\t120.62\t0\t93.14\t47.16\t119.68\t367.75\t78.17\t59.42\t81.7\t79.25\t121.63\t0\t113.45\t109.53\n+V105\t0\t85.23\t0\t0\t0\t0\t168.05\t0\t31.66\t62.66\t0\t0\t0\t0\t0\t0\t0\t0\t0\t233.87\t0\t0\t0\t0\t0\t0\t29.23\t82.69\n+V106\t0\t183.94\t76.89\t113\t125.6\t0\t370.73\t0\t108.77\t125.97\t150.38\t121.92\t135.84\t186.45\t103.87\t0\t116.41\t63.52\t154.21\t496.94\t107.83\t94.48\t106.85\t0\t141.87\t0\t137.77\t156.29\n+V107\t423.7\t0\t164.21\t507.86\t578.77\t522.85\t0\t346.55\t317.99\t234.19\t0\t299.3\t343.68\t661.93\t499.17\t759.59\t427.28\t274.44\t363.88\t432.47\t486.04\t383.04\t381.67\t0\t497.37\t0\t318.06\t202.18\n+V108\t4.6\t2.76\t2.42\t3.59\t3.85\t3.27\t5.32\t4.47\t3.79\t0.98\t4.96\t3.56\t3.84\t4.62\t5.72\t5.58\t4.72\t0.89\t3.99\t4.66\t4.99\t4.79\t4.25\t2.82\t3.33\t4.09\t4.11\t0.74\n+V109\t1.46\t1.14\t1.27\t1.13\t1.52\t1.57\t1.35\t1.14\t1.32\t0.18\t1.18\t1.28\t1.13\t1.2\t1.14\t1.63\t1.26\t0.19\t1.32\t0.9\t1.14\t1.6\t1.07\t1.42\t1.87\t0.91\t1.28\t0.34\n+V110\t0.52\t0.55\t0\t0.49\t0\t0\t0\t0.51\t0.26\t0.28\t0.35\t0.38\t0.56\t0.44\t0\t0.55\t0.38\t0.2\t0.32\t0.37\t0.35\t0.52\t0\t0.44\t0.44\t0.28\t0.34\t0.16\n+V111\t0.4\t0\t0\t0.43\t0.32\t0\t0\t0.39\t0.19\t0.21\t0.3\t0.37\t0\t0.4\t0\t0.42\t0.25\t0.2\t0\t0.36\t0.25\t0.47\t0\t0.39\t0.38\t0\t0.23\t0.2\n+V112\t0.76\t0.49\t0.43\t0.64\t0.49\t0.48\t0.23\t0.71\t0.53\t0.17\t0.47\t0.52\t0.59\t0.62\t0.38\t0.65\t0.54\t0.1\t0.32\t0.49\t0.38\t0.55\t0.49\t0.6\t0.64\t0.47\t0.49\t0.11\n+V113\t0.61\t0.58\t0.53\t0.53\t0.45\t0.31\t0.15\t0.51\t0.46\t0.15\t0.36\t0.51\t0.44\t0.45\t0.48\t0.66\t0.48\t0.1\t0.33\t0.53\t0.37\t0.61\t0.36\t0.51\t0.67\t0.33\t0.46\t0.13\n+V114\t0\t0\t0\t0\t0.09\t0\t0\t0.12\t0.03\t0.05\t0\t0.1\t0\t0\t0\t0\t0.02\t0.04\t0\t0\t0.1\t0\t0.12\t0.11\t0\t0\t0.04\t0.06\n+V115\t0\t0\t0\t0\t0\t0\t0\t0.13\t0.02\t0.04\t0\t0.11\t0\t0\t0\t0\t0.02\t0.05\t0\t0\t0\t0\t0.15\t0.12\t0\t0\t0.03\t0.06\n+V116\t1.76\t1.89\t1.43\t1.19\t1.34\t1.64\t0\t2.33\t1.44\t0.68\t1.16\t2.16\t0\t1.74\t2.23\t1.12\t1.4\t0.83\t0\t1.47\t1.37\t1.34\t2.27\t1.83\t1.51\t1.43\t1.4\t0.65\n' |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa2/sampleMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa2/sampleMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,29 @@ +sampleMetadata meta1 +S1 A +S2 A +S3 A +S4 A +S5 A +S6 A +S7 A +S8 A +S9 B +S10 B +S11 B +S12 B +S13 B +S14 B +S15 B +S16 C +S17 C +S18 C +S19 C +S20 C +S21 C +S22 C +S23 C +S24 C +S25 BC +S26 AB +S27 BC +S28 AC |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/exa2/variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/exa2/variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,117 @@ +variableMetadata meta2 +V1 ER +V2 GGG +V3 GGG +V4 GGG +V5 GGG +V6 CE +V7 CE +V8 CE +V9 TG +V10 TG +V11 TG +V12 TG +V13 TG +V14 AM +V15 AM +V16 AM +V17 AM +V18 AM +V19 AM +V20 AM +V21 AM +V22 AM +V23 AM +V24 AM +V25 AM +V26 AM +V27 AM +V28 AM +V29 AM +V30 AM +V31 AM +V32 ER +V33 ER +V34 ER +V35 ER +V36 ER +V37 CER +V38 CER +V39 CER +V40 CER +V41 CER +V42 CER +V43 CER +V44 CER +V45 CER +V46 CER +V47 PP +V48 PP +V49 PP +V50 PP +V51 PP +V52 PP +V53 PP +V54 PP +V55 PP +V56 PP +V57 PP +V58 PP +V59 PP +V60 PP +V61 PP +V62 PP +V63 PP +V64 CC +V65 CC +V66 CC +V67 CC +V68 CC +V69 CC +V70 CC +V71 CC +V72 CC +V73 CC +V74 CC +V75 CC +V76 CC +V77 CC +V78 CC +V79 CC +V80 CC +V81 CC +V82 CC +V83 CC +V84 CC +V85 SM +V86 SM +V87 SM +V88 SM +V89 SM +V90 SM +V91 SM +V92 SM +V93 SM +V94 SM +V95 SM +V96 PI +V97 PI +V98 PI +V99 PI +V100 PI +V101 PI +V102 PI +V103 PI +V104 PI +V105 PI +V106 PI +V107 NG +V108 NG +V109 NG +V110 SO +V111 SO +V112 SO +V113 SO +V114 SO +V115 SO +V116 SO |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/heatmap_runtests.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/heatmap_runtests.R Tue Aug 02 06:26:41 2016 -0400 |
[ |
@@ -0,0 +1,105 @@ +#!/usr/bin/env Rscript + +## Package +##-------- + +library(RUnit) + +## Constants +##---------- + +testOutDirC <- "output" +argVc <- commandArgs(trailingOnly = FALSE) +scriptPathC <- sub("--file=", "", argVc[grep("--file=", argVc)]) + + +## Functions +##----------- + +## Reading tables (matrix or data frame) +readTableF <- function(fileC, typeC = c("matrix", "dataframe")[1]) { + + file.exists(fileC) || stop(paste0("No output file \"", fileC ,"\".")) + + switch(typeC, + matrix = return(t(as.matrix(read.table(file = fileC, + header = TRUE, + row.names = 1, + sep = "\t", + stringsAsFactors = FALSE)))), + dataframe = return(read.table(file = fileC, + header = TRUE, + row.names = 1, + sep = "\t", + stringsAsFactors = FALSE))) + +} + +## Call wrapper +wrapperCallF <- function(paramLs) { + + ## Set program path + wrapperPathC <- file.path(dirname(scriptPathC), "..", "heatmap_wrapper.R") + + ## Set arguments + argLs <- NULL + for (parC in names(paramLs)) + argLs <- c(argLs, parC, paramLs[[parC]]) + + ## Call + wrapperCallC <- paste(c(wrapperPathC, argLs), collapse = " ") + + if(.Platform$OS.type == "windows") + wrapperCallC <- paste("Rscript", wrapperCallC) + + wrapperCodeN <- system(wrapperCallC) + + if (wrapperCodeN != 0) + stop("Error when running heatmap_wrapper.R.") + + ## Get output + outLs <- list() + if ("dataMatrix_out" %in% names(paramLs)) + outLs[["datMN"]] <- readTableF(paramLs[["dataMatrix_out"]], "matrix") + if ("sampleMetadata_out" %in% names(paramLs)) + outLs[["samDF"]] <- readTableF(paramLs[["sampleMetadata_out"]], "dataframe") + if ("variableMetadata_out" %in% names(paramLs)) + outLs[["varDF"]] <- readTableF(paramLs[["variableMetadata_out"]], "dataframe") + if("information" %in% names(paramLs)) + outLs[["infVc"]] <- readLines(paramLs[["information"]]) + + return(outLs) +} + +## Setting default parameters +defaultArgF <- function(testInDirC) { + + defaultArgLs <- list() + if(file.exists(file.path(dirname(scriptPathC), testInDirC, "dataMatrix.tsv"))) + defaultArgLs[["dataMatrix_in"]] <- file.path(dirname(scriptPathC), testInDirC, "dataMatrix.tsv") + if(file.exists(file.path(dirname(scriptPathC), testInDirC, "sampleMetadata.tsv"))) + defaultArgLs[["sampleMetadata_in"]] <- file.path(dirname(scriptPathC), testInDirC, "sampleMetadata.tsv") + if(file.exists(file.path(dirname(scriptPathC), testInDirC, "variableMetadata.tsv"))) + defaultArgLs[["variableMetadata_in"]] <- file.path(dirname(scriptPathC), testInDirC, "variableMetadata.tsv") + + defaultArgLs[["dataMatrix_out"]] <- file.path(dirname(scriptPathC), testOutDirC, "dataMatrix.tsv") + defaultArgLs[["sampleMetadata_out"]] <- file.path(dirname(scriptPathC), testOutDirC, "sampleMetadata.tsv") + defaultArgLs[["variableMetadata_out"]] <- file.path(dirname(scriptPathC), testOutDirC, "variableMetadata.tsv") + defaultArgLs[["figure"]] <- file.path(dirname(scriptPathC), testOutDirC, "figure.pdf") + defaultArgLs[["information"]] <- file.path(dirname(scriptPathC), testOutDirC, "information.txt") + + defaultArgLs + +} + +## Main +##----- + +## Create output folder +file.exists(testOutDirC) || dir.create(testOutDirC) + +## Run tests +test.suite <- defineTestSuite('tests', dirname(scriptPathC), testFileRegexp = paste0('^.*_tests\\.R$'), testFuncRegexp = '^.*$') +isValidTestSuite(test.suite) +test.results <- runTestSuite(test.suite) +print(test.results) |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/heatmap_tests.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/heatmap_tests.R Tue Aug 02 06:26:41 2016 -0400 |
[ |
@@ -0,0 +1,57 @@ +test_input_cut4 <- function() { + + testDirC <- "input" + argLs <- list(disC = "1-cor", + cutSamN = "4", + cutVarN = "3", + corMetC = "spearman", + aggMetC = "ward", + colC = "blueOrangeRed", + scaL = "TRUE", + cexN = "0.8") + + argLs <- c(defaultArgF(testDirC), argLs) + outLs <- wrapperCallF(argLs) + + checkEqualsNumeric(outLs[['samDF']][13, 'heat_clust'], 4) + +} + +test_exa1_cut3 <- function() { + + testDirC <- "exa1" + argLs <- list(disC = "1-cor", + cutSamN = "3", + cutVarN = "4", + corMetC = "spearman", + aggMetC = "ward", + colC = "blueOrangeRed", + scaL = "TRUE", + cexN = "1") + + argLs <- c(defaultArgF(testDirC), argLs) + outLs <- wrapperCallF(argLs) + + checkEqualsNumeric(outLs[['varDF']]['V24', 'heat_clust'], 4) + +} + +test_exa2_cut4 <- function() { + + testDirC <- "exa2" + argLs <- list(disC = "1-cor", + cutSamN = "1", + cutVarN = "1", + corMetC = "spearman", + aggMetC = "ward", + colC = "blueOrangeRed", + scaL = "TRUE", + cexN = "1") + + argLs <- c(defaultArgF(testDirC), argLs) + outLs <- wrapperCallF(argLs) + + checkEquals(outLs[['varDF']]['V31', 'meta2'], 'AM') + +} + |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/input/dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/input/dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +dataMatrix HU_017 HU_028 HU_034 HU_051 HU_060 HU_078 HU_091 HU_093 HU_099 HU_110 HU_130 HU_134 HU_138 HU_149 HU_152 HU_175 HU_178 HU_185 HU_204 HU_208 +HMDB03193 76043 412165 44943 27242 436566 173175 242549 57066 559869 3732 339188 471368 262271 127285 451270 212500 79673 NA 891129 43907 +HMDB01101 30689 6877586 52217 3158 10789748 229568 4763576 3878773 976436 831937 608298 1605075 72021 442510 1107705 1464339 31250 2724553 72900 32742 +HMDB10348 47259 544877 60885 34582 529874 168264 176500 76457 610110 16262 279156 524468 451573 591487 433529 161069 214392 13781 1580343 39315 +HMDB59717 357351 1030464 301983 67604 306862 1028110 1530493 270027 1378535 289677 808334 1132813 871209 895435 715190 1563158 784738 146195 994336 239030 +HMDB00822 483755 579287 1132413 157113 1577570 1469735 1085454 477909 814755 245417 610681 763706 2406336 827531 992508 569605 355321 150259 1334200 271010 +HMDB13189 2644620 727587 1661412 619181 136278 2755434 593863 837865 3526136 2003278 1608814 3446611 1941527 113937 3132404 2893445 2092753 1034666 1517319 841661 +HMDB00299 250551 1046138 456162 159386 1013302 808657 614370 250403 768004 242085 504108 1014041 1362408 1057660 1110050 566050 411886 142233 1992420 284775 +HMDB00191 560002 771533 575790 392284 888498 785428 645785 591569 960658 910201 639437 1092885 1409045 2292023 1246459 1945577 710519 773384 1061418 622898 +HMDB00518 34236 58249 85944 NA 342102 129886 175800 13154 230242 NA 440223 315368 10657 419508 48673 28361 514579 23108 867108 73831 +HMDB00715 1252089 2547452 905408 371059 4983588 5140022 2658555 814523 2558923 859466 4184204 3865723 3236644 2615560 3820724 3577833 2295288 625924 7517724 1341900 +HMDB01032 2569205 26023086 1604999 430453 8103558 26222916 257139 675754 59906109 263055 31151730 18648127 14989438 1554658 20249262 5588731 871010 15920 9120781 44276 +HMDB00208 747080 13420742 595872 1172376 7172632 3143654 4059767 1433702 5593888 5402629 2477288 3346077 4230072 7621236 8960828 10335722 7037373 1574738 3359238 2540044 +HMDB04824 374028 1144386 539206 178517 1046190 959381 605191 310260 1253319 477259 477995 825691 1157093 1089284 1411802 1020206 782673 346761 1824553 387811 +HMDB00512 53304 319783 280560 85009 1333877 556003 590779 209285 342532 198512 569970 525240 246282 1140422 542345 1171008 827723 222953 438839 85554 +HMDB00251 368600 616555 94936 622468 180988 293988 352855 767894 268331 167246 310918 1248919 577184 10985 335711 403815 80614 63393 454489 616061 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/input/sampleMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/input/sampleMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,21 @@ +sampleMetadata injectionOrder mode age bmi gender +HU_017 2 pos 41 23.03 M +HU_028 7 pos 41 23.92 F +HU_034 9 pos 52 23.37 M +HU_051 20 pos 24 23.23 F +HU_060 24 pos 55 28.72 F +HU_078 34 pos 46 25.18 M +HU_091 42 pos 61 26.12 M +HU_093 43 pos 53 21.71 M +HU_099 46 pos 23 21.3 M +HU_110 53 pos 50 20.9 F +HU_130 63 pos 33 26.06 M +HU_134 67 pos 48 22.89 M +HU_138 68 pos 42 21.88 M +HU_149 72 pos 35 19.49 F +HU_152 75 pos 26 17.58 F +HU_175 87 pos 35 21.26 F +HU_178 88 pos 60 32.87 F +HU_185 95 pos 42 21.09 F +HU_204 104 pos 31 29.06 M +HU_208 106 pos 27 18.61 F |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/input/variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/input/variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +variableMetadata name +HMDB03193 Testosterone_glucuronide +HMDB01101 p-Anisic_acid +HMDB10348 Dehydroepiandrosterone_3-glucuronide +HMDB59717 Glu-Val +HMDB00822 p-Hydroxymandelic_acid +HMDB13189 3-Indole_carboxylic_acid_glucuronide +HMDB00299 Xanthosine +HMDB00191 L-Aspartic_acid +HMDB00518 Chenodeoxycholic_acid +HMDB00715 Kynurenic_acid +HMDB01032 Dehydroepiandrosterone_sulfate +HMDB00208 Oxoglutaric_acid +HMDB04824 N2,N2-Dimethylguanosine +HMDB00512 N-Acetyl-L-phenylalanine +HMDB00251 Taurine |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/dataMatrix.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/output/dataMatrix.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +dataMatrix HU_051 HU_208 HU_178 HU_130 HU_175 HU_099 HU_152 HU_204 HU_017 HU_138 HU_034 HU_078 HU_060 HU_149 HU_028 HU_093 HU_134 HU_091 HU_110 HU_185 +HMDB13189 619181 841661 2092753 1608814 2893445 3526136 3132404 1517319 2644620 1941527 1661412 2755434 136278 113937 727587 837865 3446611 593863 2003278 1034666 +HMDB00251 622468 616061 80614 310918 403815 268331 335711 454489 368600 577184 94936 293988 180988 10985 616555 767894 1248919 352855 167246 63393 +HMDB01101 3158 32742 31250 608298 1464339 976436 1107705 72900 30689 72021 52217 229568 10789748 442510 6877586 3878773 1605075 4763576 831937 2724553 +HMDB00191 392284 622898 710519 639437 1945577 960658 1246459 1061418 560002 1409045 575790 785428 888498 2292023 771533 591569 1092885 645785 910201 773384 +HMDB00208 1172376 2540044 7037373 2477288 10335722 5593888 8960828 3359238 747080 4230072 595872 3143654 7172632 7621236 13420742 1433702 3346077 4059767 5402629 1574738 +HMDB59717 67604 239030 784738 808334 1563158 1378535 715190 994336 357351 871209 301983 1028110 306862 895435 1030464 270027 1132813 1530493 289677 146195 +HMDB00512 85009 85554 827723 569970 1171008 342532 542345 438839 53304 246282 280560 556003 1333877 1140422 319783 209285 525240 590779 198512 222953 +HMDB00518 NA 73831 514579 440223 28361 230242 48673 867108 34236 10657 85944 129886 342102 419508 58249 13154 315368 175800 NA 23108 +HMDB00822 157113 271010 355321 610681 569605 814755 992508 1334200 483755 2406336 1132413 1469735 1577570 827531 579287 477909 763706 1085454 245417 150259 +HMDB00715 371059 1341900 2295288 4184204 3577833 2558923 3820724 7517724 1252089 3236644 905408 5140022 4983588 2615560 2547452 814523 3865723 2658555 859466 625924 +HMDB01032 430453 44276 871010 31151730 5588731 59906109 20249262 9120781 2569205 14989438 1604999 26222916 8103558 1554658 26023086 675754 18648127 257139 263055 15920 +HMDB00299 159386 284775 411886 504108 566050 768004 1110050 1992420 250551 1362408 456162 808657 1013302 1057660 1046138 250403 1014041 614370 242085 142233 +HMDB04824 178517 387811 782673 477995 1020206 1253319 1411802 1824553 374028 1157093 539206 959381 1046190 1089284 1144386 310260 825691 605191 477259 346761 +HMDB03193 27242 43907 79673 339188 212500 559869 451270 891129 76043 262271 44943 173175 436566 127285 412165 57066 471368 242549 3732 NA +HMDB10348 34582 39315 214392 279156 161069 610110 433529 1580343 47259 451573 60885 168264 529874 591487 544877 76457 524468 176500 16262 13781 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/essai.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/output/essai.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,21 @@ +sampleMetadata injectionOrder mode age bmi gender heat_clust +HU_017 2 pos 41 23.03 M 1 +HU_034 9 pos 52 23.37 M 1 +HU_204 104 pos 31 29.06 M 2 +HU_134 67 pos 48 22.89 M 2 +HU_099 46 pos 23 21.3 M 2 +HU_078 34 pos 46 25.18 M 2 +HU_130 63 pos 33 26.06 M 2 +HU_028 7 pos 41 23.92 F 2 +HU_138 68 pos 42 21.88 M 2 +HU_152 75 pos 26 17.58 F 2 +HU_051 20 pos 24 23.23 F 3 +HU_208 106 pos 27 18.61 F 3 +HU_110 53 pos 50 20.9 F 3 +HU_178 88 pos 60 32.87 F 3 +HU_149 72 pos 35 19.49 F 3 +HU_175 87 pos 35 21.26 F 3 +HU_060 24 pos 55 28.72 F 4 +HU_091 42 pos 61 26.12 M 4 +HU_093 43 pos 53 21.71 M 4 +HU_185 95 pos 42 21.09 F 4 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/figure.pdf |
b |
Binary file tests/output/figure.pdf has changed |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/information.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/output/information.txt Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,24 @@ + +Start of the 'Heatmap' module: Tue 02 Aug 2016 11:48:22 AM + +Arguments used: + + value +dataMatrix_in "tests/input/dataMatrix.tsv" +sampleMetadata_in "tests/input/sampleMetadata.tsv" +variableMetadata_in "tests/input/variableMetadata.tsv" +dataMatrix_out "tests/output/dataMatrix.tsv" +sampleMetadata_out "tests/output/sampleMetadata.tsv" +variableMetadata_out "tests/output/variableMetadata.tsv" +figure "tests/output/figure.pdf" +information "tests/output/information.txt" +disC "1-cor" +cutSamN "4" +cutVarN "3" +corMetC "spearman" +aggMetC "ward" +colC "blueOrangeRed" +scaL "TRUE" +cexN "0.8" + +End of the 'Heatmap' Galaxy module call: Tue 02 Aug 2016 11:48:22 AM |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/sampleMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/output/sampleMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,21 @@ +sampleMetadata injectionOrder mode age bmi gender heat_clust +HU_051 20 pos 24 23.23 F 3 +HU_208 106 pos 27 18.61 F 3 +HU_178 88 pos 60 32.87 F 1 +HU_130 63 pos 33 26.06 M 1 +HU_175 87 pos 35 21.26 F 1 +HU_099 46 pos 23 21.3 M 1 +HU_152 75 pos 26 17.58 F 1 +HU_204 104 pos 31 29.06 M 1 +HU_017 2 pos 41 23.03 M 1 +HU_138 68 pos 42 21.88 M 1 +HU_034 9 pos 52 23.37 M 1 +HU_078 34 pos 46 25.18 M 1 +HU_060 24 pos 55 28.72 F 4 +HU_149 72 pos 35 19.49 F 4 +HU_028 7 pos 41 23.92 F 2 +HU_093 43 pos 53 21.71 M 2 +HU_134 67 pos 48 22.89 M 2 +HU_091 42 pos 61 26.12 M 2 +HU_110 53 pos 50 20.9 F 2 +HU_185 95 pos 42 21.09 F 2 |
b |
diff -r 000000000000 -r ad06aeed02c9 tests/output/variableMetadata.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/output/variableMetadata.tsv Tue Aug 02 06:26:41 2016 -0400 |
b |
@@ -0,0 +1,16 @@ +variableMetadata name heat_clust +HMDB13189 3-Indole_carboxylic_acid_glucuronide 3 +HMDB00251 Taurine 3 +HMDB01101 p-Anisic_acid 2 +HMDB00191 L-Aspartic_acid 2 +HMDB00208 Oxoglutaric_acid 2 +HMDB59717 Glu-Val 2 +HMDB00512 N-Acetyl-L-phenylalanine 2 +HMDB00518 Chenodeoxycholic_acid 1 +HMDB00822 p-Hydroxymandelic_acid 1 +HMDB00715 Kynurenic_acid 1 +HMDB01032 Dehydroepiandrosterone_sulfate 1 +HMDB00299 Xanthosine 1 +HMDB04824 N2,N2-Dimethylguanosine 1 +HMDB03193 Testosterone_glucuronide 1 +HMDB10348 Dehydroepiandrosterone_3-glucuronide 1 |