mahulchak / quickmerge

A simple and fast metassembler and assembly gap filler designed for long molecule based assemblies.
GNU General Public License v3.0
192 stars 31 forks source link

Quickmerge fails to set its PATH internally #70

Open neoformit opened 2 years ago

neoformit commented 2 years ago

Hi, I am developing a Galaxy tool for Quickmerge and it looks like your tool is doing some internal PATH management that causes an edge-case bug.

When I conda install quickmerge into virtual environment quickmerge or foo it runs with no issue.

When I conda install quickmerge into virtual environment __quickmerge@0.3 it fails with errors like so:

Can't locate Foundation.pm in @INC (you may need to install the Foundation module) (@INC contains: 
/opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/scripts
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/5.32/site_perl 
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/site_perl 
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/5.32/vendor_perl 
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/vendor_perl 
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/5.32/core_perl 
/opt/miniconda/envs/__quickmerge@0.3/lib/perl5/core_perl .) at 
/opt/miniconda/envs/__quickmerge@0.3/bin/nucmer line 19.

---

Job in error state.. tool_id: quickmerge, exit_code: 1, stderr: ERROR: The following critical files could not be used
/opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/aux_bin/postnuc
/opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/aux_bin/prenuc
/opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/mgaps
/opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/mummer
Check your paths and file permissions and try again

This path doesn't exist:

/opt/miniconda/envs/__quickmerge.3

This env does exist:

/opt/miniconda/envs/__quickmerge@0.3

As you can see, Quickmerge is searching for dependencies in the wrong paths. I think somewhere in the tool you are parsing the present working directory in a way that __quickmerge@0.3 becomes __quickmerge.3 and therefore the tool's dependencies cannot be found?

I can solve this issue with a hacky fix that confirms the issue:

cd /opt/miniconda/envs
ln -s __quickmerge@0.3 __quickmerge.3

Quickmerge will then run without fail, but this is NOT a feasible solution for us.

I do hope that this is an easy fix for you, as your tool would be a great addition to the Galaxy community!

mahulchak commented 2 years ago

@jgbaldwinbrown @esolares can we fix this?

esolares commented 2 years ago

I'll look into it later today.

On Mon, May 9, 2022, 11:12 AM Mahul Chakraborty @.***> wrote:

@jgbaldwinbrown https://urldefense.com/v3/__https://github.com/jgbaldwinbrown__;!!CzAuKJ42GuquVTTmVmPViYEvSg!I0SAuUF2-zVqBceUpPvNpc0Mvr5aJLatg7_ONP0abfBprTz50ZGL9jAXjsuhYoRI6BerfjNHQUfUDxhgNCJkR08$ @esolares https://urldefense.com/v3/__https://github.com/esolares__;!!CzAuKJ42GuquVTTmVmPViYEvSg!I0SAuUF2-zVqBceUpPvNpc0Mvr5aJLatg7_ONP0abfBprTz50ZGL9jAXjsuhYoRI6BerfjNHQUfUDxhgXFkhFaY$ can we fix this?

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/mahulchak/quickmerge/issues/70*issuecomment-1121420193__;Iw!!CzAuKJ42GuquVTTmVmPViYEvSg!I0SAuUF2-zVqBceUpPvNpc0Mvr5aJLatg7_ONP0abfBprTz50ZGL9jAXjsuhYoRI6BerfjNHQUfUDxhg71n0Wig$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABBDVPUESEGE5QFHNMRKSMTVJFIRLANCNFSM5VLWTVEA__;!!CzAuKJ42GuquVTTmVmPViYEvSg!I0SAuUF2-zVqBceUpPvNpc0Mvr5aJLatg7_ONP0abfBprTz50ZGL9jAXjsuhYoRI6BerfjNHQUfUDxhgCSdO7Eo$ . You are receiving this because you were mentioned.Message ID: @.***>

jgbaldwinbrown commented 2 years ago

Thanks Edwin! I didn't work at all on the conda installation, so I probably can't do much to help here. Let me know if there's anything I can do, though.

esolares commented 2 years ago

Hi,

Thank you for bringing this to our attention. I have taken a look and this is actually not a quickmerge issue, but instead an issue with MUMmer. Some applications in MUMmer use perl as a wrapper. If you try to run nucmer by itself, you will get the following error: Can't locate Foundation.pm in @INC (you may need to install the Foundation module) @.*** contains: /opt/miniconda/conda3/envs/__quickmerge.3/opt/mummer-3.23/scripts

Perl appears to need to escape special characters, such as \ and @. It appears that MUMmer has already been installed in Galaxy. Perhaps they created a work around for some of the issues with Perl. Unfortunately, I am not familiar with Perl and will have to defer to @jgbaldwinbrown https://urldefense.com/v3/__https://github.com/jgbaldwinbrown__;!!CzAuKJ42GuquVTTmVmPViYEvSg!I0SAuUF2-zVqBceUpPvNpc0Mvr5aJLatg7_ONP0abfBprTz50ZGL9jAXjsuhYoRI6BerfjNHQUfUDxhgNCJkR08$ @mahulchak on this one. Both errors appear to be coming from MUMmer executables. Quickmerge is simply forwarding the error. Are either of you familiar with Perl?

Thank you,

Edwin Solares, PhD UC President's Postdoctoral Fellow Crop Population Genomics Department of Evolution and Ecology Ross-Ibarra Lab Storer Hall, One Shields Ave Davis, CA 95616 USA

If this email was sent after hours or during a holiday break, please feel free to respond during normal working hours. My brain sometimes works at odd hours throughout the day. :)

On Sun, May 8, 2022 at 3:06 AM Cameron Hyde @.***> wrote:

Hi, I am developing a Galaxy tool for Quickmerge and it looks like your tool is doing some internal PATH management that causes an edge-case bug.

When I conda install quickmerge into virtual environment quickmerge or foo it runs with no issue.

When I conda install quickmerge into virtual environment @.*** it fails with errors like so:

Can't locate Foundation.pm in @INC (you may need to install the Foundation module) @. contains: /opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/scripts @./lib/perl5/5.32/site_perl @./lib/perl5/site_perl @./lib/perl5/5.32/vendor_perl @./lib/perl5/vendor_perl @./lib/perl5/5.32/core_perl @./lib/perl5/core_perl .) at @./bin/nucmer line 19.


Job in error state.. tool_id: quickmerge, exit_code: 1, stderr: ERROR: The following critical files could not be used /opt/miniconda/envs/quickmerge.3/opt/mummer-3.23/aux_bin/postnuc /opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/aux_bin/prenuc /opt/miniconda/envs/quickmerge.3/opt/mummer-3.23/mgaps /opt/miniconda/envs/__quickmerge.3/opt/mummer-3.23/mummer Check your paths and file permissions and try again

This path doesn't exist:

/opt/miniconda/envs/__quickmerge.3

This env does exist:

@.***

As you can see, Quickmerge is searching for dependencies in the wrong paths. I think somewhere in the tool you are parsing the present working directory in a way that @.*** becomes __quickmerge.3 and therefore the tool's dependencies cannot be found?

I can solve this issue with a hacky fix that confirms the issue:

cd /opt/miniconda/envs ln -s @.*** __quickmerge.3

Quickmerge will then run without fail, but this is NOT a feasible solution for us.

I do hope that this is an easy fix for you, as your tool would be a great addition to the Galaxy community!

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/mahulchak/quickmerge/issues/70__;!!CzAuKJ42GuquVTTmVmPViYEvSg!NTmiUpSH1FwcRaefCwdHT7W4ErpHO0bilH4cvez5HwQ6ebDb6wKagsW7_NfZQWUjM9YsHrp64xkKd0XK7NktY28$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/ABBDVPVUTNOV6CZO45PJDS3VI6G2PANCNFSM5VLWTVEA__;!!CzAuKJ42GuquVTTmVmPViYEvSg!NTmiUpSH1FwcRaefCwdHT7W4ErpHO0bilH4cvez5HwQ6ebDb6wKagsW7_NfZQWUjM9YsHrp64xkKd0XK9rNn5yc$ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

neoformit commented 2 years ago

Hi all,

Thanks a lot for looking into this. Mummer does indeed exist as a Galaxy tool. I assume this issue has never arisen in Mummer, because this Galaxy tool installs a number of packages and hence the environment name is not __mummer@X.X but mulled-v1-abcd1234.

If any of you would be able to create a solid fix for this issue, that would be great - I hope that it might only require declaring a string in "raw" format or something like that. Otherwise I can perhaps get around this by "requiring" some redundant package to replicate the Mummer tool execution - another hack but perhaps a better one than I posted.

Thanks again for your time. Cameron

mahulchak commented 2 years ago

Hi Cameron,

We might have to go with your 'hack' as it seems we may not be able to address the fix right now. However, I'll keep this issue open in the hope of fixing it in the future :)