davidemms / OrthoFinder

Phylogenetic orthology inference for comparative genomics
https://davidemms.github.io/
GNU General Public License v3.0
709 stars 188 forks source link

Issue with rerunning orthofinder "from trees" step -- Blast0_0.txt not found #899

Open 00-kelvin opened 6 months ago

00-kelvin commented 6 months ago

Hi David,

I've been using Orthofinder for several months on a spider phylogeny project -- what an amazing tool!

The issue I am running into is the following: I am trying to re-run Orthofinder on orthogroups from a previous run (which was already a re-run from a previous run). I have done this before without getting this problem. The program throws an exception right away saying it cannot find the Blast0_0.txt file in the WorkingDirectory from the original run:

time orthofinder -y -ft Results_Nov27_1/ -s /media/will/mimic/k2024/assets/IMPORTANT_edited_ortho_tree.txt -a 36 -t 36

OrthoFinder version 2.5.5 Copyright (C) 2014 David Emms

2024-05-10 12:32:04 : Starting OrthoFinder 2.5.5
36 thread(s) for highly parallel tasks (BLAST searches etc.)
36 thread(s) for OrthoFinder algorithm

Checking required programs are installed
----------------------------------------
Test can run "fastme -i /media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_May10_7/WorkingDirectory/dependencies/SimpleTest.phy -o /media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_May10_7/WorkingDirectory/dependencies/SimpleTest.tre" - ok
/media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_Nov27_1/WorkingDirectory//../../Results_Sep28/WorkingDirectory/Blast0_0.txt not found
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/__main__.py", line 1815, in main
    speciesInfoObj, _ = ProcessPreviousFiles(files.FileHandler.GetWorkingDirectory1_Read(), options.qDoubleBlast)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/__main__.py", line 1463, in ProcessPreviousFiles
    blast_fns_triangular = [files.FileHandler.GetBlastResultsFN(iSpecies, jSpecies) for iSpecies in speciesInfo.speciesToUse for jSpecies in speciesInfo.speciesToUse if jSpecies >= iSpecies]
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/files.py", line 322, in GetBlastResultsFN
    raise Exception(fn + " not found")
Traceback (most recent call last):
  File "/home/will/miniconda3/envs/orthofinder/bin/orthofinder", line 7, in <module>
    main(args)
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/__main__.py", line 1815, in main
    speciesInfoObj, _ = ProcessPreviousFiles(files.FileHandler.GetWorkingDirectory1_Read(), options.qDoubleBlast)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/__main__.py", line 1463, in ProcessPreviousFiles
    blast_fns_triangular = [files.FileHandler.GetBlastResultsFN(iSpecies, jSpecies) for iSpecies in speciesInfo.speciesToUse for jSpecies in speciesInfo.speciesToUse if jSpecies >= iSpecies]
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/will/miniconda3/envs/orthofinder/bin/scripts_of/files.py", line 322, in GetBlastResultsFN
    raise Exception(fn + " not found")
Exception: /media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_Nov27_1/WorkingDirectory//../../Results_Sep28/WorkingDirectory/Blast0_0.txt not found

real    0m0.370s
user    0m0.303s
sys 0m0.070s

As you can see, for some reason there is an extra "/" being added after "Results_Nov27_1/WorkingDirectory..." where it is searching for the Blast files. I believe this extra "/" is the source of the problem, because the Blast0_0.txt file is in the directory that has that same file path but without the extra forward slash.

I apologize if this is an elementary question -- I am in early stages of grad school -- but it appears to me that there may be some issue with the way Orthofinder is generating that file path name, and I wondered if you'd seen this issue before and know how to resolve it. Otherwise maybe I have just messed up the directory structure/names somehow.

Thank you in advance for your time!

vmkhot commented 6 months ago

@00-kelvin Did you resolve this?

I'm having a similar issue except there is no extra '/' in my case, the file orthofinder is looking for (e.g. Blast0_0.txt) actually does not exist. Not sure why Orthofinder would look for a file it did not produce in the first part of the run??

Let me know!

Varada

davidemms commented 3 months ago

Hi

As I understand it on a Linux system an extra '/' shouldn't matter in the filepath. What do you see if you type ls /media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_Nov27_1/WorkingDirectory//../../Results_Sep28/WorkingDirectory/Blast0_0.txt Or realpath /media/will/mimic/k2024/orthofinder/run2/OrthoFinder/Results_Sep28/WorkingDirectory/OrthoFinder/Results_Nov27_1/../Results_Nov27_1/WorkingDirectory//../../Results_Sep28/WorkingDirectory/Blast0_0.txt ?

Can you find the original Blast0_0.txt file?

All the best David

davidemms commented 3 months ago

Hi Varada

If you are still having issues with this we can investigate the issue you're experiencing but we'd need more details.

Best wishes David

vmkhot commented 3 months ago

Hi David,

Thanks for your response. I am no longer having this issue and unfortunately I deleted the log files associated with this issue. I actually did not resolve the problem but I had to change the genomes I was working with so I had to rerun Orthofinder all over again instead of starting from a previous run.

The next time I tried to start from a previous run, it was to remake my Orthologs based on a rooted species tree and that seemed to work fine. I just checked and the Blast0_0.txt file appears to be in the working directories of my successful runs so no issues for me.

Thanks again for building this tool! It has been super helpful for several people in our lab

Varada