Skip to main content

Phables: Phage bubbles resolve bacteriophage genomes in viral metagenomic samples

Project description

phables logo

Phables: Phage bubbles resolve bacteriophage genomes in viral metagenomic samples

CI GitHub Code style: black

Phables is a tool developed to resolve bacteriophage genomes using phage bubbles in viral metagenomic data. It models cyclic phage-like components in the viral metagenomic assembly as flow networks, models as a minimum flow decomposition problem and resolves genomic paths corresponding to flow paths determined. Phables uses the Minimum Flow Decomposition via Integer Linear Programming implementation to obtain the flow paths.

For detailed instructions on installation and usage, please refer to the documentation hosted at Read the Docs.

NEW: Phables is now available on PyPI at

phables workflow

Setting up Phables

If you directly installed Phables from PyPI, you can skip the next two steps and go to Setting up Gurobi.

Downloading Phables

You can clone the Phables repository to your machine.

git clone

Now go into the phables folder using the command

cd phables/

Installing Phables

We recommend that you use conda to install and run. Once you have installed conda, make sure you are in the phables folder. Now run the following commands to create a conda environment and activate it to run Phables.

conda env create -f environment.yml
conda activate phables

If you prefer to use pip instead of conda, you can run the following command to install Phables using pip. Make sure you are in the phables folder.

pip install .

Setting up Gurobi

The MFD implementation uses the linear programming solver Gurobi. The phables conda environment and pip setup already include Gurobi. To handle large models without any model size limitations, you have to activate the (academic) license and add the key using the following command.

grbgetkey <KEY>

Please refer to further instructions at

Test the setup

After setting up, run the following command to ensure that Phables is working.

phables --help

Example usage

phables -g assembly_graph.gfa -p assembly_info.txt -hm edges.fasta.hmmout -ph phrog_annot.tsv -c coverage.tsv -b bam_files/ -o /output/path/

Please refer to the documentation hosted at Read the Docs for further information on how to obtain/format the inputs.

Reporting Issues

Phables is still under testing. If you want to test (or break) Phables give it a try and report any issues and suggestions under Phables Issues.


Phables uses the Gurobi implementation of MFD-ILP and code snippets from STRONG, METAMVGL, GraphBin and MetaCoAG.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phables-0.1.0a1.tar.gz (322.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page