Home

Awesome

VirSorter

Source code of the VirSorter App, available on CyVerse (https://de.iplantcollaborative.org/de/)

NOTE - VirSorter 2 is now available for early access/testing -> see https://github.com/jiarong/VirSorter2

Publication

Result files

The main output files of VirSorter are:

VirSorter results can be imported into Anvi'o by following these instructions.

VirSorter results can also be imported into R by following these instructions.

Using a conda virtual environment (tested on Ubuntu and CentOS)

wget https://zenodo.org/record/1168727/files/virsorter-data-v2.tar.gz
md5sum virsorter-data-v2.tar.gz
# md5sum should return dd12af7d13da0a85df0a9106e9346b45
tar -xvzf virsorter-data-v2.tar.gz
conda create --name virsorter -c bioconda mcl=14.137 muscle blast perl-bioperl perl-file-which hmmer=3.1b2 perl-parallel-forkmanager perl-list-moreutils diamond=0.9.14
git clone https://github.com/simroux/VirSorter.git
cd VirSorter/Scripts
make clean
make
ln -s ~/Applications/VirSorter/wrapper_phage_contigs_sorter_iPlant.pl ~/miniconda/envs/virsorter/bin
ln -s ~/Applications/VirSorter/Scripts ~/miniconda/envs/virsorter/bin
cd ~/miniconda/envs/virsorter/bin
wget http://metagene.nig.ac.jp/metagene/mga_x86_64.tar.gz
tar -xvzf mga_x86_64.tar.gz

Alternatively, you can install MetaGeneAnnotator in the conda environment as follows (thxs Simone Pignotti for the tip !):

conda install --name virsorter -c bioconda metagene_annotator

To run VirSorter, type the following:

source activate virsorter
wrapper_phage_contigs_sorter_iPlant.pl -f assembly.fasta --db 1 --wdir output_directory --ncpu 4 --data-dir /path/to/virsorter-data

Note for Conda installation

If error: "ListUtil.c: loadable library and perl binaries are mismatched", this is a known conda issue, that can be fixed with the following steps: Create a file etc/conda/activate.d/update_perllib.sh in your conda environment folder including the following lines:

#!/bin/sh
export OLD_PERL5LIB=$PERL5LIB
export PERL5LIB=`pwd`/../../../lib/site_perl/5.26.2/

Then create a file etc/conda/deactivate.d/update_perllib.sh in your conda environment folder including the following lines:

#!/bin/sh
export PERL5LIB=$OLD_PERL5LIB

Note: you may have to create the folders "etc", "etc/conda", "etc/conda/activate.d/", and "etc/conda/deactivate.d/" (e.g. using mkdir) in your conda environment folder, as these are not always generated by default in every conda environment.

Note for Diamond

For users trying to use the "diamond" option, please verify that you download the latest version of the "data-dir" package (wget https://zenodo.org/record/1168727/files/virsorter-data-v2.tar.gz), as previous versions of the database did not include the diamond database file.

Docker - from DockerHub (v1.0.5)

wget https://zenodo.org/record/1168727/files/virsorter-data-v2.tar.gz
md5sum virsorter-data-v2.tar.gz
#m5sum should return dd12af7d13da0a85df0a9106e9346b45
tar -xvzf virsorter-data-v2.tar.gz
    $ docker run -v /host/path/to/virsorter-data:/data -v /host/path/to/virsorter-run:/wdir -w /wdir --rm simroux/virsorter:v1.0.5 --db 2 --fna Input_contigs.fna

After "virsorter:v1.0.5", the options correspond to the ones described in wrapper_phage_contigs_sorter_iPlant.pl (here selecting the database "Viromes" and pointing VirSorter to the file "Input_contigs.fna").

    $ docker run --user `id -u` -v /host/path/to/virsorter-data:/data -v /host/path/to/virsorter-run:/wdir -w /wdir --rm simroux/virsorter:v1.0.5 --db 2 --fna Input_contigs.fna

Docker - from DockerHub (v1.0.3)

After "virsorter:v1.0.3", the options correspond to the ones described in wrapper_phage_contigs_sorter_iPlant.pl (here selecting the database "Viromes" and pointing VirSorter to the file "Input_contigs.fna").

Docker - building packages from scratch

Dependencies

Install the following into a "bin" directory:

Data Container

The 12G of dependent data exists as a separate data container called "virsorter-data."

This is the Dockerfile for that:

FROM perl:latest

MAINTAINER Ken Youens-Clark <kyclark@email.arizona.edu>

COPY Generic_ref_file.refs /data/

COPY PFAM_27 /data/PFAM_27

COPY Phage_gene_catalog /data/Phage_gene_catalog

COPY Phage_gene_catalog_plus_viromes /data/Phage_gene_catalog_plus_viromes

COPY VirSorter_Readme.txt /data

COPY VirSorter_Readme_viromes.txt /data

VOLUME ["/data"]

Then do:

$ docker build -t kyclark/virsorter-data .
$ docker create --name virsorter-data kyclark/virsorter-data /bin/true

Build

$ docker build -t kyclark/virsorter .

Run

A sample "run" command to use the current working directory for input/output:

$ docker run --rm --volumes-from virsorter-data -v $(pwd):/de-app-work \
-w /de-app-work kyclark/virsorter --fna Mic_1.fna --db 1

Authors

Simon Roux sroux@lbl.gov is the author of Virsorter

Ken Youens-Clark kyclark@email.arizona.edu packaged this for Docker/iPlant.

Bryan D Merrill bmerrill@stanford.edu provided the improvements and additions for v1.0.5