Requirements
The method is encoded in two Perl scripts, and we provide several R scripts to run them and perform the analysis. If you haven’t used Perl in the past no worries, it is a language similar to R and you just need to have a Perl interpreter installed in your computer. Running the scripts is then easy and do not require any further installation. The whole pipeline can be run with a single R function once Perl is installed. See the Vignette for further details.
Most Unix distributions come with a Perl interpreter so you will possibly not need to install anything, if you are running a different OS you can find more information in this page on how to install Perl in your comp.
The script uses two modules (POSIX
and Scalar::Util
) and the latter may not come installed alongside your Perl native installation. An easy way to install modules is via CPAN. Once you have CPAN installed you can install modules (see this post for more details and installation in operating systems different than Linux and this post for other alternatives in Linux).
We show how to install the module required. In Linux, first open a CPAN shell:
$> sudo perl -MCPAN -e shell
And then install, the required module:
$CPAN> install Scalar::Util
To use the R function provided you will need to have installed the package ggplot2
to represent the partition density curves.
Clone the repo
Once you installed the modules described above and the Perl interpreter, you could simply download the scripts mentioned in the main page overview from the repository. If you want to follow the Vignette, it is easier to directly clone the repository in your computer:
$> git clone https://github.com/apascualgarcia/functionInk.git
We then go to the root of the repository:
$> cd path_to_the_repository
And we give permission to execute the scripts:
$> chmod 755 NodeLinkage.pl NodeSimilarity.pl
Test the scripts
We start testing the script to create the similarity matrix between nodes. In the directory fake_example
we
have a small network for testing. We run (from the root of the directory):
./NodeSimilarity -w 1 -d 1 -t 1 -f fake_example/network1.tsv
After running, you should find the file Nodes-Similarities_network1.tsv
in your folder, containing the similarities. We now test the agglomerative clustering:
./NodeLinkage.pl -fs Nodes-Similarities_network1.tsv -fn fake_example/network1.tsv
with no options it creates the files HistExtend-NL_Average_NoStop_network1.tsv
and HistCompact-NL_Average_NoStop_network1.tsv
. Now we test that it works with more options, we make it stop at step 2 of the clustering:
./NodeLinkage.pl -fs Nodes-Similarities_network1.tsv -fn fake_example/network1.tsv -s step -v 2
And you will find four more files with the label StopStep-2
. Now you may want to go to the Vignette for a more spicy example with further explanations.