EI-CoreBioinformatics / mikado

Mikado is a lightweight Python3 pipeline whose purpose is to facilitate the identification of expressed loci from RNA-Seq data * and to select the best models in each locus.
https://mikado.readthedocs.io/en/stable/
GNU Lesser General Public License v3.0
97 stars 18 forks source link

fix: pin mikado python dependencies #453

Closed gemygk closed 5 months ago

gemygk commented 5 months ago

pin mikado python dependencies to fix issues with installation #444, #445, #448, #451

DustinSokolowski commented 2 months ago

Hey!

Thank you for doing this. I am still having all of the issues found in the previous issues you have listed. I also noticed that 0/12 of the automatic checks were passed here.

Is there any chance that you can share the commands needed to install mikado with a fresh environment?

gemygk commented 2 months ago

Hi @DustinSokolowski

I'm sorry for not getting back to you sooner.

You can run the below commands to get Mikado installed in a fresh environment.

I would recommend we install Mikado into a clean Mamba installation (tested on Python 3.9)

Install mamba with PyPy 3.9 in the base environment (https://github.com/conda-forge/miniforge?tab=readme-ov-file#miniforge-pypy3)

/path/to/src
[src]$ wget -c https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-Linux-x86_64.sh
[src]$ bash Miniforge-pypy3-Linux-x86_64.sh

I have installed the base to /path/to/x86_64/ location

If you have chosen to not have conda modify your shell scripts at all, to activate conda's base environment in your current shell session, please do:

/path/to/src
[src]$ eval "$(/path/to/x86_64/bin/conda shell.bash hook)"

Install Git

/path/to/src
(base) [src]$ mamba install -y git

Clone mikado

/path/to/src
(base) [src]$ git clone git@github.com:EI-CoreBioinformatics/mikado.git
(base) [src]$ cd mikado

Install Mikado dependencies

/path/to/src/mikado
(base) [mikado]$ mamba env create -f environment.yml --prefix /path/to/x86_64/envs/mikado_env

Activate mikado_env

/path/to/src/mikado
(base) [mikado]$ conda activate mikado_env
(mikado_env) [mikado]$

Do checks if all dependencies are installed

/path/to/src/mikado
(mikado_env) [mikado]$ pip3 install wheel
(mikado_env) [mikado]$ pip3 install -r requirements.txt
(mikado_env) [mikado]$ pip3 install Cython

We need gcc for bdist_wheel (tested on gcc v5.2.0)

/path/to/src/mikado
(mikado_env) [mikado]$ python3 setup.py bdist_wheel
(mikado_env) [mikado]$ pip3 install dist/*.whl

Now that installation is complete, run Mikado help

/path/to/src/mikado
(mikado_env) [mikado]$ mikado -h
usage: Mikado [-h] [--version] {configure,prepare,serialise,pick,compare,util} ...

Mikado is a program to analyse RNA-Seq data and determine the best transcript for each locus in accordance to user-specified criteria.

optional arguments:
  -h, --help            show this help message and exit
  --version             Print Mikado current version and exit.

Components:
  {configure,prepare,serialise,pick,compare,util}
                        These are the various components of Mikado:
    configure           This utility guides the user through the process of creating a configuration file for Mikado.
    prepare             Mikado prepare analyses an input GTF file and prepares it for the picking analysis by sorting its transcripts and performing some simple consistency checks.
    serialise           Mikado serialise creates the database used by the pick program. It handles Junction and ORF BED12 files as well as BLAST XML results.
    pick                Mikado pick analyses a sorted GTF/GFF files in order to identify its loci and choose the best transcripts according to user-specified criteria. It is dependent on files produced by the "prepare" and "serialise"
                        components.
    compare             Mikado compare produces a detailed comparison of reference and prediction files. It has been directly inspired by Cufflinks's cuffcompare and ParsEval.
    util                Miscellaneous utilities

Please get in touch if you have any issues

Best, Gemy

DustinSokolowski commented 2 months ago

Dear Gemy,

Thank you so much for the thorough reply. I will try this right now and get back to you

Dustin

DustinSokolowski commented 2 months ago

Dear Gemy,

Thank you again for sending this info. All of the dependencies look fine but I do not see the mikado executable itself. Is the final step to install mikado with pip? Or should mikado be present?

I don't see mikado on the requirements.txt

Alternatively, should I run python3 setup.py on it's own to setup "Mikado"?

Thanks, Dustin

gemygk commented 2 months ago

Hi @DustinSokolowski Thank you for letting me know that Mikado dependencies were installed successfully.

Now, as explained earlier, we need to run the below commands to install the Mikado executable to your path. I am assuming you have done until the Do checks if all dependencies are installed section.

We need gcc for bdist_wheel (tested on gcc v5.2.0)

/path/to/src/mikado
(mikado_env) [mikado]$ python3 setup.py bdist_wheel
(mikado_env) [mikado]$ pip3 install dist/*.whl
dsokolo commented 2 months ago

Dear Gemy,

Sorry I have should have been clearer. I ran those setup commands and I am still unable to execute mikado. I'll try a couple more times and hopefully be able to update with an error message.

Best, Dustin

DustinSokolowski commented 2 months ago

Hey Again,

I re-ran the commands and the behaviour is a bit strange.

pip installs and is able to recognize mikado Mikado is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

Despite this, I am unable to find mikado as an executable or in my path.

Screenshot 2024-09-06 at 12 06 47 AM

I also can't seem to find it in ~/miniforge-pypy3/envs/mikado_env/bin

I do see some warnings in the setup.py script, such as an inability to find a json file

warning: no files found matching '*json' under directory 'Mikado'
warning: no previously-included files matching '*' found under directory 'docs'
warning: no previously-included files matching '*' found under directory 'tests/__pycache__'
adding license file 'LICENSE.txt'
adding license file 'AUTHORS'
writing manifest file 'Mikado.egg-info/SOURCES.txt'

Could the potential issue be higher up? I've attached the messages from "setup" and "install" in hopes that it can find something.

mikado install wheel.txt mikado istallation messages - setup.txt

I apologize if I am missing something super obvious.

Best, Dustin

gemygk commented 2 months ago

Hi @DustinSokolowski

Thanks for attaching the logs. Could you please attach the commands you have used from the beginning, so that I can look at it in detail, please? Also include the version of GCC you are using, like gcc --version.

Best, Gemy

DustinSokolowski commented 2 months ago

Certainly, here it is. I had to install mamba not to home because my cluster only gets 10Gb there.

 wget -c https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge-pypy3-Linux-x86_64.sh
 bash Miniforge-pypy3-Linux-x86_64.sh

-enter
-/.mounts/labs/simpsonlab/users/dsokolowski/projects/annotation_pipeline/external/my_mikado/miniforge-pypy3 
-yes

 CLOSE TERMINAL AND OPEN A NEW ONE

mamba install -y git

git clone https://github.com/EI-CoreBioinformatics/mikado

cd mikado

mamba env create -f environment.yml --prefix /path/to/x86_64/envs/mikado_env

conda activate mikado_env

 # Checkes
pip3 install wheel
pip3 install -r requirements.txt
pip3 install Cython

# We need gcc for bdist_wheel (tested on gcc v5.2.0)

python3 setup.py bdist_wheel
pip3 install dist/*.whl

No obvious errors, just for whatever reason no mikado executable.

gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Best! Dustin

gemygk commented 1 month ago

Hi @DustinSokolowski

Thank you for passing on the commands. Sorry for the delay, I just got time to return to this.

I did test the commands again and all works fine at my end.

Can you please attach the commands from your terminal screen here from the beginning? I would suggest doing a fresh installation so that I can see all the commands you have used.

Best, Gemy

gemygk commented 1 month ago

Hi @DustinSokolowski

I have added additional methods for you to install Mikado (via Docker, Singularity and Conda/Mamba ), please refer to the updated ReadMe installation steps here.

Please let me know how it goes.

Best, Gemy

DustinSokolowski commented 1 month ago

Hey Gemy,

Good timing, we were pivoting to generating a docker image for 2.3.2, which we managed to get installed with some efford. I'll try the singularity in the next couple days and update you.

Thanks so much, Dustin