Installation

Download

BayesPI - Feature Learning Yard (FLY) is written in Python and can be installed and accessed via the command line. It is available for both Linux and macOS. The package can be downloaded from the BayesPI-Fly GitHub page.

Installation

It is highly recommended to create a separate virtual environment for the package to avoid any library conflicts. We recommend installing and using Miniconda/Anaconda (Miniconda). Refer to the the Conda website.

Before the installation, you can need to add the channels to your .condarc configuration file:

channels:
- conda-forge
- bioconda
- defaults

You can use the following command to add the channels:

$ conda config --add channels defaults
$ conda config --add channels bioconda
$ conda config --add channels conda-forge

If Miniconda is already installed, you can proceed with the following step-by-step installation.

1. Set Up New Environment

Option1: Use the .yml file.

This file specifies exact package versions to ensure compatibility and reproducibility. The YAML file for BayesPI_FLY is as follows:

 name: bpf_env
 channels:
 - conda-forge
 - bioconda
 - defaults

 dependencies:
- python=3.9.19
- numpy=1.23.0
- pandas=1.4.4
- seaborn=0.13.0
- matplotlib=3.8.4
- logomaker=0.8
# Create the environment with yml file
conda env create -f environment.yml --name  bpf_env

Option 2: Use requirements.txt

Alternatively, you can create the environment first and then install dependencies using requirements.txt which only contains the list of dependencies:

python==3.9.19
pip==24.2
numpy==1.23.0
pandas==1.4.4
seaborn==0.13.0
matplotlib==3.8.4
logomaker==0.8
# Step 1: Ensure the Correct Conda Channel Order Before create the environment, you need to checking the conda channel list,making `conda-forge` is listed above `bioconda`

# Check the current conda channel list
conda config --show channels

# Add channels (if not already present)
conda config --add channels bioconda
conda config --add channels conda-forge
# Step 2: Create the Environment
After figuring out the conda channel list, you can use the following command to create the environment:

# Create the environment
conda create --name bpf_env --yes

# Activate the environment
conda activate bpf_env

# Step 3: Install dependencies from requirements.txt using conda
conda install --yes --file requirements.txt

2. Package Setup

Once the environment is ready, navigate to the code directory (folder containing setup.py) and run the following command:

# Recommended installation method:
$ install -m pip install .

# Alternatively:
$ python setup.py install

After this you should be ready to use bpf Python package. You may try to see if everything is ready by running the following command:

$ bpf -h

The output should be something like this:

usage: bpf <task> [<args>]

Tasks available for using:

bayesPI                 The main functionality to study protein-DNA interactions, includes the estimation of a transcription factor (TF) binding energy matrices, the computation of binding affinity of a TF target site and the corresponding chemical potential.

interct2shape           Convert bayesPI predicted dinucleotide interaction matric to shape features matric

shape2interct           Convert bayesPI predicted shape features matric to dinucleotide interaction matric

shape_heatmap           Plot the heatmap based on the dinucleotide shape matric or dinucleotide interct matric

sequence_logo           Plot sequence markers based on modif likelihood files and add methylation intensity to the plot if needed

BayesPI - Feature Learning Yard (FLY)- bpf

positional arguments:
task        Pipeline task to run

optional arguments:
-h, --help  show this help message and exit

3. Run Demos

There are currently six demos avalible for using the BayesPI_FLY package. Demo data can be found in the demos folder. For more details, refer to the demo.html. Ensure that you create the output folder before running the demos.

# Navigate to the demo1 directory:
$ cd ../demos/demo1_motif/scripts

# Run the demo1 script:
$ ./job_demo1