magarveylab / prism-releases

PRISM source code public releases
8 stars 4 forks source link

fimo dependency check failing #8

Closed dswan closed 3 years ago

dswan commented 6 years ago

I'm struggling to work out why this is occuring:

With the latest jar:

ubuntu@ip-172-31-21-155:~$ java -jar ~/bin/prism.jar  -v
PRISM: version 2.1.5

And From a fresh repository clone:

ubuntu@ip-172-31-21-155:~/git$ git clone https://github.com/magarveylab/prism-releases.git
Cloning into 'prism-releases'...
remote: Counting objects: 4953, done.
remote: Total 4953 (delta 0), reused 0 (delta 0), pack-reused 4953
Receiving objects: 100% (4953/4953), 165.38 MiB | 18.31 MiB/s, done.
Resolving deltas: 100% (2639/2639), done.
Checking connectivity... done.

If I run the command:

ubuntu@ip-172-31-21-155:~$ java -jar ~/bin/prism.jar -a -p -f assembly.fasta -tt -sug -res -rib -w 10000 -r /home/ubuntu/git/prism-releases/prism/WebContent/
[Prism] Set file to assembly.fasta
[Prism] Set clustering window to 10000
[Prism] Set the root folder to /home/ubuntu/git/prism-releases/prism/WebContent/
[Prism] Executing thiotemplated domain search
[Prism] Executing deoxysugar domain search
[Prism] Executing ribosomal domain search
[Prism] Executing resistance domain search
[Prism] Finding all potential coding sequences
[Prism] Using Prodigal to predict open reading frames
Jun 27, 2018 3:36:24 PM ca.mcmaster.magarveylab.wasp.session.SessionManager addSession
INFO: Session added, id = 20180627-1536-909642593
Checking for installed dependencies...
Ensuring BLASTP is installed...
Ensuring hmmsearch is installed...
Ensuring FIMO is installed...
Jun 27, 2018 3:36:24 PM ca.mcmaster.magarveylab.wasp.exception.ExceptionHandler throwException
SEVERE: Error: FIMO is not installed!
ca.mcmaster.magarveylab.prism.util.exception.DependencyBinaryException: Error: FIMO is not installed!
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.checkFimo(PrismDependencyCheck.java:307)
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.checkBinaryDependencies(PrismDependencyCheck.java:188)
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.run(PrismDependencyCheck.java:57)
        at ca.mcmaster.magarveylab.prism.Prism.checkDependencies(Prism.java:119)
        at ca.mcmaster.magarveylab.prism.Prism.run(Prism.java:71)
        at ca.mcmaster.magarveylab.prism.PrismDesktop.main(PrismDesktop.java:98)

EXCEPTION: ca.mcmaster.magarveylab.prism.util.exception.DependencyBinaryException: Error: FIMO is not installed!

ca.mcmaster.magarveylab.prism.util.exception.DependencyBinaryException: Error: FIMO is not installed!
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.checkFimo(PrismDependencyCheck.java:307)
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.checkBinaryDependencies(PrismDependencyCheck.java:188)
        at ca.mcmaster.magarveylab.prism.PrismDependencyCheck.run(PrismDependencyCheck.java:57)
        at ca.mcmaster.magarveylab.prism.Prism.checkDependencies(Prism.java:119)
        at ca.mcmaster.magarveylab.prism.Prism.run(Prism.java:71)
        at ca.mcmaster.magarveylab.prism.PrismDesktop.main(PrismDesktop.java:98)
Analysis complete!
[Prism] Terminated.

However, fimo is installed:

ubuntu@ip-172-31-21-155:~$ which fimo
/home/linuxbrew/.linuxbrew/bin/fimo

And fimo is working:

ubuntu@ip-172-31-21-155:~$ fimo
Usage: fimo [options] <motif file> <sequence file>

   Options:
     --alpha <double> (default 1.0)
     --bfile <background file> (DNA and protein use NRDB by default)
     --max-stored-scores <int> (default=100000)
     --max-strand
     --motif <id> (default=all)
     --motif-pseudo <float> (default=0.1)
     --no-qvalue
     --norc
     --o <output dir> (default=fimo_out)
     --oc <output dir> (default=fimo_out)
     --parse-genomic-coord
     --psp <PSP filename> (default none)
     --prior-dist <PSP distribution filename> (default none)
     --qv-thresh
     --skip-matched-sequence
     --text
     --thresh <float> (default = 1e-4)
     --verbosity [1|2|3|4] (default 2)
     --version (print the version and exit)

   When scanning with a single motif use '-' for <sequence file> to
     read the database from standard input.
   Use '--bfile --motif--' to read the background from the motif file.
   Use '--bfile --uniform--' to use a uniform background.

The .sh file is accessible:

ubuntu@ip-172-31-21-155:~$ cat ~/git/prism-releases/prism/WebContent/motifs/fimo.sh 
#!/bin/bash

MOTIF=$1
QUERY=$2

echo $MODEL
echo $SEQUENCES

# run fimo
fimo --text -verbosity 1 $MOTIF $QUERY

And I can run the test command to completion without error from the same shell:

fimo --text --verbosity 1 ~/git/prism-releases/prism/WebContent/tests/fimo/motif.txt ~/git/prism-releases/prism/WebContent/tests/fimo/query.fasta 
Warning: text mode turns off computation of q-values
motif_id        motif_alt_id    sequence_name   start   stop    strand  score   p-value q-value matched_sequence
3               orf_3|1|24      13      20      +       25.4321 1.16e-09                SMAKGDGW
3               orf_3|1|24      22      29      +       35.2963 2.11e-11                VMAKGDGW

What am I missing here?

dswan commented 6 years ago

A temporary resolution to this was to run it inside a conda environment I had built for antismash. This has it's own fimo install and that passes the tests fine. There is a difference:

ubuntu@ip-172-31-21-155:$ fimo --version
5.0.1
ubuntu@ip-172-31-21-155:$ source activate antismash
(antismash) ubuntu@ip-172-31-21-155:$ fimo --version
4.11.2

And actually the output format differs between the versions:

with 5.0.1:

(antismash) ubuntu@ip-172-31-21-155:$ /home/linuxbrew/.linuxbrew/bin/fimo --text --verbosity 1 motif.txt query.fasta
Warning: text mode turns off computation of q-values
motif_id        motif_alt_id    sequence_name   start   stop    strand  score   p-value q-value matched_sequence
3               orf_3|1|24      13      20      +       25.4321 1.16e-09                SMAKGDGW
3               orf_3|1|24      22      29      +       35.2963 2.11e-11                VMAKGDGW

with 4.11.2:

(antismash) ubuntu@ip-172-31-21-155:$ fimo --text --verbosity 1 motif.txt query.fasta
Warning: text mode turns off computation of q-values
#pattern name   sequence name   start   stop    strand  score   p-value q-value matched sequence
3       orf_3|1|24      13      20      +       25.4321 1.16e-09                SMAKGDGW
3       orf_3|1|24      22      29      +       35.2963 2.11e-11                VMAKGDGW

So it looks like the results handling for fimo doesn't cope with the new 5.0.1 format?

skinnider commented 6 years ago

Thanks for bringing this to our attention - I didn't realize the output format had changed since version 4. I'll try to push a fix to parse FIMO v5 output in the next few days.

nishanthmerwin commented 6 years ago

@skinnider this is fixed on our internal branch, I wrote it to be backwards compatible, so it should be safe to push here. https://github.com/magarveylab/prism/blob/d202c3cf5589b1e41e768ea29fb90cb05d1943d6/prism/src/ca/mcmaster/magarveylab/prism/motif/FimoSearchReader.java#L47-L100

yangziyi1990 commented 3 years ago

Hi, how to find "prism.jar" file, I can not find this file in the latest repository.