urol-e5 / deep-dive-expression

Analyzing gene expression and gene/ncRNA coexpression in three species of stony coral. This work builds on completed summary of the ncRNA landscape of these species (deep-dive).
1 stars 0 forks source link

python/conda/biopython issues while runnign ShortStack #10

Closed shedurkin closed 1 month ago

shedurkin commented 1 month ago

I've been having some issues rerunning ShortStack for A.pulchra using the updatded genome (code here).

First, I was able to activate and load the ShortStack conda environment, but running ShortStack resulted in the error:

File "/home/sam/programs/mambaforge/envs/ShortStack-4.0.3_env/bin/ShortStack", line 28, in from Bio.SeqIO.QualityIO import FastqGeneralIterator ModuleNotFoundError: No module named 'Bio'

This suggests the Biopython is missing, so I tried installing it but had permission issues, I think because the conda environment is set up in Sam's directories. I also manually checked whether biopython is already installed (at /home/sam/programs/mambaforge/pkgs, and there are multiple biopython directories, so I'm still stumped.

After my biopython debugging attempts though, I've somehow caused a different issue accessing the conda environment itself. Now when I try to load the ShortStack conda environment (use_condaenv(condaenv = shortstack_conda_env_name, conda = shortstack_cond_path)), I get the error

ERROR: The requested version of Python ('/home/sam/programs/mambaforge/envs/ShortStack-4.0.3_env/bin/python') cannot be used, as another version of Python ('/usr/bin/python3') has already been initialized. Please restart the R session if you need to attach reticulate to a different version of Python. Error in use_python(python, required = required) : failed to initialize requested version of Python

I checked the python path being accessed (py_config()), and saw:

Show in New Window /usr/bin/python Show in New Window python: /usr/bin/python3 libpython: /usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6.so pythonhome: //usr://usr version: 3.6.9 (default, Apr 11 2024, 09:35:16) [GCC 8.4.0] numpy: [NOT FOUND] builtins: [builtin module]NOTE: Python version was forced by RETICULATE_PYTHON_FALLBACK

So it turns out I'm accessing the wrong python location (/usr/bin/python3 instead of /home/sam/programs/mambaforge/envs/ShortStack-4.0.3_env/bin/python) by default, and I can't figure out how to fix that. I've tried restarting R several times, but it still automatically initializes /usr/bin/python

I'm not sure why I'm having such difficulty with this code, since I was able to run nearly-identical code in deep-dive with no issues. The only thing that's changed is the input genome file. If anyone has any insights, I'd be super grateful!

kubu4 commented 1 month ago

First suggestion is to close project and restart R.

Then try again.

shedurkin commented 1 month ago

I just zoomed with Sam and we were able to fix the conda and biopython issues by simply uninstalling and reinstalling the reticulate package! ShortStack is back up and running again on my machine.