Error in Installation
Opened this issue ยท 15 comments
Do you have HMMER installed on your computer ?
Although the traceback shows an error with the muscle program (which is included in ANARCI I believe), it also shows it cannot find commands from HMMER (hmmbuild and hmmpress). If that doesn't work, try installing muscle too.
Was this ever resolved? @lordim
I know it's been a while ago but if so, please comment the solution and close the issue. Otherwise, let us know to look into it.
First of all my working environment:
Docker image
OS Ubuntu 20.04
Python version 3.8
Hmmer version 3.3+
biopython installed
On docker image ubuntu you are root, so I installed with: python3 setup.py install.
Had the same issue.
Installed HMMER: apt install hmmer
Next ERROR:
Traceback (most recent call last):
File "./FormatAlignments.py", line 480, in
main()
File "./FormatAlignments.py", line 454, in main
jalignments = format_j_genes(jalignments)
File "./FormatAlignments.py", line 183, in format_j_genes
aligned = read_fasta( al_filename )
File "./FormatAlignments.py", line 127, in read_fasta
handle = open(filename, "r")
FileNotFoundError: [Errno 2] No such file or directory: './muscle_alignments/all_js_aligned.fasta'
Alignment input open failed.
couldn't open ./curated_alignments/ALL.stockholm for reading
Error: File existence/permissions problem in trying to open HMM file ./HMMs/ALL.hmm.
HMM file ./HMMs/ALL.hmm not found (nor an .h3m binary of it)
Traceback (most recent call last):
File "setup.py", line 61, in
shutil.copy( "curated_alignments/germlines.py", ANARCI_LOC )
File "/usr/lib/python3.8/shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'curated_alignments/germlines.py'
tried to run a example anyway:
root@a7c20636b99b:/ANARCI# ANARCI -i Example_sequence_files/12e8.fasta
Error: Unknown amino acid letter found in sequence: 1, /, U, 2, ., 8, _, X
root@a7c20636b99b:/ANARCI# cd Example_scripts_and_sequences/
root@a7c20636b99b:/ANARCI/Example_scripts_and_sequences# ANARCI -i 12e8.fasta
Error: b'\nError: File existence/permissions problem in trying to open HMM file /usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm.\nHMM file /usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm not found (nor an .h3m binary of it); also looked in PF\n\n'
So what happens here is, that if I run the command from outside the directory 'Example_scripts_and_files' it breaks with ERROR unknown amino acids, which seems to be from a fasta-reader which takes also the path of the file not only the name of the file or something.
When running the command from whitin the folder there is the actual ERROR which says that there are no hmms in installation-path. Somehow it seems the installation doesnt copy the files from "./ANARCI/lib/python/anarci/dat/HMMs/ALL.hmm" to "/usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm".
Hope this gives someone an idea what might be the issue. And I hope someone could help me get ANARCI running in a docker-image.
Update
After copying the hmms from "./ANARCI/lib/python/anarci/dat/HMMs/ALL.hmm" to "/usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm" the basic functionality seems to be working. I can run the example file and the test commands from the readme from this github. I still have to be in the folder where the fasta-files are stored but the results are correct which is something.
Same error. I used the docker image of ANARCI instead docker pull quay.io/biocontainers/anarci:2020.04.23--py_3
Going off of @awesome-crab's troubleshooting, this minimal Dockerfile creates a functioning ANARCI that can be run from any folder in the container. Including the python setup.py install
was messing everything up. The mkdir
and cp
's get around having to use it.
FROM rocker/shiny-verse
RUN apt update && apt install -y \
hmmer \
git \
python3 \
python3-pip \
&& rm -r /var/lib/apt/lists/* \
&& pip install biopython \
&& git clone https://github.com/oxpig/ANARCI.git \
&& mkdir -p /usr/local/lib/python3.8/dist-packages/anarci \
&& cp -r /ANARCI/lib/python/anarci/* /usr/local/lib/python3.8/dist-packages/anarci
ENV PATH="${PATH}:/ANARCI/bin"
Uncommenting the following lines in setup.py
makes python setup.py install
install the data files in their intended location:
Lines 23 to 27 in c2fd0f7
Uncommenting the following lines in
setup.py
makespython setup.py install
install the data files in their intended location:Lines 23 to 27 in c2fd0f7
Just tested this and the error is still:
Traceback (most recent call last):
File "setup.py", line 61, in
shutil.copy( "curated_alignments/germlines.py", ANARCI_LOC )
File "/usr/lib/python3.8/shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'curated_alignments/germlines.py'
And the setup.py file is:
root@fb0e07de9017:/ANARCI# more setup.py
setup(name='anarci',
version='1.3',
description='Antibody Numbering and Receptor ClassIfication',
author='James Dunbar',
author_email='opig@stats.ox.ac.uk',
url='http://opig.stats.ox.ac.uk/webapps/ANARCI',
packages=['anarci'],
package_dir={'anarci': 'lib/python/anarci'},
package_data={'anarci': ['dat/HMMs/ALL.hmm',
'dat/HMMs/ALL.hmm.h3f',
'dat/HMMs/ALL.hmm.h3i',
'dat/HMMs/ALL.hmm.h3m',
'dat/HMMs/ALL.hmm.h3p']},
scripts=['bin/ANARCI'],
data_files = [ ('bin', ['bin/muscle', 'bin/muscle_macOS']) ]
)
Traceback (most recent call last):
File "setup.py", line 61, in
shutil.copy( "curated_alignments/germlines.py", ANARCI_LOC )
File "/usr/lib/python3.8/shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'curated_alignments/germlines.py'
Right, I was using pip install .
, not python setup.py install
. pip install .
seems to circumvent build
stage, which is causing the failure in your case.
Traceback (most recent call last):
File "setup.py", line 61, in
shutil.copy( "curated_alignments/germlines.py", ANARCI_LOC )
File "/usr/lib/python3.8/shutil.py", line 418, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/lib/python3.8/shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'curated_alignments/germlines.py'Right, I was using
pip install .
, notpython setup.py install
.pip install .
seems to circumventbuild
stage, which is causing the failure in your case.
Wow. Thanks for the hint!! I was naively following the installation instructions. But just using pip install .
seems to work fine. Even with commented lines 23 - 27.
Wow. Thanks for the hint!! I was naively following the installation instructions. But just using
pip install .
seems to work fine. Even with commented lines 23 - 27.
Right, but can you confirm ANARCI actually works lines 23-27 commented out? For me any input fails with File existence/permissions problem in trying to open HMM file /usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm
message as HMM files will not get installed when said lines are commented out.
Sorry. Contrary to my previous comment it is not working for me. To be clear:
installation with pip install . and uncommented setup.py file does not work.
installation with pip install . and commented setup.py file does not work.
installation with python setup.py install . and uncommented setup.py file does not work.
installation with python setup.py install . and commented setup.py file does not work.
use #16 (comment)
I see. Are you seeing the same message in all four cases? To me pip install .
with uncommented lines works. I am using Python 3.10 by the way.
pip install .
with commented setup.py fails the way you describe: File existence/permissions problem in trying to open HMM file /usr/local/lib/python3.8/dist-packages/anarci/dat/HMMs/ALL.hmm
The uncommented install attempt works. But running the ANARCI commands only work when the working dir is where the fasta file is. Otherwise the error is Error: Unknown amino acid letter found in sequence: _, U, 1, 8, 2, X, /, .
The other 2 fail as described here #16 (comment) and here #16 (comment)
The uncommented install attempt works. But running the ANARCI commands only work when the working dir is where the fasta file is. Otherwise the error is
Error: Unknown amino acid letter found in sequence: _, U, 1, 8, 2, X, /, .
Thanks for testing. Although I do not quite get what do you mean by "running the ANARCI commands only work when the working dir is where the fasta file is". It might be that when ANARCI is unable to find the file it interprets the name of the file as amino acid letter sequence, but this is my wild guess.
when I run this command in the folder ANARCI/ : ANARCI -i Example_sequence_files/12e8.fasta
it fails with Error: Unknown amino acid letter found in sequence: _, U, 1, 8, 2, X, /, .
when I run the command in ANARCI/Example_sequence_files/ : ANARCI -i 12e8.fasta
it works