linzhi2013 / MitoZ

MitoZ: A toolkit for assembly, annotation, and visualization of animal mitochondrial genomes

Home Page: https://doi.org/10.1093/nar/gkz173

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker install test run fails to annotate tRNA and splits and doubles sRNA

kneubehl opened this issue · comments

I have tried on 2 different machines PopOS 22.04 LTS and PopOS 21.04

MitoZ v3.5

Installed via Docker (docker pull guanliangmeng/mitoz:3.5)

Did you run a test after your installation, and was the test run okay?

Test ran and failed to annotate tRNAs and split the sRNA and reported 2 sRNAs.

The command you used?

docker run -v $PWD:$PWD -w $PWD --rm guanliangmeng/mitoz:3.5 mitoz all --genetic_code 5 --clade Arthropoda --outprefix "${PWD##*/}"_mitoz --thread_number 8 --fq1 test.1.fq.gz --fq2 test.2.fq.gz --fastq_read_length 150 --insert_size 250 --requiring_taxa Arthropoda

Problem description. Test run fails please advise on how to troubleshoot.

Log messages from MitoZ (stdout and stderr). See attached mitoz.log and stdout:

mitoz.log
mitoz_stdout_log.txt

2023-04-12 02:11:07,036 - mitoz.utility.utility - INFO -
tRNA_annotation() chdir to /home/cygnus/mt_annotation/tmp_cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitosca
f.fa

2023-04-12 02:11:07,036 - mitoz.utility.utility - INFO -
## begin tRNA annotation...
## remove previous tRNA result file (if any)
rm -rf /home/cygnus/mt_annotation/tmp_cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa/cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa.trna

2023-04-12 02:11:07,050 - mitoz.utility.utility - INFO -
cd /app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi
# and find the cmsearch progrm
sh detect_platform.sh
java -Xmx2048m -jar mitfi.jar -cores 1  -code 5 -evalue 0.001 -onlycutoff /home/cygnus/mt_annotation/tmp_cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa/cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa.k141_6 >>/home/cygnus/mt_annotation/tmp_cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa/cygnus_mitoz_cygnus_mitoz.megahit.mitogenome.fa_mitoscaf.fa.trna
detect_platform.sh: 4: detect_platform.sh: [[: not found
detect_platform.sh: 16: detect_platform.sh: [[: not found
detected platform: linux
detect_platform.sh: 26: detect_platform.sh: [[: not found
MiTFi - mitochondrial tRNA finder v0.1
#RESULTS (cutoff evalue: 0.001)
#0 hits

It seems that [[: syntax does not work properly within this docker image. I will try to rebuild the image soon.

For now, you can try the following solution:

image

Thanks for reporting the issue!

OK so I shell'd into the docker container and ran ln -sfv /bin/bash /bin/sh which returned '/bin/sh' -> '/bin/bash/'. I then checked the shell with echo $SHELL which returned /bin/bash and ran the following mitoz all --genetic_code 5 --clade Arthropoda --outprefix "${PWD##*/}"_mitoz --thread_number 8 --fq1 testd_length 150 --insert_size 250 --requiring_taxa Arthropoda 1>m.log 2>m.err all within the directory containing the test fastq files. This has gotten rid of the [[: not found issue but mitfi still fails to find tRNAs. Logs and summary are attached.

2023-04-12 16:53:08,316 - mitoz.utility.utility - INFO - 
cd /app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi
# and find the cmsearch progrm 
sh detect_platform.sh 
java -Xmx2048m -jar mitfi.jar -cores 1  -code 5 -evalue 0.001 -onlycutoff /home/caracol/mitoz_test/mt_annotation/tmp_mitoz_test_mitoz_mitoz_test_mitoz.megahit.mitogenome.fa_mitoscaf.fa/mitoz_test_mitoz_mitoz_test_mitoz.megahit.mitogenome.fa_mitoscaf.fa.k141_6 >>/home/caracol/mitoz_test/mt_annotation/tmp_mitoz_test_mitoz_mitoz_test_mitoz.megahit.mitogenome.fa_mitoscaf.fa/mitoz_test_mitoz_mitoz_test_mitoz.megahit.mitogenome.fa_mitoscaf.fa.trna
MiTFi - mitochondrial tRNA finder v0.1
#RESULTS (cutoff evalue: 0.001)
#0 hits

summary.txt
m.err.txt
m.log.txt
mitoz.log.txt

Thanks for the information!

I think I figure out the reason now.

root@163c1f5b8df1:/Users/gmeng/Downloads/mitoz_test_run# cd /app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi

root@163c1f5b8df1:/app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux

bash: infernal-1.0.2.binaries/cmsearch.linux: cannot execute binary file: Exec format error

When I use the cmsearch binary file from an old version of MitoZ, it works properly

cmsearch
Incorrect number of command line arguments.
Usage: cmsearch [-options] <cmfile> <sequence file>

  where basic options are:
  -h             : show brief help on version and usage
  -o <f>         : direct output to file <f>, not stdout
  -g             : configure CM/HMM for glocal alignment [default: local]
  -p             : append posterior probabilities to hit alignments
  -x             : annotate non-compensatory bps in output alignments with 'x'
  -v             : annotate negative scoring non-canonical bps with 'v'
  -Z <x>         : set Z (database size in *Mb*) to <x> for E-value calculations
  --toponly      : only search the top strand
  --bottomonly   : only search the bottom strand
  --forecast <n> : don't do search, forecast running time with <n> processors
  --informat <s> : specify the input file is in format <x>, not FASTA
  --mxsize <x>   : set maximum allowable HMM banded DP matrix size to <x> Mb
  --devhelp      : show list of undocumented developer options

This was caused by the mistaken use of cmsearch binary for Mac OS for Linux. In fact, all three binaries (cmsearch.darwin_arm64/cmsearch.darwin_i386/cmsearch.linux) under mitoz/annotate/script/mitfi/infernal-1.0.2.binaries are for Mac OS.

This affects all releases of MitoZ 3.5 (e.g., installation via conda or source codes or Docker).

I will rebuild them asap.

Thanks again for letting me know about the bug!

For the impatient (no matter by which way you installed MitoZ 3.5), you can download this cmsearch.linux.zip and unzip it, and then replace the file mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux with it.

$ unzip cmsearch.linux.zip
$ rm -rf  /Your/Path/To/mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux 
$ mv cmsearch.linux  /Your/Path/To/mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux 

For example, if you are using the Docker version, you need to shell into the container:

# assuming your unzipped cmsearch.linux  is in the current directory

$ docker run -it -v $PWD:$PWD -w $PWD  guanliangmeng/mitoz:3.5
$ workdir=$PWD

# change the default shell to bash
$ ln -sfv /bin/bash /bin/sh

$ mv cmsearch.linux /app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux

# check it:
$ /app/anaconda/lib/python3.9/site-packages/mitoz-3.5-py3.9.egg/mitoz/annotate/script/mitfi/infernal-1.0.2.binaries/cmsearch.linux

# If it works, then you can now go back to the ` $PWD` path and start your analysis

# Note, because any changes we make within a Docker container will be lost when the container is destroyed, 
# therefore, in the above docker command, I have removed the `--rm` option.
$ cd $workdir
$ mitoz -h