Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Installation #16

Open
lordim opened this issue Jun 24, 2021 · 15 comments
Open

Error in Installation #16

lordim opened this issue Jun 24, 2021 · 15 comments

Comments

@lordim
Copy link

lordim commented Jun 24, 2021

I have cloned the repository for ANARCI and tried to install it, but got the following error:

image

I have no idea what could have gone wrong in my installation process since all I've done was "python3 setup.py install --user"

Thanks!

@gciaberi
Copy link

gciaberi commented Aug 4, 2021

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.

@broncio123
Copy link
Contributor

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.

@awesome-crab
Copy link

awesome-crab commented Nov 25, 2021

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.

@anishazaveri
Copy link

Same error. I used the docker image of ANARCI instead docker pull quay.io/biocontainers/anarci:2020.04.23--py_3

@DewBudd
Copy link

DewBudd commented Jul 21, 2022

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"

@merkys
Copy link

merkys commented Oct 17, 2022

Uncommenting the following lines in setup.py makes python setup.py install install the data files in their intended location:

ANARCI/setup.py

Lines 23 to 27 in c2fd0f7

#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']},

merkys added a commit to merkys/ANARCI that referenced this issue Oct 17, 2022
@awesome-crab
Copy link

Uncommenting the following lines in setup.py makes python setup.py install install the data files in their intended location:

ANARCI/setup.py

Lines 23 to 27 in c2fd0f7

#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']},

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']) ]
)

@merkys
Copy link

merkys commented Oct 17, 2022

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.

@awesome-crab
Copy link

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.

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.

@merkys
Copy link

merkys commented Oct 17, 2022

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.

@awesome-crab
Copy link

awesome-crab commented Oct 17, 2022

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)

@merkys
Copy link

merkys commented Oct 17, 2022

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.

@awesome-crab
Copy link

awesome-crab commented Oct 17, 2022

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)

@merkys
Copy link

merkys commented Oct 20, 2022

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.

@awesome-crab
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants