apcamargo / RNAsamba

A tool for computing the coding potential of RNA transcript sequences using deep learning classification model
https://rnasamba.lge.ibi.unicamp.br/
GNU General Public License v3.0
53 stars 4 forks source link

Issue with various installation methods on apple silicon #22

Closed callumparr closed 2 months ago

callumparr commented 2 months ago

With conda I am installing it within a conda environment using Python 3.6. When I try to install rnasamba with conda it tells me there is an illegal hardware operation.

CONDA_SUBDIR=osx-64 conda create -n rnasamba python=3.6

conda activate rnasamba

conda install -c conda-forge -c bioconda rnasamba

Error:

The following NEW packages will be INSTALLED:

  absl-py            conda-forge/noarch::absl-py-2.0.0-pyhd8ed1ab_0 
  astor              conda-forge/noarch::astor-0.8.1-pyh9f0ad1d_0 
  biopython          conda-forge/osx-64::biopython-1.79-py36hfa26744_0 
  c-ares             conda-forge/osx-64::c-ares-1.33.1-h44e7173_0 
  cctools_osx-64     conda-forge/osx-64::cctools_osx-64-973.0.1-hcc6d90d_12 
  clang              conda-forge/osx-64::clang-11.1.0-h694c41f_1 
  clang-11           conda-forge/osx-64::clang-11-11.1.0-default_he082bbe_1 
  clang_osx-64       conda-forge/osx-64::clang_osx-64-11.1.0-hc8532ff_7 
  clangxx            conda-forge/osx-64::clangxx-11.1.0-default_he082bbe_1 
  clangxx_osx-64     conda-forge/osx-64::clangxx_osx-64-11.1.0-h2c55bc3_7 
  compiler-rt        conda-forge/osx-64::compiler-rt-11.1.0-h654b07c_0 
  compiler-rt_osx-64 conda-forge/noarch::compiler-rt_osx-64-11.1.0-h8c5fa43_0 
  dataclasses        conda-forge/noarch::dataclasses-0.8-pyh787bdff_2 
  gast               conda-forge/noarch::gast-0.5.5-pyhd8ed1ab_0 
  google-pasta       conda-forge/noarch::google-pasta-0.2.0-pyh8c360ce_0 
  grpcio             conda-forge/osx-64::grpcio-1.38.1-py36h8d587b5_0 
  h5py               conda-forge/osx-64::h5py-2.10.0-nompi_py36h11635bf_105 
  hdf5               conda-forge/osx-64::hdf5-1.10.6-nompi_hc5d9132_1114 
  importlib-metadata conda-forge/osx-64::importlib-metadata-4.8.1-py36h79c6626_0 
  keras              conda-forge/osx-64::keras-2.2.5-py36_1 
  keras-applications conda-forge/noarch::keras-applications-1.0.8-py_1 
  keras-preprocessi~ conda-forge/noarch::keras-preprocessing-1.1.2-pyhd8ed1ab_0 
  krb5               conda-forge/osx-64::krb5-1.20.1-h0165f36_0 
  ld64_osx-64        conda-forge/osx-64::ld64_osx-64-609-h6adca69_10 
  libblas            conda-forge/osx-64::libblas-3.9.0-20_osx64_openblas 
  libcblas           conda-forge/osx-64::libcblas-3.9.0-20_osx64_openblas 
  libclang-cpp11.1   conda-forge/osx-64::libclang-cpp11.1-11.1.0-default_he082bbe_1 
  libcurl            conda-forge/osx-64::libcurl-7.87.0-haf73cf8_0 
  libedit            conda-forge/osx-64::libedit-3.1.20191231-h0678c8f_2 
  libev              conda-forge/osx-64::libev-4.33-h10d778d_2 
  libgfortran        conda-forge/osx-64::libgfortran-5.0.0-13_2_0_h97931a8_3 
  libgfortran5       conda-forge/osx-64::libgfortran5-13.2.0-h2873a65_3 
  libgpuarray        conda-forge/osx-64::libgpuarray-0.7.6-h0d85af4_1003 
  liblapack          conda-forge/osx-64::liblapack-3.9.0-20_osx64_openblas 
  libllvm11          conda-forge/osx-64::libllvm11-11.1.0-h8fb7429_5 
  libllvm14          conda-forge/osx-64::libllvm14-14.0.6-hc8e404f_4 
  libnghttp2         conda-forge/osx-64::libnghttp2-1.51.0-h0dd9d14_0 
  libopenblas        conda-forge/osx-64::libopenblas-0.3.25-openmp_hfef2a42_0 
  libprotobuf        conda-forge/osx-64::libprotobuf-3.18.0-hcf210ce_1 
  libssh2            conda-forge/osx-64::libssh2-1.10.0-h7535e13_3 
  llvm-openmp        conda-forge/osx-64::llvm-openmp-18.1.8-h15ab845_1 
  llvm-tools         conda-forge/osx-64::llvm-tools-11.1.0-h8fb7429_5 
  mako               conda-forge/noarch::mako-1.3.5-pyhd8ed1ab_0 
  markdown           conda-forge/noarch::markdown-3.6-pyhd8ed1ab_0 
  markupsafe         conda-forge/osx-64::markupsafe-2.0.1-py36hfa26744_0 
  numpy              conda-forge/osx-64::numpy-1.16.6-py36h08dc641_0 
  protobuf           conda-forge/osx-64::protobuf-3.18.0-py36hefe7e0e_0 
  pygpu              conda-forge/osx-64::pygpu-0.7.6-py36h962fabe_1002 
  pyyaml             conda-forge/osx-64::pyyaml-5.4.1-py36hfa26744_1 
  rnasamba           bioconda/osx-64::rnasamba-0.2.5-py36hb5a9481_1 
  scipy              conda-forge/osx-64::scipy-1.5.3-py36h04de62b_0 
  sigtool            conda-forge/osx-64::sigtool-0.1.3-h57ddcff_0 
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0 
  tapi               conda-forge/osx-64::tapi-1100.0.11-h9ce4665_0 
  tensorboard        conda-forge/osx-64::tensorboard-1.14.0-py36_0 
  tensorflow         conda-forge/osx-64::tensorflow-1.14.0-hcba10bf_0 
  tensorflow-base    conda-forge/osx-64::tensorflow-base-1.14.0-py36h9f0ad1d_0 
  tensorflow-estima~ conda-forge/osx-64::tensorflow-estimator-1.14.0-py36h5ca1d4c_0 
  termcolor          conda-forge/noarch::termcolor-1.1.0-pyhd8ed1ab_3 
  theano             conda-forge/osx-64::theano-1.0.5-py36hefe7e0e_1 
  typing_extensions  conda-forge/noarch::typing_extensions-4.1.1-pyha770c72_0 
  werkzeug           conda-forge/noarch::werkzeug-2.0.2-pyhd8ed1ab_0 
  wrapt              conda-forge/osx-64::wrapt-1.13.1-py36hfa26744_0 
  yaml               conda-forge/osx-64::yaml-0.2.5-h0d85af4_2 
  zipp               conda-forge/noarch::zipp-3.6.0-pyhd8ed1ab_0 

Proceed ([y]/n)? y

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
[5]    4415 illegal hardware instruction

pip

Within same "rosetta" environment

pip install rnasamba
Collecting rnasamba
  Downloading rnasamba-0.2.5-cp36-cp36m-macosx_10_9_x86_64.whl (1.3 MB)
     |████████████████████████████████| 1.3 MB 8.8 MB/s            
Collecting tensorflow<2.0,>=1.5.0
  Downloading tensorflow-1.15.5-cp36-cp36m-macosx_10_9_x86_64.whl (123.3 MB)
     |████████████████████████████████| 123.3 MB 3.1 MB/s            
Collecting keras<2.3.0,>=2.1.0
  Downloading Keras-2.2.5-py2.py3-none-any.whl (336 kB)
     |████████████████████████████████| 336 kB 3.1 MB/s            
Collecting numpy<=1.16.5
  Downloading numpy-1.16.5-cp36-cp36m-macosx_10_9_x86_64.whl (13.9 MB)
     |████████████████████████████████| 13.9 MB 3.7 MB/s            
Collecting h5py<3.0.0
  Downloading h5py-2.10.0-cp36-cp36m-macosx_10_6_intel.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 4.2 MB/s            
Collecting biopython
  Downloading biopython-1.79-cp36-cp36m-macosx_10_9_x86_64.whl (2.3 MB)
     |████████████████████████████████| 2.3 MB 1.9 MB/s            
Collecting six
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pyyaml
  Downloading PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (189 kB)
     |████████████████████████████████| 189 kB 4.7 MB/s            
Collecting keras-preprocessing>=1.1.0
  Downloading Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 5.0 MB/s            
Collecting scipy>=0.14
  Downloading scipy-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl (28.8 MB)
     |████████████████████████████████| 28.8 MB 4.3 MB/s            
Collecting keras-applications>=1.0.8
  Downloading Keras_Applications-1.0.8-py3-none-any.whl (50 kB)
     |████████████████████████████████| 50 kB 6.1 MB/s            
Collecting opt-einsum>=2.3.2
  Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 5.2 MB/s             
Requirement already satisfied: wheel>=0.26 in ./mambaforge/envs/rnasamba/lib/python3.6/site-packages (from tensorflow<2.0,>=1.5.0->rnasamba) (0.37.1)
Collecting gast==0.2.2
  Downloading gast-0.2.2.tar.gz (10 kB)
  Preparing metadata (setup.py) ... done
Collecting google-pasta>=0.1.6
  Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 4.3 MB/s            
Collecting grpcio>=1.8.6
  Downloading grpcio-1.48.2-cp36-cp36m-macosx_10_10_x86_64.whl (4.4 MB)
     |████████████████████████████████| 4.4 MB 3.5 MB/s            
Collecting tensorflow-estimator==1.15.1
  Downloading tensorflow_estimator-1.15.1-py2.py3-none-any.whl (503 kB)
     |████████████████████████████████| 503 kB 2.5 MB/s            
Collecting astor>=0.6.0
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting absl-py>=0.7.0
  Downloading absl_py-1.4.0-py3-none-any.whl (126 kB)
     |████████████████████████████████| 126 kB 2.5 MB/s            
Collecting termcolor>=1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
  Preparing metadata (setup.py) ... done
Collecting wrapt>=1.11.1
  Downloading wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl (36 kB)
Collecting tensorboard<1.16.0,>=1.15.0
  Downloading tensorboard-1.15.0-py3-none-any.whl (3.8 MB)
     |████████████████████████████████| 3.8 MB 3.2 MB/s            
Collecting protobuf>=3.6.1
  Downloading protobuf-3.19.6-cp36-cp36m-macosx_10_9_x86_64.whl (979 kB)
     |████████████████████████████████| 979 kB 3.0 MB/s            
Collecting markdown>=2.6.8
  Downloading Markdown-3.3.7-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 4.1 MB/s            
Collecting werkzeug>=0.11.15
  Downloading Werkzeug-2.0.3-py3-none-any.whl (289 kB)
     |████████████████████████████████| 289 kB 4.5 MB/s            
Requirement already satisfied: setuptools>=41.0.0 in ./mambaforge/envs/rnasamba/lib/python3.6/site-packages (from tensorboard<1.16.0,>=1.15.0->tensorflow<2.0,>=1.5.0->rnasamba) (58.0.4)
Collecting importlib-metadata>=4.4
  Downloading importlib_metadata-4.8.3-py3-none-any.whl (17 kB)
Collecting dataclasses
  Downloading dataclasses-0.8-py3-none-any.whl (19 kB)
Collecting zipp>=0.5
  Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
Collecting typing-extensions>=3.6.4
  Downloading typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Building wheels for collected packages: gast, termcolor
  Building wheel for gast (setup.py) ... done
  Created wheel for gast: filename=gast-0.2.2-py3-none-any.whl size=7554 sha256=bb3a681109abe8b7ce0d88ac4bcbeaf0c4fd76e52bccfef7c8515eacfc23b7e4
  Stored in directory: /Users/callumparr/Library/Caches/pip/wheels/19/a7/b9/0740c7a3a7d1d348f04823339274b90de25fbcd217b2ee1fbe
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4848 sha256=cf48bfb92a37a4157787f89a9232ce0606285ff664538128525a3b5ca72bb4db
  Stored in directory: /Users/callumparr/Library/Caches/pip/wheels/93/2a/eb/e58dbcbc963549ee4f065ff80a59f274cc7210b6eab962acdc
Successfully built gast termcolor
Installing collected packages: zipp, typing-extensions, six, numpy, importlib-metadata, dataclasses, werkzeug, protobuf, markdown, h5py, grpcio, absl-py, wrapt, termcolor, tensorflow-estimator, tensorboard, scipy, pyyaml, opt-einsum, keras-preprocessing, keras-applications, google-pasta, gast, astor, tensorflow, keras, biopython, rnasamba
Successfully installed absl-py-1.4.0 astor-0.8.1 biopython-1.79 dataclasses-0.8 gast-0.2.2 google-pasta-0.2.0 grpcio-1.48.2 h5py-2.10.0 importlib-metadata-4.8.3 keras-2.2.5 keras-applications-1.0.8 keras-preprocessing-1.1.2 markdown-3.3.7 numpy-1.16.5 opt-einsum-3.3.0 protobuf-3.19.6 pyyaml-6.0.1 rnasamba-0.2.5 scipy-1.5.4 six-1.16.0 tensorboard-1.15.0 tensorflow-1.15.5 tensorflow-estimator-1.15.1 termcolor-1.1.0 typing-extensions-4.1.1 werkzeug-2.0.3 wrapt-1.16.0 zipp-3.6.0

Got to run

❯ rnasamba classify -h
[1]    13975 illegal hardware instruction  rnasamba classify -h

Docker I've tried running it through docker but then there is a platform mismatch and it just hangs without doing anything. I tried with a cDNA sequence downloaded from ensembl to test. I presume it shouldn't take long to predict from one sequence.

❯ docker run -ti --rm -u $(id -u) -v "$(pwd):/app" antoniopcamargo/rnasamba classify -p predicted_proteins.fa classification.tsv ~/Downloads/Homo_sapiens_ENST00000420700_5_sequence.fa full_length_weights.hdf5
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I ensured I enabled docker settings to use the rosetta layer but it still hangs.

I have submitted it to the webserver but I could not find any option to output the protein sequence that is predicted

Is there some other way to install?

apcamargo commented 2 months ago

Strange that you can't run even when using Rosetta in Docker. You can see a discussion about a similar issue here: https://github.com/apcamargo/genomad/issues/105

I have submitted it to the webserver but I could not find any option to output the protein sequence that is predicted

RNAsamba will just take the longest ORF within the contig. You can extract these ORFs using other software, like seqkit.

callumparr commented 2 months ago

Strange that you can't run even when using Rosetta in Docker. You can see a discussion about a similar issue here: apcamargo/genomad#105

I have submitted it to the webserver but I could not find any option to output the protein sequence that is predicted

RNAsamba will just take the longest ORF within the contig. You can extract these ORFs using other software, like seqkit.

Thank you. I tried what was suggested but still having issues. I am wondering if using miniforge3 rather than miniconda3 is the issue. I will close this issue as I think it is something very specific to my setup