bioinfo-biols / CIRIquant

circular RNA quantification tools
https://sourceforge.net/projects/ciri/files/CIRIquant
MIT License
27 stars 17 forks source link

Issue with EdgeR Installation in CIRIquant #59

Closed gkibt closed 7 months ago

gkibt commented 8 months ago

Dear the bioinfo-biols team,

I hope this message finds you well. I would like to express my appreciation for the convenient tool provided for circRNA analysis, CIRIquant. It has been a valuable asset for my research. However, I would like to report an issue I encountered while trying to install and use the tool.

The problem revolves around the installation of EdgeR, an essential component of CIRIquant. I faced difficulties while trying to install the latest version of EdgeR, specifically 'bioconductor-edger=3.28.0,' as per the instructions provided on the official website (https://ciri-cookbook.readthedocs.io/en/latest/CIRIquant_1_installation.html). I attempted all three methods outlined, but consistently encountered conflicts related to EdgeR.

To circumvent this issue, I resorted to a manual installation of all the required packages. Here is the step-by-step process I followed to install CIRIquant:

  1. I installed 'CIRIquant' using the following commands: conda create -n CIRI conda activate CIRI mamba install -y python=2.7.15 pip=20.0.2 perl=5.26.2;mamba install -y -c conda-forge r-statmod=1.4.35 r-base=3.6 r-optparse=1.6.6;pip install --upgrade pip;pip install CIRIquant; mamba install -y -c bioconda bwa=0.7.17;mamba install -y -c bioconda hisat2=2.2.0; mamba install -y -c bioconda stringtie=2.1.1;mamba install -y -c bioconda samtools; mamba install -y -c bioconda bioconductor-edger; mamba install -y -c bioconda bioconductor-limma=3.42.0

  2. Notably, during the installation, 'bioconductor-edger' was installed without explicitly specifying the version. Conda chose 'bioconductor-edger=3.14.0' for the installation.

  3. I was able to complete all the preceding steps of CIRIquant without any issues. However, when I reached the last step, 'CIRI_DE_replicate' for differential expression analysis, I encountered the same EdgeR problem again.

Upon further investigation, it became apparent that the issue was due to the unavailability of the 'locfit' package for R version 3.6. The latest version of 'locfit' requires R ≥ 4.1.0, creating a conflict with the installed R version.

As a workaround, I had to downgrade 'locfit' in R using the following commands, which allowed me to complete the last step of CIRIquant successfully and perform the differential expression analysis: install.packages("https://cran.r-project.org/src/contrib/Archive/locfit/locfit_1.5-9.4.tar.gz", repos=NULL, type="source") if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("edgeR")

I wanted to bring this issue to your attention as it may impact other users trying to install and utilize CIRIquant in similar environments. Your guidance or any updates regarding this problem would be greatly appreciated.

Thank you once again for providing the tool :D

Best regards, gkibt

Kevinzjy commented 8 months ago

Hi @gkibt ,

Thanks for the valuable feedback. This issue seems to be caused by the dependencies management strategy of R. Thus we could try packing a whole environment for running CIRIquant so users won't have to install these annoying R packages.

Best regards,

Jinyang Zhang

gkibt commented 8 months ago

Hello @Kevinzjy,

Thank you for your prompt response. Looking forward to any updates or solutions regarding the problem, and thanks in advance.

Best regards, gkibt

Kevinzjy commented 8 months ago

Hi @gkibt ,

As a temporary solution, I uploaded a packed conda environment of CIRIquant and its R dependencies that should be able to be easily deployed as follows:

# Download packed environment
wget https://github.com/bioinfo-biols/CIRIquant/releases/download/v1.1.2/CIRIquant_v1.1.2.tar.gz

# Unpack tar.gz file
mkdir -p CIRIquant_env
tar -zxvf CIRIquant_v1.1.2.tar.gz -C CIRIquant_env

# Activate environment
conda activate ./CIRIquant_env
which CIRIquant

Could you help me to confirm it works in your environment?

Thanks,

Jinyang Zhang

gkibt commented 8 months ago

Hello @Kevinzjy,

Thanks for your quick updates. I'll give it a try once I've finished my tasks.

With appreciation, gkibt

gkibt commented 7 months ago

Hello @Kevinzjy,

Thank you for providing the packed Conda environment for CIRIquant. I was able to activate the environment successfully and confirm that CIRIquant is working as expected.

(base)$ conda activate ./CIRIquant_env
(./CIRIquant_env) $ which CIRIquant
./CIRIquant_env/bin/CIRIquant

However, when I tried to run the test command mentioned in the documentation (https://ciri-cookbook.readthedocs.io/en/latest/CIRIquant_5_test.html#generate-hisat2-and-bwa-index), I encountered an issue.

(./CIRIquant_env) $ cd ./test_data/quant/
(./CIRIquant_env) $ bwa index -a bwtsw -p chr1.fa chr1.fa; hisat2-build ./chr1.fa ./chr1.fa
bash: bwa: command not found...
bash: hisat2-build: command not found...

It seems that the bwa and hisat2 packages are not included in the virtual environment. (Perhaps you will add these essential packages to the environment later?) For your reference, here is the list of packages in the activated environment:

$ conda list
# packages in environment at ./CIRIquant_env:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
_r-mutex                  1.0.1               anacondar_1    conda-forge
argparse                  1.2.1                    pypi_0    pypi
binutils_impl_linux-64    2.38                 h2a08ee3_1
binutils_linux-64         2.38.0               hc2dff05_0
bioconductor-edger        3.42.4            r43hf17093f_0    bioconda
bioconductor-limma        3.56.2            r43ha9d7317_0    bioconda
blas                      1.1                    openblas    conda-forge
bwidget                   1.9.14               ha770c72_1    conda-forge
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.20.1               hd590300_1    conda-forge
ca-certificates           2023.08.22           h06a4308_0
cairo                     1.16.0               hb05425b_5
certifi                   2020.6.20          pyhd3eb1b0_3
ciriquant                 1.1.2                    pypi_0    pypi
curl                      8.4.0                hdbd6064_0
expat                     2.5.0                h6a678d5_0
fontconfig                2.14.2               h14ed4e7_0    conda-forge
freetype                  2.12.1               h4a9f257_0
fribidi                   1.0.10               h7b6447c_0
gcc_impl_linux-64         11.2.0               h1234567_1
gcc_linux-64              11.2.0               h5c386dc_0
gettext                   0.21.1               h27087fc_0    conda-forge
gfortran_impl_linux-64    11.2.0              h7a446d4_16    conda-forge
gfortran_linux-64         11.2.0               hc2dff05_0
glib                      2.72.1               h6239696_0    conda-forge
glib-tools                2.72.1               h6239696_0    conda-forge
graphite2                 1.3.14               h295c915_1
gxx_impl_linux-64         11.2.0               h1234567_1
gxx_linux-64              11.2.0               hc2dff05_0
harfbuzz                  4.3.0                hf52aaf7_2
icu                       73.2                 h59595ed_0    conda-forge
jpeg                      9e                   h5eee18b_1
kernel-headers_linux-64   2.6.32              he073ed8_16    conda-forge
krb5                      1.20.1               h143b758_1
ld_impl_linux-64          2.38                 h1181459_1
lerc                      3.0                  h295c915_0
libblas                   3.9.0           19_linux64_openblas    conda-forge
libcurl                   8.4.0                h251f7ec_0
libdeflate                1.17                 h5eee18b_1
libedit                   3.1.20221030         h5eee18b_0
libev                     4.33                 h7f8727e_1
libffi                    3.4.4                h6a678d5_0
libgcc-devel_linux-64     11.2.0               h1234567_1
libgcc-ng                 13.2.0               h807b86a_2    conda-forge
libgfortran-ng            13.2.0               h69a702a_2    conda-forge
libgfortran5              13.2.0               ha4646dd_2    conda-forge
libglib                   2.72.1               h2d90d5f_0    conda-forge
libgomp                   13.2.0               h807b86a_2    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
liblapack                 3.9.0           19_linux64_openblas    conda-forge
libnghttp2                1.57.0               h2d74bed_0
libopenblas               0.3.24          pthreads_h413a1c8_0    conda-forge
libpng                    1.6.39               h5eee18b_0
libsqlite                 3.43.2               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-devel_linux-64  11.2.0               h1234567_1
libstdcxx-ng              13.2.0               h7e041cc_2    conda-forge
libtiff                   4.5.1                h6a678d5_0
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp-base              1.3.2                h5eee18b_0
libxcb                    1.16                 hd590300_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lz4-c                     1.9.4                h6a678d5_0
make                      4.3                  hd18ef5c_1    conda-forge
ncurses                   6.4                  h6a678d5_0
numexpr                   2.6.9                    pypi_0    pypi
numpy                     1.16.4                   pypi_0    pypi
openblas                  0.3.24          pthreads_h7a3da1a_0    conda-forge
openssl                   3.1.4                hd590300_0    conda-forge
pango                     1.50.7               h05da053_0
pcre                      8.45                 h295c915_0
pcre2                     10.42                hebb0a14_0
pip                       20.1.1             pyh9f0ad1d_0    conda-forge
pixman                    0.42.2               h59595ed_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pysam                     0.15.2                   pypi_0    pypi
python                    2.7.18               h42bf7aa_3
pyyaml                    5.1.1                    pypi_0    pypi
r-base                    4.3.1                h1ae530e_0
r-getopt                  1.20.4            r43h6115d3f_0
r-lattice                 0.22_5            r43h76d94ec_0
r-locfit                  1.5_9.8           r43h76d94ec_0
r-optparse                1.7.3             r43h142f84f_0
r-rcpp                    1.0.11            r43h884c59f_0
r-statmod                 1.5.0             r43h640688f_0
readline                  8.2                  h5eee18b_0
scikit-learn              0.20.3                   pypi_0    pypi
scipy                     1.2.2                    pypi_0    pypi
setuptools                44.0.0                   py27_0
sqlite                    3.43.2               h2c6b66d_0    conda-forge
sysroot_linux-64          2.12                he073ed8_16    conda-forge
tk                        8.6.13               h2797004_0    conda-forge
tktable                   2.10                 h14c3975_0
wheel                     0.37.1             pyhd3eb1b0_0
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.4.2                h5eee18b_0
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hc292b87_0

I would appreciate your guidance on the new updates so that I can proceed with the testing. Thank you in advance :D

Respectfully,

gkibt

Kevinzjy commented 7 months ago

Hi @gkibt , I included all dependencies as suggested. The installation guide is now also included in the documentation https://ciri-cookbook.readthedocs.io/en/latest/CIRIquant_1_installation.html#use-the-released-version.

gkibt commented 7 months ago

Hello @Kevinzjy,

Thank you for your assistance and for releasing the new version. I will give it a try when I have some time and inform you of the results once I finish the test.

Kind regards, gkibt

gkibt commented 7 months ago

Dear @Kevinzjy,

Thank you for your continued support. About the testing of the packed environments you provided, I tried some commands and encountered the following error messages:

-bash: ./CIRIquant_env/bin/CIRI_DE_replicate: /home/zhangjy/data/envs/CIRIquant/bin/python2.7: bad interpreter: No such file or directory

Upon checking the ./CIRIquant_env/bin/CIRI_DE_replicate file, I found the following content:

CIRI_DE_replicate

#!/home/zhangjy/data/envs/CIRIquant/bin/python2.7
# -*- coding: utf-8 -*-
import re
import sys
from CIRIquant.replicate import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Additionally, I've noticed that you've recently updated the CIRI_DE_replicate function to support mRNA DEG This enhancement is particularly helpful for my tasks, as they also require mRNA outputs.

However, upon attempting to rerun the CIRI_DE_replicate commands and even the CIRIquant_DE_replicate (which the updated version calls, as stated in the ciri-cookbook documentation ) I encountered difficulties. Despite updating my CIRIquant version to 1.1.3, I still received error messages as follows:

After installing version 1.1.3 by pip

CIRI_DE_replicate

$ CIRI_DE_replicate     --lib ./condition1/library_info_1.csv     --bsj ./condition1/circRNA_bsj_1.csv     --gene ./gene1/gene_count_matrix_1.csv     --out ciri_de_1.csv --out2 gene_de_1.csv
[Thu 2023-11-23 13:57:06] [INFO ] Library information: ./condition1/library_info_1.csv
[Thu 2023-11-23 13:57:06] [INFO ] circRNA expression matrix: ./condition1/circRNA_bsj_1.csv
[Thu 2023-11-23 13:57:06] [INFO ] gene expression matrix: ./gene1/gene_count_matrix_1.csv
[Thu 2023-11-23 13:57:06] [INFO ] Output circ DE results: ./ciri_de_1.csv
[Thu 2023-11-23 13:57:06] [INFO ] Output gene DE results: ./gene_de_1.csv
Error in `[.TestResults`(xj, i, , drop = FALSE) :
  unused argument (drop = FALSE)
Calls: [ -> [.data.frame -> [
Execution halted
[Thu 2023-11-23 13:57:41] [INFO ] Finished!

I obtained circRNA DEG outputs as before, but no gene DE results.

CIRIquant_DE_replicate

$ CIRIquant_DE_replicate  --lib ./condition1/library_info_1.csv     --bsj ./condition1/circRNA_bsj_1.csv     --gene ./gene1/gene_count_matrix_1.csv     --out ciri_de_1.csv --out2 gene_de_1.csv
bash: CIRIquant_DE_replicate: command not found...

I would greatly appreciate your insights and guidance on how to address these challenges.

Warm regards,

gkibt

Kevinzjy commented 7 months ago

Hi @gkibt , Thanks for the information. These problems have been resolved in the updated package (https://github.com/bioinfo-biols/CIRIquant/releases/tag/v1.1.3) . Could you try re-download the package and configure it according to the documentation (https://ciri-cookbook.readthedocs.io/en/latest/CIRIquant_1_installation.html#use-the-released-version-recommended)?

gkibt commented 7 months ago

Dear @Kevinzjy,

Thank you very much for your continued and rapid supports. I successfully installed the latest version following the procedures you provided and run both my tasks and the CIRI test files smoothly. I also obtained the mRNA DEG files without any issues.

Here were the outputs I got during the installation:

(base)$ cd ~;conda activate ./CIRIquant_env
(~/CIRIquant_env)$ which CIRIquant
~/CIRIquant_env/bin/CIRIquant
(~/CIRIquant_env)$ cd CIRIquant_env
(~/CIRIquant_env)$ make
Unpacking CIRIquant environment
conda-unpack
sed -i '1 s/^.*$/#!\/usr\/bin\/env python/' bin/CIRIquant
sed -i '1 s/^.*$/#!\/usr\/bin\/env python/' bin/CIRI_DE
sed -i '1 s/^.*$/#!\/usr\/bin\/env python/' bin/CIRI_DE_replicate
sed -i '1 s/^.*$/#!\/usr\/bin\/env python/' bin/prep_CIRIquant
Successfully configured CIRIquant package
(~/CIRIquant_env)$ conda deactivate
(base)$ cd ~;conda activate ./CIRIquant_env
(~/CIRIquant_env)$ which CIRIquant
~/CIRIquant_env/bin/CIRIquant

In addition, I have some suggestions to improve the installation process. It would be beneficial to include the following step:

#Activate CIRIquant environment and test
conda deactivate # I recommend adding this command before activating ./CIRIquant_env because without this step, I encountered an "EnvironmentLocationNotFound: Not a conda environment: ~/CIRIquant_env/CIRIquant_env" error.
conda activate ./CIRIquant_env
which CIRIquant

And it seems that you retained 'CIRI_DE_replicate' but not 'CIRIquant_DE_replicate', so you may have to revise the ciri-cookbook manual as follows:

usage: CIRIquant_DE_replicate [-h] --lib FILE --bsj FILE --gene FILE --out
                              FILE --out2 FILE

On another note, I have two personal questions regarding my tasks. Firstly, I would like to change my GTF annotation file in the YAML-formatted config file I used. However, I prefer not to realign my sequencing data again. Is it possible to use the --circ argument with my existing data? If so, what file should I input after --circ?

Secondly, will CIRIquant support CIRI_DE (no replicates) commands for mRNA DEG, similar to CIRI_DE_replicate, in the furure?

Thank you very much once again, and I hope you have a wonderful day.

Best regards,

gkibt

Kevinzjy commented 7 months ago

Hi @gkibt ,

Thanks for the feedback. Glad to know that the package finally works and I will revise the documentation very soon.

Regarding the mRNA DE analysis without replication, I would suggest you use the GFOLD (https://github.com/knowledgefold/gfold) software. The algorithm of CIRI_DE is also inspired by GFOLD.

Jinyang Zhang