drostlab / orthologr

Genome wide orthology inference and dNdS estimation
https://drostlab.github.io/orthologr/
GNU General Public License v2.0
88 stars 27 forks source link

How to set PATH to OrthoFinder2 correctly? #22

Open janstrauss1 opened 4 years ago

janstrauss1 commented 4 years ago

Hi @drostlab,

I'm trying to set up orthologr for detection of orthologs in multiple species.

I've installed orthofinder into my PATH using conda install orthofinder. Calling orthofinder -h from terminal shows OrthoFinder version 2.4.0 Copyright (C) 2014 David Emms suggesting that orthofinder is installed correctly.

Yet, I still run into the following issue when running the example code:

# specify species names
orgs <- c("Arabidopsis lyrata", 
          "Capsella rubella", "Solanum lycopersicum")
# download proteome files for all species          
biomartr::getProteomeSet(db = "refseq", organisms = orgs, path = "of_proteomes")
# download annotation files for all species          
biomartr::getGFFSet(db = "refseq", organisms = orgs, path = "of_gff")
# select longest splice variant per gene locus
retrieve_longest_isoforms_all(proteome_folder = "of_proteomes", 
                              annotation_folder = "of_gff",
                              annotation_format = "gff", 
                              output_folder = "of_proteomes_longest_sv")
> orthofinder2(proteome_folder = "of_proteomes_longest_sv", comp_cores = 4)
sh: orthofinder: command not found
Error: It seems like you don't have OrthoFinder2 installed locally on your machine or the PATH variable to the OrthoFinder2 program is not set correctly.

How should I setup orthofinder correctly?

Many thanks in advance for your help!

HajkD commented 4 years ago

Hi Jan,

Many thanks for your feedback.

So far, orthologr didn't support the conda path version of Orthofinder2, but assumed that it is installed as system tool accessed via usr/local/bin. I realise that most people will install OF2 via conda, so I now changed the default path to the miniconda path /opt/miniconda3/bin/orthofinder. I just pushed the new version of orthologr and this new feature should be accessible to you now.

Please also make sure you have DIAMOND installed as executable tool (/usr/local/bin).

Does this work for you?

Best wishes, Hajk

janstrauss1 commented 4 years ago

Hi Hajk,

Many thanks for your quick response!

Unfortunately, this still doesn't seem to work for me and I get the error:

...
> # run orthofinder2 to infer ortho groups for the specified species
> orthofinder2(proteome_folder = "of_proteomes_longest_sv", comp_cores = 4)
sh: /opt/miniconda3/bin/orthofinder: No such file or directory
Error: It seems like you don't have OrthoFinder2 installed locally on your machine or the PATH variable to the OrthoFinder2 program is not set correctly.

I'm in a macOS environment and my path to OF2 appears to be /Users/janstrauss/miniconda3/bin/orthofinder and /Users/janstrauss/miniconda3/bin/diamond for DIAMOND.

Is there maybe a way to set a custom path in orthologr as for the orthologs() function?

Many thanks in advance for your help!

Jan

HajkD commented 4 years ago

Hi Jan,

Thank you very much for coming back to me and for this great feature request.

I now added a new path argument to orthofinder2() that allows you to specify your own path.

The only problem that I still see is that you cannot pass the diamond path to the orthofinder command line call. So far, orthofinder assumes that DIAMOND is installed in the classic usr/local/bin environment and not in the conda/miniconda path. See also details here: https://github.com/davidemms/OrthoFinder/issues/406 .

I will see if I can find a way around this so that users can also set the diamond path in orthofinder2(), but would be grateful if you could also share some ideas on how to approach this. I would then implement whatever is required.

I hope this helps?

Many thanks, Hajk

mcatto commented 2 years ago

Hi, when I try to set the dNdS functions param ortho_detection to "Orthofinder2" I get the error "Error: Please choose a orthology detection method that is supported by this function." Is there something else I should be doing? Or is this not included in the dNdS function?

HajkD commented 2 years ago

Hi @mcatto

Thank you for your question. Unfortunately, dNdS with orthogroups is not supported yet. It is on my long ToDo list, but it may require a while until this feature is available.

I hope you find pairwise dNdS useful anyway.

Cheers, Hajk