Problem while running pointfinder

Issue #40 resolved
Former user created an issue

Hello, we built a new container for docker and we downloaded the two databases. When running within the container resfinder pointing to the resfinder database as follow we found no problem.

python3 /resfinder/run_resfinder.py -ifa SRR1840593_contigs.fa -o ../../testResfinder -s 'Salmonella enterica' --min_cov 0.6 -t 0.8 --acquired --db_path_res /data/Mirko/databases/resfinder4/db_resfinder/

When we also include pointfinder database as below

python3 /resfinder/run_resfinder.py -ifa SRR1840593_contigs.fa -o ../../testResfinder2 -s 'Salmonella enterica' --min_cov 0.6 -t 0.8 --acquired --point --db_path_res /data/Mirko/databases/resfinder4/db_resfinder/ --db_path_point /data/Mirko/databases/resfinder4/db_pointfinder/

we have the following error

Found: aac(6')-Iaa_1_NC_003197 Saving: contig00003 len=354537 cov=30.7 corr=0 origname=NODE_3_length_354537_cov_30.656998_pilon sw=shovill-spades/1.1.0 date=20210216:160528..160965:aac(6')-Iaa_1_NC_003197:89.497717 I have no name!@72449c0cd2cd:/data/Mirko/testing_MR/alpha1.9/SRR1840593/Shovill/out$ python3 /resfinder/run_resfinder.py -ifa SRR1840593_contigs.fa -o ../../testResfinder2 -s 'salmonella ent erica' --min_cov 0.6 -t 0.8 --acquired --point --db_path_res /data/Mirko/databases/resfinder4/db_resfinder/ --db_path_point /data/Mirko/databases/resfinder4/db_pointfinder/ Found: aac(6')-Iaa_1_NC_003197 Saving: contig00003 len=354537 cov=30.7 corr=0 origname=NODE_3_length_354537_cov_30.656998_pilon sw=shovill-spades/1.1.0 date=20210216:160528..160965:aac(6')-Iaa_1_NC_003197:89.497717 Found: acrB Saving: contig00006 len=213918 cov=30.4 corr=0 origname=NODE_6_length_213918_cov_30.378563_pilon sw=shovill-spades/1.1.0 date=20210216:169806..172955:acrB:95.714286 Found: pmrA Saving: contig00009 len=184074 cov=33.7 corr=0 origname=NODE_9_length_184074_cov_33.725304_pilon sw=shovill-spades/1.1.0 date=20210216:68804..69472:pmrA:93.273543 Found: pmrB Saving: contig00009 len=184074 cov=33.7 corr=0 origname=NODE_9_length_184074_cov_33.725304_pilon sw=shovill-spades/1.1.0 date=20210216:69482..70552:pmrB:94.117647 Found: gyrA Saving: contig00010 len=183528 cov=30.3 corr=0 origname=NODE_10_length_183528_cov_30.334338_pilon sw=shovill-spades/1.1.0 date=20210216:20081..22717:gyrA:94.653015 Found: gyrB Saving: contig00021 len=79038 cov=33.2 corr=0 origname=NODE_21_length_79038_cov_33.228046_pilon sw=shovill-spades/1.1.0 date=20210216:55367..57781:gyrB:93.876674 Found: parC Saving: contig00025 len=51534 cov=30.3 corr=0 origname=NODE_25_length_51534_cov_30.349836_pilon sw=shovill-spades/1.1.0 date=20210216:45624..47882:parC:93.846835 Found: parE Saving: contig00007 len=207285 cov=29.0 corr=0 origname=NODE_7_length_207285_cov_28.950260_pilon sw=shovill-spades/1.1.0 date=20210216:3858..5750:parE:96.358785 Found: 16S_rrsD Saving: contig00013 len=145837 cov=32.8 corr=0 origname=NODE_13_length_145837_cov_32.813460_pilon sw=shovill-spades/1.1.0 date=20210216:1..159:16S_rrsD:10.233161 Found: 16S_rrsD Saving: contig00042 len=1498 cov=75.4 corr=0 origname=NODE_44_length_1498_cov_75.415094_pilon sw=shovill-spades/1.1.0 date=20210216:48..1498:16S_rrsD:93.071108 Traceback (most recent call last): File "/resfinder/run_resfinder.py", line 554, in <module> type="seq_variations") File "/resfinder/cge/phenotype2genotype/isolate.py", line 134, in load_finder_results res_feature = self.new_res_mut(feat_info, unique_id, ab_class) File "/resfinder/cge/phenotype2genotype/isolate.py", line 162, in new_res_mut ab_class=ab_class) File "/resfinder/cge/phenotype2genotype/feature.py", line 205, in init premature_stop=premature_stop, frameshift=frameshift) File "/resfinder/cge/phenotype2genotype/feature.py", line 95, in init self.set_mut_str_del() File "/resfinder/cge/phenotype2genotype/feature.py", line 169, in set_mut_str_del ref_right=self.ref_aa_right.upper())) AttributeError: 'NoneType' object has no attribute 'upper'

FYI our dockerfile looks as below

FROM debian

ENV DEBIAN_FRONTEND noninteractive

Setup .bashrc file for convenience during debugging

RUN echo "alias ls='ls -h --color=tty'\n"\ "alias ll='ls -lrt'\n"\ "alias l='less'\n"\ "alias du='du -hP --max-depth=1'\n"\ "alias cwd='readlink -f .'\n"\ "PATH=$PATH\n">> ~/.bashrc

RUN set -ex && \ # Basix setup \ apt-get update -y -qq && \ apt-get install -y -qq git \ apt-utils \ libidn11 \ wget \ python3-pip \ libz-dev \ && \ # Python 3 setup \ pip3 install --upgrade pip setuptools && \ ln -sf /usr/bin/pip3 /usr/bin/pip && \ ln -sf /usr/bin/python3 /usr/bin/python && \ # Install python dependencies \ pip install cython tabulate numpy biopython && \ rm -rf /var/cache/apt/ /var/lib/apt/lists/

Install BLAST

COPY ncbi-blast-2.7.1+-x64-linux.tar.gz . RUN tar -zxvf ncbi-blast-2.7.1+-x64-linux.tar.gz && \ ln -s /ncbi-blast-2.7.1+/bin/blastn /usr/bin/blastn && \ rm ncbi-blast-2.7.1+-x64-linux.tar.gz

Install ResFinder and databases

RUN pip install cgecore==1.5.1 && \ pip install gitpython && \ pip install python-dateutil && \ git clone -b 4.0 https://bitbucket.org/genomicepidemiology/resfinder.git && \ mkdir resfinder/db_resfinder && \ mkdir resfinder/db_pointfinder && \ chmod a+x resfinder/run_resfinder.py && \ ln -s /resfinder/run_resfinder.py /usr/bin/resfinder && \ # Install KMA \ apt-get install -y -qq libz-dev && \ git clone --branch 1.2.11 https://bitbucket.org/genomicepidemiology/kma.git resfinder/cge/kma && \ cd resfinder/cge/kma && make && cd ../.. && \ ln -s /resfinder/cge/kma/kma /usr/bin/kma && \ ln -s /resfinder/cge/kma/kma_index /usr/bin/kma_index && \ apt-get clean && \ rm -rf /var/cache/apt/ /var/lib/apt/lists/

COPY db_resfinder /resfinder/db_resfinder WORKDIR /resfinder/db_resfinder RUN python3 INSTALL.py non_interactive

ENV DEBIAN_FRONTEND Teletype

WORKDIR /workdir

Comments (7)

  1. CGE Helpdesk

    Dear Mr/Ms,

    Thank you for the interest in ResFinder.

    We have just launched an updated version of the Dockerfile. So I suggest you try to use that Dockerfile instead for building the docker image, and I would like to know if it works as expected. If you experience errors when running the dockerfile present in ResFinder repository, please do not hesitate to write us again.

    Kind regards,

    Malene, CGE helpdesk

  2. ROSSI MIRKO

    Thanks Melene,

    we tried to build from the dockerfile “docker build -t resfinder .”, but we are unable to do it. See error below.

    Thanks for the help.

    Mirko

    Sending build context to Docker daemon 3.072kB
    Step 1/15 : FROM debian:stretch

    Step 2/15 : ENV DEBIAN_FRONTEND noninteractive

    Step 3/15 : RUN apt-get update -qq; apt-get install -y -qq git apt-utils wget python3-pip ncbi-blast+ libz-dev ; rm -rf /var/cache/apt/* /var/lib/apt/lists/*;

    Step 4/15 : ENV DEBIAN_FRONTEND Teletype

    Step 5/15 : RUN pip3 install -U biopython==1.73 tabulate cgecore gitpython python-dateutil;

    Collecting biopython==1.73
    Downloading https://files.pythonhosted.org/packages/3c/5a/05c29e3a75269e00e50779b28b60041d9783ee79054ce53a1d193e05deab/biopython-1.73-cp35-cp35m-manylinux1_x86_64.whl (2.2MB)
    Collecting tabulate
    Downloading https://files.pythonhosted.org/packages/ca/80/7c0cad11bd99985cfe7c09427ee0b4f9bd6b048bd13d4ffb32c6db237dfb/tabulate-0.8.9-py3-none-any.whl
    Collecting cgecore
    Downloading https://files.pythonhosted.org/packages/e5/1b/e5eecb648fcdc25bfd0657c319a4efaf2e8d8bed47b0db8cc8df9203a719/cgecore-1.5.6-py3-none-any.whl
    Collecting gitpython
    Downloading https://files.pythonhosted.org/packages/a6/99/98019716955ba243657daedd1de8f3a88ca1f5b75057c38e959db22fb87b/GitPython-3.1.14-py3-none-any.whl (159kB)
    Collecting python-dateutil
    Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
    Collecting numpy (from biopython==1.73)
    Downloading https://files.pythonhosted.org/packages/b5/36/88723426b4ff576809fec7d73594fe17a35c27f8d01f93637637a29ae25b/numpy-1.18.5-cp35-cp35m-manylinux1_x86_64.whl (19.9MB)
    Collecting gitdb<5,>=4.0.1 (from gitpython)
    Downloading https://files.pythonhosted.org/packages/48/11/d1800bca0a3bae820b84b7d813ad1eff15a48a64caea9c823fc8c1b119e8/gitdb-4.0.5-py3-none-any.whl (63kB)
    Collecting six>=1.5 (from python-dateutil)
    Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
    Collecting smmap<4,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython)
    Downloading https://files.pythonhosted.org/packages/d5/1e/6130925131f639b2acde0f7f18b73e33ce082ff2d90783c436b52040af5a/smmap-3.0.5-py2.py3-none-any.whl
    Installing collected packages: numpy, biopython, tabulate, cgecore, smmap, gitdb, gitpython, six, python-dateutil
    Found existing installation: six 1.10.0
    Not uninstalling six at /usr/lib/python3/dist-packages, outside environment /usr
    Successfully installed biopython-1.73 cgecore-1.5.6 gitdb-4.0.5 gitpython-3.1.14 numpy-1.18.5 python-dateutil-2.8.1 six-1.15.0 smmap-3.0.5 tabulate-0.8.9
    Removing intermediate container 2a86e49ef8c8

    Step 6/15 : COPY run_resfinder.py /usr/src/run_resfinder.py
    COPY failed: stat /var/lib/docker/tmp/docker-builder878114651/run_resfinder.py: no such file or directory

  3. CGE Helpdesk

    Dear Rossi Mirko,

    Thanks for trying the ResFinder docker.

    It looks like you did not clone the ResFinder directory:

    git clone https://git@bitbucket.org/genomicepidemiology/resfinder.git

    You should also clone and index the ResFinder database and the PointFinder database in the `resfinder` directory. Instructions on how to do this is in the README of the ResFinder repository.

    I hope this solves the problem, otherwise please do not hesitate to write us again.

    Kind regards,

    Malene, CGE Helpdesk

  4. ROSSI MIRKO

    yes it looks exactly this, I was indeed building the docker image outside the directory. would it be simpler to clone the Resfinder within the Docker image? that would allow to build the image independently from cloning the directory locally before building the image.

  5. CGE Helpdesk

    Glad to hear that you made it work.

    We will consider cloning the ResFinder database within the Docker image, thank you for your suggestion.

    Kind regards

    Malene, CGE Helpdesk

  6. Log in to comment