<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/introduction-to-biclustgui/"></div></div><div><a data-url="https://www.r-bloggers.com/introduction-to-biclustgui/" data-counturl="https://www.r-bloggers.com/introduction-to-biclustgui/" data-count="horizontal" data-text="Introduction to BiclustGUI" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ewouddt.github.io/RcmdrPlugin.BiclustGUI/2016/09/27/biclustGUI/"> BiclustGUI - r</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h1>BiclustGUI in R</h1>
<p>Ewoud De Troyer, University of Hasselt (CenStat)</p>
<h2>Biclustering in a GUI &amp; Growing a GUI together!</h2>
<h3>Introduction</h3>
<p>We are happy to announce the first release of the <strong>BiclustGUI</strong> on <a target="_blank" href="https://cran.r-project.org/web/packages/RcmdrPlugin.BiclustGUI/">CRAN</a> (<code>RcmdrPlugin.BiclustGUI</code>)!<br>
This GUI will you enable to quickly try out a wide arrange of biclustering algorithms and produce some helpfull graphs in order to explore your data. Since we made the choice of developing it in the form of a plug-in for R Commander, you can save your R code after the session which can be used without GUI intervention. However for those of you who love using Shiny, have no fear! We have also created a Shiny App including all the biclustering algorithms and the most interesting plots. (For all available diagnostics and graphs, you will have to head over to the BiclustGUI package itself though.)</p>
<p>This blog is meant as a short introduction to the GUI which will highlight some features, give an example or two and showcase what else we have done in this area. A detailed instruction guide about all aspects of the GUI (as well as some short explanation about the included algorithms) can be found in the form of a vignette <a target="_blank" href="https://cran.r-project.org/web/packages/RcmdrPlugin.BiclustGUI/vignettes/GuideBiclustGUI.pdf">here</a>. [1]</p>
<h3>What is biclustering?</h3>
<p>If you are familiar with the concept of biclustering, you can safely skip this section. If you are not, biclustering is actually a fairly easy concept! Say you have a matrix (M), instead of just clustering on a single dimension such as the columns (= finding similar columns based on all the rows), you are going to cluster <em>simultaneously</em> on both dimensions. This means you are trying to discover a subset of columns which are similar on only a subset of rows or vice versa. This submatrix which contains this local pattern is what we call a <strong>bicluster</strong>.<br>
There exist a great deal of different algorithms to find these submatrices. For example, they can differ in which assumption they have of the pattern inside the bicluster (constant/evolution or additive/multiplicative). They can be based on a specific model, random initialisations, the type of data (binary/continuous),… too much to sum up here! In the GUI we have tried to include a large variety of these different methods.</p>
<p><img alt="Heatmap of Example Data Matrix with 2 Biclusters" src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/unnamed-chunk-1-1.png?w=456" data-recalc-dims="1"></p>
<p>
Heatmap of Example Data Matrix with 2 Biclusters
</p>
<h3>The BiclustGUI R Package</h3>
<p>Let me start with some motivation why we decided to create this GUI and what we tried to achieve.<br>
As is with many data analysis workflows, there exist a lot of different R packages for biclustering. Since plowing through all of the reference manuals to discover all the functions and their arguments can be quite time-consuming, one of our goals was to alleviate this process. This is why we choose to create the BiclustGUI as a <strong>R Commander plug-in</strong>. On one side you have the easy point-and-click environment, and on the other side your R code, which uses the functions from the corresponding packages, is being generated. We hope by doing this, that the GUI is a helpful tool to quickly get into some biclustering exploration, while not limiting you to play around with the code after its initial generation.</p>
<p>When developing the GUI, we also wanted to provide a <strong>unified platform</strong> from which all of these packages are <em>connected</em> and can be <em>accessed</em> (both for the methods and diagnostics packages). The table at the end of this section shows which ones are included so far and the Examples section will show you the default look of a biclustering window.<br>
This means that as long as you are using the interface, you do not have to worry about which R output object goes where in which argument of another function, even if the functions for the method or plot come from different packages. The generated R code will reflect this correctly.</p>
<p>The final aim, but not less important, was to create a <strong>growing GUI</strong>. Since new biclustering methods/diagnostics and packages are still being developed, ee required a way so that the GUI could grow along side these new developments.<br>
The way we tackled this was by including easy <em>“fill-out”-scripts</em> which developers can use to create a GUI window themselves for their novel method. As soon as the window fits their needs, they can send us this script so that we can include the new method in the next release of the GUI with minimal work from our side.<br>
I’ll talk about more about these scripts in a later section, but the general gist is that you will have to fill out some general information about your method and then copy-paste which widgets should be used in your window! These scripts should be fairly easy to get an understanding of since the <code>tcltk</code> syntax has been completely omitted from them.</p>
<table>
<caption>All included biclustering and diagnostics packages in the BiclustGUI:</caption>
<colgroup>
<col width="15%">
<col width="40%">
<col width="23%">
</colgroup>
<thead>
<tr>
<th align="left">R Package</th>
<th align="left">Biclustering Method</th>
<th align="left">Publication</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left">Plaid</td>
<td align="left">Turnet <em>et al.</em>, 2005</td>
</tr>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left"><span><em>δ</em></span>-biclustering</td>
<td align="left">Cheng and Church, 2000</td>
</tr>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left">X Motif</td>
<td align="left">Murali and Kasif, 2003</td>
</tr>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left">Spectral</td>
<td align="left">Kluger <em>et al.</em>, 2003</td>
</tr>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left">QuestMotif</td>
<td align="left">Kaiser, 2011</td>
</tr>
<tr>
<td align="left"><code>biclust</code></td>
<td align="left">Bimax</td>
<td align="left">Prelic <em>et al</em>., 2006</td>
</tr>
<tr>
<td align="left"><code>fabia</code></td>
<td align="left">FABIA</td>
<td align="left">Hochreiter <em>et al.</em>, 2010</td>
</tr>
<tr>
<td align="left"><code>isa2</code></td>
<td align="left">The Iterative Signature Algorithm</td>
<td align="left">Bergman <em>et al</em>., 2003</td>
</tr>
<tr>
<td align="left"><code>iBBiG</code></td>
<td align="left">Iterative Binary BIclustering of Genesets</td>
<td align="left">Gusenleitner <em>et al</em>., 2012</td>
</tr>
<tr>
<td align="left"><code>rqubic</code></td>
<td align="left">Qualitative Biclustering</td>
<td align="left">Li <em>et al</em>., 2009</td>
</tr>
<tr>
<td align="left"><code>BicARE</code></td>
<td align="left">Biclustering Analysis and Results Exploration</td>
<td align="left">Gestraud and Barillot, 2014</td>
</tr>
<tr>
<td align="left"><code>s4vd</code></td>
<td align="left">SSVD (Sparse Singular Value Decomposition)</td>
<td align="left">Lee <em>et al</em>., 2010</td>
</tr>
<tr>
<td align="left"><code>s4vd</code></td>
<td align="left">S4VD (SSVD incorporating stability correction)</td>
<td align="left">Sill <em>et al</em>., 2011</td>
</tr>
<tr>
<td align="left"><strong>R Package</strong></td>
<td align="left"><strong>Diagnostics</strong></td>
<td align="left"><strong>Publication</strong></td>
</tr>
<tr>
<td align="left"><code>BcDiag</code></td>
<td align="left">Bicluster Diagnostic Plots</td>
<td align="left">Aregay <em>et al</em>., 2014</td>
</tr>
<tr>
<td align="left"><code>superbiclust</code></td>
<td align="left">Generating Robust Biclusters from a Bicluster Set</td>
<td align="left">Khamiakova, 2013</td>
</tr>
</tbody>
</table>
<h3>Installing the GUI</h3>
<p>Before we continue to some examples, let’s install the GUI. To do so, please follow the code below:</p>
<div>
<pre><code><span>setRepositories</span><span>(</span><span>ind</span><span>=</span><span>c</span><span>(</span><span>1</span><span>:</span><span>5</span><span>))</span><span>
</span><span>install.packages</span><span>(</span><span>&quot;RcmdrPlugin.BiclustGUI&quot;</span><span>)</span><span>
</span></code></pre>
</div>
<p>This will install the GUI and its dependencies from both CRAN and Bioconductor. Should some issue arise with a package installation, please try to manual install them. The code for this can be found <a target="_blank" href="https://ibiostat.be/online-resources/online-resources/biclustgui/biclustgui">here</a>.</p>
<p>On the initial start-up of R Commander, you will probably be prompted to install some additional dependencies. This should not take too long!</p>
<p>To launch the GUI, use:</p>
<div>
<pre><code><span>library</span><span>(</span><span>RcmdrPlugin.BiclustGUI</span><span>)</span><span>
</span></code></pre>
</div>
<p>(Note: A development version can be found on <a target="_blank" href="https://github.com/ewouddt/RcmdrPlugin.BiclustGUI">GitHub</a> and <a target="_blank" href="https://r-forge.r-project.org/R/?group_id=2104">R-Forge</a>).</p>
<h3>What’s R Commander &amp; The BiclustGUI Plug-in?</h3>
<p>For those not familiar with R Commander (<code>Rcmdr</code>), it is a basic statistics GUI by John Fox based on the <code>tlctk</code> package. The basic R Commander window contains a script window, where the R code is generated, as well as a console and warning window. The BiclustGUI extends the R Commander window with two extra biclustering menus as you can see in the Figure below:</p>
<p><img alt="Basic R Commander Window and Plug-in Menu" src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/rcmdrandmenus.png?w=60%25" data-recalc-dims="1"></p>
<p>
Basic R Commander Window and Plug-in Menu
</p>
<h3>Examples</h3>
<p>All biclustering windows follow the same structure (see Figure below) of 2 tabs.</p>
<ul>
<li>The first tab, the <strong>Biclustering Tab</strong>, includes all parameters, a seed box (if required) and a <em>Show Results</em> button to apply the algorithm.</li>
<li>The second tab, the <strong>Plots &amp; Diagnostics Tab</strong>, will contain, as the name suggests, <em>plots and diagnostics</em> for the chosen methods.</li>
<li>At the bottom of the second tab, there are also buttons to access more <strong>general diagnostics packages</strong>. Currently <code>BcDiag</code> and <code>superbiclust</code> are included.</li>
</ul>
<p><img alt="Standard Window" src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/standard_buttons.png?w=35%25" data-recalc-dims="1"></p>
<p>
Standard Window
</p>
<p>Let’s now look at 2 examples which mimic a short biclustering exploration. Both examples will show the general workflow you can expect when using the BiclustGUI</p>
<h4>Plaid Example</h4>
<ol>
<li>Apply Plaid with the chosen parameters.</li>
<li>Go the second tab.</li>
<li>Generate a Profile Plot.</li>
</ol>
<p><img alt="Plaid Windows" src="https://i2.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/guiexample.png?w=100%25" data-recalc-dims="1"></p>
<p>
Plaid Windows
</p>
<p>We could have also accessed the <em>BcDiag</em> button on the bottom of the second tab to create the following profile plots:</p>
<p><img alt="BcDiag Profile Plots" src="https://i2.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/bcdiagexample.png?w=40%25" data-recalc-dims="1"></p>
<p>
BcDiag Profile Plots
</p>
<h4>FABIA Example</h4>
<ol>
<li>Apply FABIA with the chosen parameters. The corresponding R-code will be generated in the script window of R Commander.</li>
<li>Go to the second tab.</li>
<li>Use <em>Biclust Plots</em> button to access plots from the <code>biclust</code> package.</li>
<li>Use the heatmap button to generate the graph in a R Graphics Device.</li>
</ol>
<p><img alt="FABIA Windows" src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/guiexample2.png?w=100%25" data-recalc-dims="1"></p>
<p>
FABIA Windows
</p>
<h3>How about future algorithms? Including new methods!</h3>
<p>As I explained in an earlier section, we wanted to develop an easy way to include new biclustering R packages in the future. We wanted to make sure the GUI stayed up to date with recent developments by growing it as a community. The way we addressed this problem this was through <em>“fill-out template scripts”</em> which do not require the original <code>tcltk</code> syntax. I will try to outline the general idea and workings behind these scripts, but by no means will this be a full tutorial! A much more detailed explanation can be found in the second part of the <a target="_blank" href="https://cran.r-project.org/web/packages/RcmdrPlugin.BiclustGUI/vignettes/GuideBiclustGUI.pdf">vignette</a>.</p>
<p>The remainder of this section will be a bit more ‘R-code dense’ so if this does not interest you, you can safely skip to the next one, <em>The Shiny App</em>.</p>
<h4>Window Function &amp; Window Scripts</h4>
<p>In <code>Rcmdr</code> or <code>tcltk</code> a window is simply a R function. Inside this function the window, interface and all its elements are defined. Calling this function will make the window appear in your R session. The script we provide will help you make such a function (e.g. <code>newmethod_WINDOW()</code>) in which the GUI is defined. This newly created window function can then be used by R Commander to call it from a meanu.</p>
<p>Before we head over to such a “fill-out” script, I should briefly mention that there are actually 2 types of them:</p>
<ol>
<li>The first type is used to created a biclustering window (with its 2 tabs, biclustering and plots &amp; diagnostics).</li>
<li>The second type is used to create an extra tool window. This can serve as an extension of the first (e.g. linking tool window functions with buttons) or a general diagnostic window.</li>
</ol>
<p>Both scripts are nearly completely identical. They only differ in the fact that the first type is for the two tabs (biclustering and plots) window while the second type is only for a window with one tab which follows the same rules as the second tab in the first script.<br>
Since they are so similar, let’s just focus on the first type.</p>
<h4>Structure of a Window Script</h4>
<p>The script, provided in <code>newmethod_script.R</code> in the <code>doc</code> folder of the BiclustGUI package, starts with opening the window function (here called <code>newmethod_WINDOW</code>, but you can change this). Next, some objects are initialized, followed by some variables which need to changed to adapt it to the method you want to implement. These are variables such as the name of the method, the function used for the method, the argument of this function which accepts the data, etc.<br>
It is also possible to add some discretize or binarize frames to the window (see Figure below). (See the <a target="_blank" href="https://cran.r-project.org/web/packages/RcmdrPlugin.BiclustGUI/vignettes/GuideBiclustGUI.pdf">vignette</a> for more detailed information about all of these variables!)</p>
<p>What follows next is the information that will decide how the window will look like for the two tabs, but we will come back to that in a minute.<br>
At the very end of the script all the defined variables come together in the <code>cluster_template()</code> function which will translate all of this info to <code>tcltk</code> syntax.</p>
<div>
<pre><code><span>newmethod_WINDOW</span><span> </span><span>&lt;-</span><span> </span><span>function</span><span>(){</span><span>
</span><span>new.frames</span><span> </span><span>&lt;-</span><span> </span><span>.initialize.new.frames</span><span>()</span><span>
</span><span>grid.config</span><span> </span><span>&lt;-</span><span> </span><span>.initialize.grid.config</span><span>()</span><span>
</span><span>grid.rows</span><span> </span><span>&lt;-</span><span> </span><span>.initialize.grid.rows</span><span>()</span><span>
</span><span>#####################################################
</span><span> </span><span>## GENERAL INFORMATION ABOUT THE NEW METHOD/WINDOW ##
</span><span> </span><span>#####################################################
</span><span> </span><span>methodname</span><span> </span><span>&lt;-</span><span> </span><span>&quot;A new method&quot;</span><span>
</span><span>methodfunction</span><span> </span><span>&lt;-</span><span> </span><span>&quot;methodfunction&quot;</span><span>
</span><span>data.arg</span><span> </span><span>&lt;-</span><span> </span><span>&quot;d&quot;</span><span>
</span><span>data.matrix</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>methodshow</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>other.arg</span><span> </span><span>&lt;-</span><span> </span><span>&quot;&quot;</span><span>
</span><span>methodhelp</span><span> </span><span>&lt;-</span><span> </span><span>&quot;&quot;</span><span>
</span><span># Extra Data Conversion Boxes
</span><span> </span><span>data.discr</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span>data.bin</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span># Possibility to give a seed ?
</span><span> </span><span>methodseed</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>## COMPATIBILITY? ##
</span><span> </span><span># BcDiag
</span><span> </span><span>bcdiag.comp</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span># SuperBiclust
</span><span> </span><span>superbiclust.comp</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span>##########################
</span><span> </span><span>#### BICLUSTERING TAB ####
</span><span> </span><span>##########################
</span><span> </span><span># OMITTEN FOR NOW (SEE FURTHER)
</span><span> </span><span>#################################
</span><span> </span><span>#### PLOTS &amp; DIAGNOSTICS TAB ####
</span><span> </span><span>#################################
</span><span> </span><span># OMITTED FOR NOW (SEE FURTHER)
</span><span> </span><span>###############################################################
</span><span> </span><span>## USE THE ARGUMENTS IN THE GENERAL CLUSTERTEMPLATE FUNCTION ##
</span><span> </span><span>###############################################################
</span><span> </span><span>cluster_template</span><span>(</span><span>methodname</span><span> </span><span>=</span><span> </span><span>methodname</span><span>,</span><span> </span><span>methodfunction</span><span> </span><span>=</span><span>
</span><span>methodfunction</span><span>,</span><span> </span><span>methodhelp</span><span> </span><span>=</span><span> </span><span>methodhelp</span><span>,</span><span> </span><span>data.arg</span><span> </span><span>=</span><span> </span><span>data.arg</span><span>,</span><span>
</span><span>other.arg</span><span> </span><span>=</span><span> </span><span>other.arg</span><span>,</span><span> </span><span>methodseed</span><span> </span><span>=</span><span> </span><span>methodseed</span><span>,</span><span>
</span><span>grid.config</span><span> </span><span>=</span><span> </span><span>grid.config</span><span>,</span><span> </span><span>grid.rows</span><span> </span><span>=</span><span> </span><span>grid.rows</span><span>,</span><span>
</span><span>new.frames</span><span> </span><span>=</span><span> </span><span>new.frames</span><span>,</span><span> </span><span>superbiclust.comp</span><span> </span><span>=</span><span>
</span><span>superbiclust.comp</span><span>,</span><span> </span><span>bcdiag.comp</span><span> </span><span>=</span><span> </span><span>bcdiag.comp</span><span>,</span><span> </span><span>data.transf</span><span> </span><span>=</span><span>
</span><span>data.transf</span><span>,</span><span> </span><span>data.discr</span><span> </span><span>=</span><span> </span><span>data.discr</span><span>,</span><span> </span><span>data.bin</span><span> </span><span>=</span><span> </span><span>data.bin</span><span>,</span><span>
</span><span>methodshow</span><span> </span><span>=</span><span> </span><span>methodshow</span><span>,</span><span> </span><span>methodsave</span><span> </span><span>=</span><span> </span><span>methodsave</span><span>)</span><span>
</span><span>}</span><span>
</span></code></pre>
</div>
<p><img alt="Discretize and Binarize Frames" src="https://i2.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/discrbin.png?w=50%25" data-recalc-dims="1"></p>
<p>
Discretize and Binarize Frames
</p>
<h4>Designing the Window (of the 2 tabs)</h4>
<p>So the only part that’s left now is to design how the two tabs should look like. Both tabs are created in the exact same way and follow <strong>3 easy steps</strong>:</p>
<ol>
<li>Making the frames.</li>
<li>Configuring the frames into a grid (matrix).</li>
<li>Combining rows into a box.</li>
</ol>
<p><img src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/plaid_structure.png?w=100%25" data-recalc-dims="1"></p>
<p>Let’s look how this would look like for the first tab. Note that this part starts by putting the <code>input</code> variable to <code>&quot;clusterTab&quot;</code> to indicate that we are adding information to the first tab.</p>
<div>
<pre><code><span>########################
#### CLUSTERING TAB ####
########################
</span><span>input</span><span> </span><span>&lt;-</span><span> </span><span>&quot;clusterTab&quot;</span><span>
</span><span>### 1. ADDING THE FRAMES ###
</span><span>
</span><span># Add frames here
</span><span>
</span><span>### 2. CONFIGURING THE GRID ###
</span><span>grid.config</span><span> </span><span>&lt;-</span><span> </span><span>.grid.matrix</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>c</span><span>(</span><span>&quot;frame1&quot;</span><span>,</span><span>&quot;frame2&quot;</span><span>,</span><span>
</span><span>&quot;frame3&quot;</span><span>,</span><span>NA</span><span>,</span><span>&quot;frame4&quot;</span><span>,</span><span>NA</span><span>),</span><span>
</span><span>nrow</span><span>=</span><span>3</span><span>,</span><span>ncol</span><span>=</span><span>2</span><span>,</span><span>byrow</span><span>=</span><span>TRUE</span><span>,</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span><span>### 3. COMBING THE ROWS ###
</span><span>grid.rows</span><span> </span><span>&lt;-</span><span> </span><span>.combine.rows</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>rows</span><span>=</span><span>c</span><span>(</span><span>1</span><span>),</span><span>title</span><span>=</span><span>&quot;A nice
box: &quot;</span><span>,</span><span>border</span><span>=</span><span>TRUE</span><span>,</span><span>grid.rows</span><span>=</span><span>grid.rows</span><span>,</span><span>
</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span><span>grid.rows</span><span> </span><span>&lt;-</span><span> </span><span>.combine.rows</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>rows</span><span>=</span><span>c</span><span>(</span><span>2</span><span>,</span><span>3</span><span>),</span><span>
</span><span>title</span><span>=</span><span>&quot;A nice box:&quot;</span><span>,</span><span>border</span><span>=</span><span>TRUE</span><span>,</span><span>grid.rows</span><span>=</span><span>grid.rows</span><span>,</span><span>
</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span></code></pre>
</div>
<p><strong>Step 1</strong><br>
In the first step we create the frames for the method function arguments. A variety of frames can be created:</p>
<ul>
<li>Check Boxes</li>
<li>Radio Buttons</li>
<li>Entry Fields</li>
<li>Sliders</li>
<li>Spinboxes</li>
</ul>
<p>The easiest way to create these is to open the <code>frames_script.R</code> file in the <code>doc</code> folder of the BiclustGUI and simply copy paste the default version of one of these frames and then adapt the variables as you need them (frame name, argument names, initial values, title, border,…). Later in this section you can find a short example of how to do this.<br>
For example the default script of the entry fields frame and its result looks like:</p>
<p><img src="https://i1.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/entryfields.png?w=75%25" data-recalc-dims="1"></p>
<p>It should be noted that in the second tab, plots &amp; diagnostics, another type of frame can be added, namely <em>manual buttons</em>. These are used to call functions which calculate diagnostics, draw graphs or apply any other function you want.<br>
The default script and result for this frame looks like:</p>
<p><img src="https://i1.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/manualbutton.png?w=75%25" data-recalc-dims="1"></p>
<p>I would like to point attention to the <code>buttonfunction</code> and <code>arg.frames</code> variable. The first determines which function is tied to this button, the second determines which frames (meaning which arguments), are tied to this function/button.</p>
<p><strong>Step 2</strong><br>
Next you need to take the frame names of the frames defined in <em>step 1</em> and put them into a matrix with the <code>.grid.matrix()</code> function which is saved in the <code>grid.config</code> object.<br>
The way the names are placed in the matrix will decide how they will appear in the window (although note that frames will always be pulled towards the top-left).<br>
Note that apart from some extra arguments which should not be changed, <code>grid.matrix()</code> accepts the same input as <code>matrix()</code>.</p>
<p><strong>Step 3</strong><br>
The final step allows you to group together/put a box or title around 1 or multiple rows of the earlier defined matrix. This helps to add visual distinction between parts of the window. Its other use is to prevent all frames from trying to fit in 1 general grid which make frames jump too much to the right sometimes. Putting them in a “box of rows” will make a subgrid in which they will try to fit.<br>
To this end the function <code>.combine.rows()</code> is used and the result is saved the <code>grid.rows</code> object. The only arguments which should be changed are <code>rows</code>, <code>title</code> and <code>border</code>. Note that this can be done multiple times to put multiple rows in different boxes.</p>
<p>Making the second tab will be completly similar to steps described with the only differences being the <code>input</code> variable set to <code>&quot;plotdiagTab&quot;</code> and the option of adding <code>manual buttons</code>.</p>
<h4>Workflow of creating of a new method window</h4>
<p>This is how a general workflow of creating a new window would look like:</p>
<ol>
<li>Open <code>newmethod_script.R</code> and start adjusted the information variables in the beginning (as well as the name of <code>newmethod_WINDOW</code>).</li>
<li>Open <code>frames_script.R</code> and start applying the 3 window steps for both tabs while copy pasting default frames from <code>frames_script.R</code></li>
<li>Run the window function while the BiclustGUI is launched and check if the design is correct.</li>
<li>Send your new method addition to the maintainer of the BiclustGUI:
<ul>
<li>The script(s) of your new window(s).</li>
<li>A function that transforms the output of your biclustering algorithm to the <code>Biclust-class</code> in the <code>biclust</code> package. This is a S4 object in which the most important slots are <code>RowxNumber</code>, <code>NumberxCol</code> and <code>Number</code>. Providing this transformation function will make sure both the functions from <code>BcDiag</code> and <code>superbiclust</code> immediately work with your new method in the framework of the GUI.</li>
</ul>
</li>
</ol>
<h4>Window creation examples</h4>
<p>In the BiclustGUI, all included biclustering and diagnostics packages are already implemented in the GUI by using these scripts. So for more examples, you could always take inspiration from the source code of the GUI, since they will follow the same script as explained above. The vignette itself also includes some more examples.</p>
<p>To finalize this probably way too elaborate section about window creating, let’s take a look at some excerpts of the script which created the Plaid window!</p>
<p>The script starts with adapting the general information so that the variables fit for the Plaid algorithm.</p>
<div>
<pre><code><span>#####################################################
## GENERAL INFORMATION ABOUT THE NEW METHOD/WINDOW ##
#####################################################
</span><span>methodname</span><span> </span><span>&lt;-</span><span> </span><span>&quot;Plaid&quot;</span><span>
</span><span>methodfunction</span><span> </span><span>&lt;-</span><span> </span><span>&quot;biclust&quot;</span><span>
</span><span>data.arg</span><span> </span><span>&lt;-</span><span> </span><span>&quot;x&quot;</span><span>
</span><span>data.matrix</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>other.arg</span><span> </span><span>&lt;-</span><span> </span><span>&quot;,method=BCPlaid()&quot;</span><span>
</span><span>methodhelp</span><span> </span><span>&lt;-</span><span> </span><span>&quot;BCPlaid&quot;</span><span>
</span><span>methodseed</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>data.discr</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span>data.bin</span><span> </span><span>&lt;-</span><span> </span><span>FALSE</span><span>
</span><span>bcdiag.comp</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span><span>superbiclust.comp</span><span> </span><span>&lt;-</span><span> </span><span>TRUE</span><span>
</span></code></pre>
</div>
<p>Next, we go on to step 1 of the first tab, defining the frames. In the figure below you can find 2 examples of these frames and how it would look like in the final interface.</p>
<p><img src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/plaid_clusterbuild.png?w=90%25" data-recalc-dims="1"></p>
<p>Once step 1 is completed, we head over to step 2 and 3 to configure the grid and create 2 boxes around row 1 and row 2 and 3.</p>
<div>
<pre><code><span>### 2. CONFIGURING THE GRID ###
</span><span>grid.config</span><span> </span><span>&lt;-</span><span> </span><span>.grid.matrix</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>c</span><span>(</span><span>&quot;toclusterframe&quot;</span><span>,</span><span>
</span><span>&quot;modelframe&quot;</span><span>,</span><span>&quot;backgroundcheckframe&quot;</span><span>,</span><span>NA</span><span>,</span><span>
</span><span>&quot;backgroundentryframe1&quot;</span><span>,</span><span>&quot;backgroundentryframe2&quot;</span><span>),</span><span>byrow</span><span>=</span><span>
</span><span>TRUE</span><span>,</span><span>nrow</span><span>=</span><span>3</span><span>,</span><span>ncol</span><span>=</span><span>2</span><span>,</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span><span>### 3. COMBING THE ROWS ###
</span><span>grid.rows</span><span> </span><span>&lt;-</span><span> </span><span>.combine.rows</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>rows</span><span>=</span><span>c</span><span>(</span><span>1</span><span>),</span><span>title</span><span>=</span><span>
</span><span>&quot;Plaid Specifications&quot;</span><span>,</span><span>border</span><span>=</span><span>TRUE</span><span>,</span><span>grid.rows</span><span>=</span><span>grid.rows</span><span>,</span><span>
</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span><span>grid.rows</span><span> </span><span>&lt;-</span><span> </span><span>.combine.rows</span><span>(</span><span>input</span><span>=</span><span>input</span><span>,</span><span>rows</span><span>=</span><span>c</span><span>(</span><span>2</span><span>,</span><span>3</span><span>),</span><span>title</span><span>=</span><span>
</span><span>&quot;Layer Specifications&quot;</span><span>,</span><span>border</span><span>=</span><span>TRUE</span><span>,</span><span>grid.rows</span><span>=</span><span>grid.rows</span><span>,</span><span>
</span><span>grid.config</span><span>=</span><span>grid.config</span><span>)</span><span>
</span></code></pre>
</div>
<p>The same 3 steps are repeated for the second tab which will now include buttons as well. The following figure shows how the heatmap button pulls its arguments from 2 different frames, a checkbox and entry field.</p>
<p><img src="https://i1.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/plaid_plotdiagbuild.png?w=90%25" data-recalc-dims="1"></p>
<p>At the end everything comes together again in the <code>cluster_template()</code> function which marks the end of the script.</p>
<h3>The Shiny App</h3>
<p>For those not interested in the R-code behind the biclustering algorithms or maybe for those who would like to introduce non-statisticians to biclustering, we have also created a shiny application which includes all of the currently implemented biclustering methods in the BiclustGUI.<br>
It is possible to draw heatmaps, profile plots and export your results. However for other diagnostics or the <code>superbiclust</code> method (= combining many biclustering results into robust biclusters), you will have to fall back to the original BiclustGUI in R Commander. (We do plan to include superbiclust in some form in the future.)</p>
<p>The Shiny App is available:</p>
<ol>
<li>online on the <a target="_blank" href="https://uhasselt.shinyapps.io/shiny-biclust/">Shiny Cloud</a> (currently only with limited resources!){:target=”_blank”}.</li>
<li>as a <strong>stand-alone version</strong> right <a target="_blank" href="https://ibiostat.be/online-resources/online-resources/biclustgui/shinyapp">here</a> (<a target="_blank" href="https://ibiostat.be/online-resources/online-resources/biclustgui/biclust-shiny-standalone/biclustshiny_standalone_1-0.1">Direct Link</a> for version 1.0.1).
<ul>
<li>Download the zip-file, extract and doubleclick <code>LAUNCH.vbs</code>.</li>
</ul>
</li>
</ol>
<p><img alt="Shiny App - iBBiG" src="https://i0.wp.com/ewouddt.github.io/RcmdrPlugin.BiclustGUI/img/biclustGUI_images/shinyibbig.png?w=100%25" data-recalc-dims="1"></p>
<p>
Shiny App – iBBiG
</p>
<h3>The REST Package</h3>
<p>A side-product of the BiclustGUI project came in the form of another R package, <a target="_blank" href="https://cran.r-project.org/web/packages/REST/index.html">REST</a> (<strong>R</strong>cmdr <strong>E</strong>asy <strong>S</strong>cript <strong>T</strong>emplates), a <strong>tool to create R Commander GUI Plug-in’s</strong>. It is currently also available on CRAN.<br>
For this package, we basically took the template scripts (which were specific for biclustering), generalized them and added some extra functionality.</p>
<p>This package is by no means as flexible or powerful as <code>shiny</code>, but it does provide you a quick, easy and no-nonsense way to create a <strong>R Commander plug-in</strong> for your own analysis or R package while not having to bother about any <code>tlctk</code> syntax.</p>
<p>Essentialy it would be possible to completely recreate the BiclustGUI using the REST package.</p>
<h3>Book Project</h3>
<p>For those interested in more information on the Biclust GUI, I refer to the elaborate <a target="_blank" href="https://cran.r-project.org/web/packages/RcmdrPlugin.BiclustGUI/vignettes/GuideBiclustGUI.pdf">vignette</a> included in the BiclustGUI package.</p>
<p>The GUI will also be featured in the upcoming book <em>Applied Biclustering Methods for Big and High Dimensional Data Using R</em> by Kasim, A., Shkedy, Z., Kaiser, S., Hochreiter, S. and Talloen, W. (28th of September 2016). The book handles various applications of biclustering in gene expression experiments, chemoinformatics, molecular modelling, etc. More information can be found <a target="_blank" href="https://ibiostat.be/online-resources/online-resources/biclustgui/bookproject">here</a>.</p>
<h3>Contact</h3>
<p>Please direct any <strong>questions/suggestions/bugs</strong> to <code>ewoud.detroyer[at]uhasselt.be</code>.</p>
<p>We are happy to take any feedback!</p>
<p>[1] Currently the vignette on CRAN still shows version 1.0.4. A more updated vignette can be found inside the package itself in version 1.0.6.</p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/introduction-to-biclustgui/"></div></div><div><a data-url="https://www.r-bloggers.com/introduction-to-biclustgui/" data-counturl="https://www.r-bloggers.com/introduction-to-biclustgui/" data-count="vertical" data-text="Introduction to BiclustGUI" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ewouddt.github.io/RcmdrPlugin.BiclustGUI/2016/09/27/biclustGUI/"> BiclustGUI - r</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/3uP4R_tKnSs"></a></div>