fhalab / MLDE

A machine-learning package for navigating combinatorial protein fitness landscapes.
Other
122 stars 26 forks source link

Basic and pytest tests #3

Closed bellag-oualid closed 3 years ago

bellag-oualid commented 3 years ago

Hi @brucejwittmann ,

I have installed the MLDE as per your instructions. However, when I get to the tests It fails

This is what I get for for:

>mlde Traceback (most recent call last): File "generate_encoding.py", line 65, in main() File "generate_encoding.py", line 16, in main from code.encode.encoding_generator import EncodingGenerator File "/home/ubuntu/MLDE/code/encode/encoding_generator.py", line 13, in from Bio import SeqIO File "/home/ubuntu/anaconda3/envs/mlde/lib/python3.7/site-packages/Bio/SeqIO/init.py", line 387, in from Bio.Align import MultipleSeqAlignment File "/home/ubuntu/anaconda3/envs/mlde/lib/python3.7/site-packages/Bio/Align/init.py", line 22, in from Bio.Align import _aligners ImportError: /home/ubuntu/anaconda3/envs/mlde/lib/python3.7/site-packages/Bio/Align/_aligners.cpython-37m-x86_64-linux-gnu.so: invalid ELF header

>mlde2 /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:30: DeprecationWarning: np.float is a deprecated alias for t he builtin float. To silence this warning, use float by itself. Doing this w ill not modify any behavior and is safe. If you specifically wanted the numpy sc alar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations method='lar', copy_X=True, eps=np.finfo(np.float).eps, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:167: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy s calar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations method='lar', copy_X=True, eps=np.finfo(np.float).eps, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:284: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy s calar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations eps=np.finfo(np.float).eps, copy_Gram=True, verbose=0, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:862: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy s calar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations eps=np.finfo(np.float).eps, copy_X=True, fit_path=True, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:1101: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations eps=np.finfo(np.float).eps, copy_X=True, fit_path=True, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:1127: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations eps=np.finfo(np.float).eps, positive=False): /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:1362: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations max_n_alphas=1000, n_jobs=None, eps=np.finfo(np.float).eps, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:1602: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations max_n_alphas=1000, n_jobs=None, eps=np.finfo(np.float).eps, /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/sklearn/linear_mod el/least_angle.py:1738: DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdo cs/release/1.20.0-notes.html#deprecations eps=np.finfo(np.float).eps, copy_X=True, positive=False): Traceback (most recent call last): File "predict_zero_shot.py", line 49, in main() File "predict_zero_shot.py", line 12, in main from code.zero_shot.support_funcs import check_args, run_zero_shot File "/home/ubuntu/MLDE/code/zero_shot/support_funcs.py", line 8, in from .zero_shot_predictor import ZeroShotPredictor File "/home/ubuntu/MLDE/code/zero_shot/zero_shot_predictor.py", line 12, in from ..encode.sequence_loader import SequenceLoader File "/home/ubuntu/MLDE/code/encode/sequence_loader.py", line 9, in from Bio import SeqIO File "/home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/Bio/SeqIO/ init.py", line 387, in from Bio.Align import MultipleSeqAlignment File "/home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/Bio/Align/ init.py", line 22, in from Bio.Align import _aligners ImportError: /home/ubuntu/anaconda3/envs/mlde2/lib/python3.7/site-packages/Bio/A lign/_aligners.cpython-37m-x86_64-linux-gnu.so: invalid ELF header

from both tests, it looks that I have issues with the import of "_aligners.cpython-37m-x86_64-linux-gnu.so" file that is empty.

I have to mention that I am running the mlde within a AWS EC2 (I use a VM because our workstation has an AMD RX570 which makes it incompatible with the cudatoolkit and TensorFlow). I would highly appreciate your help.

Cordially

brucejwittmann commented 3 years ago

Hi @bellag-oualid,

This error suggests that something went wrong during the install of biopython. Just a few questions:

  1. Are you using the provided mlde/mlde2.yml environments?
  2. How are you running the tests (e.g., are you using the run_pytests.sh script)?

I have successfully run MLDE on an EC2 instance before, so I'm not sure what the exact problem could be. If it is a strange compatibility problem, some potential workarounds could be:

  1. Within the .yml files, reorder default and conda-forge under the channel subheading so that conda-forge is first.
  2. Once you have built the environments, activate them and try running conda update biopython from within.
bellag-oualid commented 3 years ago

Thank you @brucejwittmann for your suggestions.

Indeed it seems to be the conda environment conflicting. I could install and run the tests in another machine (not virtual) and tests work fine.