oushujun / EDTA

Extensive de-novo TE Annotator
https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1905-y
GNU General Public License v3.0
315 stars 70 forks source link

use command -v instead of which #467

Open mikerenfro opened 1 month ago

mikerenfro commented 1 month ago

As per the Unix and Linux StackExcchange: Why not use "which"? What to use then?, command -v has been the POSIX standard way to find paths to commands since around 2008 or earlier.

Using EDTA.pl via Biocontainers on a Red Hat-family system, the container's which (from BusyBox) isn't compatible with the OS definition of which:

$ command -v which
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

Out of the box, the EDTA container fails on Red Hat-family systems as follows:

$ singularity exec EDTA.sif EDTA.pl --genome test.fa

#########################################################
##### Extensive de-novo TE Annotator (EDTA) v2.2.0  #####
##### Shujun Ou (shujun.ou.1@gmail.com)             #####
#########################################################

Parameters: --genome test.fa

Thu May 23 14:59:44 CDT 2024    Dependency checking:
Error: gt is not found in the genometools path ./!

But removing the OS-provided which function allows the container to work:

$ unset which
$ singularity exec EDTA.sif EDTA.pl --genome test.fa

#########################################################
##### Extensive de-novo TE Annotator (EDTA) v2.2.0  #####
##### Shujun Ou (shujun.ou.1@gmail.com)             #####
#########################################################

Parameters: --genome test.fa

Thu May 23 14:59:49 CDT 2024    Dependency checking:
                All passed!

Replacing all of the which calls in the Perl scripts with command -v should resolve this.