edgraham / BinSanity

Unsupervised Clustering of Environmental Microbial Assemblies Using Coverage and Affinity Propagation
GNU General Public License v3.0
29 stars 14 forks source link

Bio.Alphabet removed from Biopython #51

Closed alxsimon closed 3 years ago

alxsimon commented 4 years ago

There is an issue with the conda installation.

Removing the import works. Two solutions I think, dropping the use of Allphabet or fixing the version of Biopython used in the conda recipe.

For example when calling Binsanity-wf

Traceback (most recent call last):                                                             
  File "/opt/miniconda3/envs/binsanity/bin/Binsanity-wf", line 13, in <module>                 
    from Bio.Alphabet import IUPAC                                                             
  File "/opt/miniconda3/envs/binsanity/lib/python3.8/site-packages/Bio/Alphabet/__init__.py", l
ine 20, in <module>                                                                            
    raise ImportError(                                                                         
ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simp
ly be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_
type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://bi
opython.org/wiki/Alphabet for more information.                                                
edgraham commented 4 years ago

Hello,

I will look into this. It must specifically be a python3.8 issue. The current tests for python3 have been in python3.6 and after testing today in my own python3.6.11 conda env I am not getting this error. I will work to deprecate this for future versions but for the time being creating a conda env with python3.6 should solve this.

Regards, Elaina Graham

On Thu, Sep 24, 2020 at 11:20 PM Alexis Simon notifications@github.com wrote:

There is an issue with the conda installation.

Removing the import works. Two solutions I think, dropping the use of Allphabet or fixing the version of Biopython used in the conda recipe.

For example when calling Binsanity-wf

Traceback (most recent call last): File "/opt/miniconda3/envs/binsanity/bin/Binsanity-wf", line 13, in from Bio.Alphabet import IUPAC File "/opt/miniconda3/envs/binsanity/lib/python3.8/site-packages/Bio/Alphabet/init.py", l ine 20, in raise ImportError( ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simp ly be ignored and removed from scripts. In a few cases, you may need to specify the molecule_ type as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/edgraham/BinSanity/issues/51, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEC7DI2MMDHNKZ7CLFDZTSDSHQZDXANCNFSM4RZEXPMQ .

maherrl commented 3 years ago

Hello,

I am getting the same error after creating a conda environment with python=3.6.

conda create -n python3.6 python=3.6
conda activate python3.6
pip3 install BinSanity

(python3.6) [maherr@calculon ~]$ Binsanity-wf -f ../ -l co_contigs.fa -c cov_out.txt.cov.x100.lognorm -o binsanity-wf -x SizeThreshold 1500 --threads 10
Traceback (most recent call last):
  File "/nfs1/MICRO/Thurber_Lab/becca/opt/conda/envs/python3.6/bin/Binsanity-wf", line 13, in <module>
    from Bio.Alphabet import IUPAC
  File "/nfs1/MICRO/Thurber_Lab/becca/opt/conda/envs/python3.6/lib/python3.6/site-packages/Bio/Alphabet/__init__.py", line 21, in <module>
    "Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information."
ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information.
(python3.6) [maherr@calculon ~]$ Binsanity --version
Binsanity v0.4.4

Not sure if I didn't set up the environment correctly, or if the issue has not yet been resolved.

Any suggestions?

Becca

alxsimon commented 3 years ago

I think I fixed my problem initially by setting a given version of Biopython in the meta.yaml file. But I do not remember exactly (forgot to note the steps I have taken once again...).

Geize commented 3 years ago

Hi Elaina,

Do you have any tips for this? Or should I create a new env py=3.6 to install everything again?

edgraham commented 3 years ago

Hi All,

I apologize for it taking me so long to respond to this, its been a busy past year. I will be pushing a new version out today that will fix this. I have also been working on a new version Binsanity2 that will be released this summer and I will push the beta version to the github with the updates for this today if anyone wants to use the updated version (the program itself works but needs to be streamlined prior to official release).

In terms of the module in question after going through the code I found that the Bio.Alphabet had been deprecated out of the code already and the import statement was just a legacy feature. So you can also just delete that import statement from you local install and everything should work.

-Elaina

edgraham commented 3 years ago

This is now updated in a new version v0.5 on pypi and github. I will get conda up soon.

On Tue, Mar 23, 2021 at 4:16 PM Geize @.***> wrote:

Hi Elaina,

Do you have any tips for this? Or should I create a new env py=3.6 to install everything again?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/edgraham/BinSanity/issues/51#issuecomment-805342724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEC7DIYZGAHBUGZWRASJRHTTFEOMFANCNFSM4RZEXPMQ .

Geize commented 3 years ago

Thanks Elaina.

If you could update at the conda should be great.

Thanks for your attention.

edgraham commented 3 years ago

Just in case you haven't checked it is updated in conda now.

On Wed, Mar 24, 2021 at 3:48 PM Geize @.***> wrote:

Thanks Elaina.

If you could update at the conda should be great.

Thanks for your attention.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/edgraham/BinSanity/issues/51#issuecomment-806233743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEC7DI6WP7UVZUFPR5PSRQLTFJT4JANCNFSM4RZEXPMQ .

Geize commented 3 years ago

Hi Elaina,

Thanks for your update.

FIY

I removed Bio.Alphabet (as well IUPAC) from all script, used the script you sent to reformat txt file, and then BinSanity (previous version) worked very well.

Many thanks for your help.

best,