FunCoup 6 is a functional association network tool developed using Python (v3.10.8) and the Django (v4.1.1) framework. It processes biological data to train networks and visualize results in a web application. The data is stored in a PostgreSQL database, and the frontend leverages Bootstrap and D3.js to provide an interactive user experience. FunCoup 6 is containerized and deployed using Docker and Docker Compose for seamless development and production environments.
- FunCoup/data/: Contains the backend components, including
dataCollectionanddataTraining. These modules are responsible for collecting and scoring the data, and for training the networks using bin-free redundancy weighting and naive Bayesian statistics.dataQuerycontains scripts to query the database.networkAnalysiscontains scripts to get pathway/tissue gene annotations, as well as performing orthology-transfering of whole networks for 618 InparanoiDB 9 species. - FunCoup/website/: Contains the frontend components, built using Python, JavaScript, HTML, and CSS. It utilizes Bootstrap components for UI and D3.js for drawing the network for each query.
- FunCoup/config/: Stores configuration files for species, gold standards, evidences, and parameters. These configuration files are specific to each database and website instance.
- results/: Stores the results of the analysis performed for the paper, which is currently available as a preprint on bioRxiv at https://doi.org/10.1101/2024.09.13.612391. To be able to download this folder, install Git LFS by following the installation instructions for your operating system: Installing Git LFS. Descriptive statistics and benchmarking are performed using R (v4.3.2). To reproduce this analysis, a Conda environment
r4_envneeds to be set up by runningconda env create -f results/environment.ymlandconda activate r4_env. Please, refer to this bitbucket repo to download all data and results if you want to reproduce the results
For security reasons, database tokens are not included in this repository. You will need to manually add the necessary tokens and credentials to the following files:
- FunCoup/settings_repo.py
- docker-compose_repo.yml
-
Database Password: The database password can be anything you choose. For example, you can set it to
"ABCDEF12345". -
Django Secret Key: To generate a secret key for the Django application, you can use the following command:
from django.core.management.utils import get_random_secret_key get_random_secret_key()
This will return something like:
"*so8ywzt)p7!aw%k9a+icwtcf+g++5s33n+t!s-c*+n(t+lb(u" -
File Renaming: After updating the tokens:
- Rename
FunCoup/settings_repo.pytoFunCoup/settings.py. - Rename
docker-compose_repo.ymltodocker-compose.yml.
- Rename
FunCoup is implemented in Python and tested within a version-controlled Conda environment. To set up the environment, clone the FunCoup repository, and install Miniconda. Then, generate the required environment with:
conda env create -f environment.ymlActivate the environment before running FunCoup:
conda activate pyfuncoupTo update the environment after modifying environment.yml:
conda env update -f environment.yml --pruneIf you want to export the Conda environment:
conda env export --name pyfuncoup --no-builds | grep -v "prefix" > environment.ymlFunCoup 6 runs on a PostgreSQL database, which must be started within a Docker container before launching the application. The container is defined in the docker-compose.yml file.
To install Docker on Ubuntu, follow the instructions here.
Once Docker is installed, start the database with:
sudo docker compose up -dThe database stores its files in the database/ directory. Ensure this directory is not checked into Git as it may grow large over time. To transfer the database between machines, copy the database directory and start the container on the new machine.
To access the database manually using psql, install the PostgreSQL client and connect as follows (credentials are stored in docker-compose.yml):
psql -U FunCoup -h localhost FunCoupThe main file for running FunCoup is funCoup.py. This script provides several functionalities, including generating instances, training networks, constructing networks, generating statistics, and running network analysis.
You can run the following commands from funCoup.py:
-
To generate an instance by fetching data or using existing data from the database:
python funCoup.py -g --configDir <config_directory>
-
To train and construct a network from an instance:
python funCoup.py -t --configDir <config_directory>
-
To perform network analysis from an instance:
python funCoup.py -a --configDir <config_directory>
-
To generate statistics for the database:
python funCoup.py -s --configDir <config_directory>
FunCoup also offers a Cytoscape app connected to its API. The app is available as a JAR file at Bitbucket and can be downloaded from the Cytoscape App Store. The preprint for this application is available on bioRxiv at https://doi.org/10.1101/2024.10.04.616627.
FunCoup 5 can be reached at https://funcoup5.scilifelab.se.
- Davide Buzzao (davide.buzzao@scilifelab.se)
- Erik L.L. Sonnhammer (erik.sonnhammer@scilifelab.se)
