amr icon indicating copy to clipboard operation
amr copied to clipboard

Absolute target for *latest* symbolic link

Open oschwengers opened this issue 1 year ago • 2 comments

Hi and thanks for developing and maintaining AMRFinder!

We use AMRFinder within Bakta and we quite often get filed issues when people move their Bakta database containing an instance of the AMRFinder database within a subdirectory (https://github.com/oschwengers/bakta/issues/159 https://github.com/oschwengers/bakta/issues/151). Unfortunately, this breaks the target of the latest symlink which points to an absolute path.

For example:

cd /tmp
mkdir -p bakta-db/amrfinderplus-db
cd bakta-db/
amrfinder_update --database amrfinderplus-db/

cd /tmp
mv bakta-db/ bakta-db-other

In this example, the absolute symlink is broken because the parent directory was moved/renamed. Even worse, AMRFinder is not updating/fixing this broken symlink via amrfinder_update --database amrfinderplus-db/ so users have to delete the symlink. Would it be possible to a) use a relative instead of absolute symlink helping to forestall broken absolute link targets and b) catching this in an automated transparent manner?

I think this would help all AMRFinder users, not only those using it via Bakta. Again, thanks a lot!

oschwengers avatar Oct 12 '22 09:10 oschwengers

Thanks for your suggestion. I'm not actually sure why we aren't using relative links for that. I think that an earlier version of the software did (or maybe what I'm remembering is just that I used relative links in manual testing).

We'll talk and see if we can't change to using relative links. In the meantime you could post-process to remove the absolute link and replace it with a relative one, but I can't think of a reason off of the top of my head why we can't change the behavior.

evolarjun avatar Oct 12 '22 15:10 evolarjun

Thanks @evolarjun for considering this! It would be very helpful for Bakta and I guess potentially also for AMRFinder users.

oschwengers avatar Oct 17 '22 07:10 oschwengers

We just made a release of version 3.10.45 that switches to using a relative link for the database directory (https://github.com/ncbi/amr/releases/tag/amrfinder_v3.10.45). It's public here and on dockerhub. Version 3.10.45 hasn't appeared in bioconda yet, but in a few hours to a day it should be out in bioconda as well.

Hope that helps, and thanks for using AMRFinderPlus.

BTW: I heard good things about Bakta at the ASM NGS meeting last week.

evolarjun avatar Oct 24 '22 16:10 evolarjun

Thanks a lot for taking care of this. It's very much appreciated!

BTW: I heard good things about Bakta at the ASM NGS meeting last week.

Glad to hear ;-) Sadly, I couldn't make it to the ASM NGS this year

oschwengers avatar Oct 25 '22 16:10 oschwengers