PombertLab / SYNY

The SYNY pipeline investigates synteny between species by reconstructing protein clusters from gene pairs.
MIT License
29 stars 4 forks source link

Any chance to install via conda? #2

Closed AntonioBaeza closed 2 months ago

AntonioBaeza commented 3 months ago

Any chance to install via conda?

Pombert-JF commented 3 months ago

Will have to look into it. I'm not very familiar with Conda. Currently looking at implementing a sudo-free installation.

AntonioBaeza commented 3 months ago

Thank you! A sudo-free installation will be great. If by Conda even better to make the program available to beginners, intermediate users! Best

Pombert-JF commented 3 months ago

Quick update: not quite a conda-forge/bioconda package release, but now works without sudo (see below). The Circos release in bioconda misbehaves if installed at the same time as minimap2/mashmap/diamond (due to clashes between dependencies). Works fine however if installed from its binaries once its dependencies are installed.

### Tested on Ubuntu-22.04.3 LTS (WSL2)

##########################################################################################
##### Installing Miniconda
##########################################################################################

# https://docs.anaconda.com/free/miniconda/index.html

CONDA_DIR=$HOME     ## Replace by desired conda installation directory

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -P $CONDA_DIR
chmod +x $CONDA_DIR/Miniconda3-latest-Linux-x86_64.sh
$CONDA_DIR/Miniconda3-latest-Linux-x86_64.sh

## Do you wish to update your shell profile to automatically initialize conda? => yes

rm $CONDA_DIR/Miniconda3-latest-Linux-x86_64.sh
exit

## Reopen shell

## Installing the libmamba solver (faster solves)
# https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda config --set auto_activate_base false

##########################################################################################
##### Creating a conda environment for SYNY
##########################################################################################

INSTALL_DIR=$HOME/SYNTENY   # Replace by desired installation directory
CONFIG=~/.profile           # Desired configuration file

conda create --name syny
conda activate syny

conda config --add channels bioconda
conda config --add channels conda-forge 

## Python / Perl dependencies
conda install --yes \
  matplotlib \
  pandas \
  seaborn \
  scipy \
  libgd \
  perl-perlio-gzip \
  perl-getopt-argvfile \
  perl-clone \
  perl-config-general \
  perl-font-ttf \
  perl-list-moreutils \
  perl-math-bezier \
  perl-math-round \
  perl-math-vecstat \
  perl-params-validate \
  perl-readonly \
  perl-regexp-common \
  perl-set-intspan \
  perl-statistics-basic \
  perl-SVG \
  perl-text-format \
  perl-gd 

## alignment/homology tools
conda install --yes \
  minimap2">=2.28" \
  mashmap">=3.1.3" \
  diamond">=2.1.9"

## Installing Text::Roman manually => not found in conda repositories
mkdir -p $INSTALL_DIR/PERL5
wget https://cpan.metacpan.org/authors/id/S/SY/SYP/Text-Roman-3.5.tar.gz -P $INSTALL_DIR
tar -zxvf $INSTALL_DIR/Text-Roman-3.5.tar.gz -C $INSTALL_DIR
mv $INSTALL_DIR/Text-Roman-3.5/lib/* $INSTALL_DIR/PERL5/
rm -R $INSTALL_DIR/Text-Roman-3.5*

conda env config vars set PERL5LIB=$PERL5LIB:$INSTALL_DIR/PERL5
conda activate syny

## Installing Circos (outside conda)
wget \
  --no-check-certificate \
  https://circos.ca/distribution/circos-0.69-9.tgz \
  -P $INSTALL_DIR \

tar -zxvf $INSTALL_DIR/circos-0.69-9.tgz -C $INSTALL_DIR && rm $INSTALL_DIR/circos-0.69-9.tgz
echo "export PATH=\$PATH:$INSTALL_DIR/circos-0.69-9/bin" >> $CONFIG

## Installing Syny (outside conda)
git clone https://github.com/PombertLab/SYNY.git $INSTALL_DIR/SYNY
echo "export PATH=\$PATH:$INSTALL_DIR/SYNY" >> $CONFIG
source $CONFIG

##########################################################################################
##### Completion => should be ready to run
##########################################################################################

conda activate syny
AntonioBaeza commented 3 months ago

Thank you, I will try soon! Best

Pombert-JF commented 3 months ago

Created a SYNY.yaml file to simplify things + added a section titled "Installing dependencies with Conda (does not require sudo privileges)" to the Readme.

Pombert-JF commented 2 months ago

SYNY (version 1.1a) is now available in conda (took me a while to work out the kinks). Tested the conda release in a fresh Ubuntu VM; ran without issue.

To install syny with conda:

# Creating a conda environment
conda create -n syny  

# Activating the conda environment
conda activate syny

## Installing syny within the conda environment
conda install syny -c conda-forge -c bioconda 

WIll mark this issue as resolved but let me know if you encounter issue(s).

AntonioBaeza commented 2 months ago

Thank you!!!