This PR unifies the way that external resources (such as BSSMs, alphabet definitions, or score matrices) are obtained in GenomeThreader. In the proposed approach, the following chain of locations will be searched for the file in question, in order:
the value of the corresponding environment variable, e.g. GTHDATADIR or GTHBSSMDIR
if the file was not found there, the gthdata or bssm subdirectories of the directory where the gth executable resides
finally, the gthdata or bssm subdirectories of the system wide locations /usr/share/genomethreader, /usr/local/share/genomethreader, /usr/lib/genomethreader and /usr/local/lib/genomethreader.
The latter one is new because in system-wide installation situations, gth is in /usr/bin but the FHS disallows subdirectories there. Also, one cannot always assume that environment variables are set by default.
In general, this approach mirrors what is already done in GenomeTools.
This PR unifies the way that external resources (such as BSSMs, alphabet definitions, or score matrices) are obtained in GenomeThreader. In the proposed approach, the following chain of locations will be searched for the file in question, in order:
GTHDATADIR
orGTHBSSMDIR
gthdata
orbssm
subdirectories of the directory where thegth
executable residesgthdata
orbssm
subdirectories of the system wide locations/usr/share/genomethreader
,/usr/local/share/genomethreader
,/usr/lib/genomethreader
and/usr/local/lib/genomethreader
.The latter one is new because in system-wide installation situations,
gth
is in/usr/bin
but the FHS disallows subdirectories there. Also, one cannot always assume that environment variables are set by default.In general, this approach mirrors what is already done in GenomeTools.