fbreitwieser / krakenuniq

🐙 KrakenUniq: Metagenomics classifier with unique k-mer counting for more specific results
GNU General Public License v3.0
224 stars 43 forks source link

broken report-file in singularity #118

Open merszym opened 2 years ago

merszym commented 2 years ago

Problem and Responsible Code

Hi

There is a problem in the way the report-file is created \ More specific: the way the CL: statement in the header is created doesnt work as expected in some cases\ (in my case, within a singularity container)

Cause of the problem https://github.com/fbreitwieser/krakenuniq/blob/5bb224c15c00da61bfddd274b0932f9b7201a16f/scripts/krakenuniq#L233

Result\ Running krakenuniq with singularity causes the report-files to be spammed with lines..

Steps to Reproduce the Problem

  1. Create and execute a test-perl-script

    echo 'my $mycmd = qx/ps -o args= $$/;' > test.pl 
    echo 'print STDERR "CL: $mycmd"' >> test.pl
    perl test.pl

    it returns the command, as expected >>> perl test.pl

  2. Open a singularity shell within a krakenuniq container

    singularity shell docker://quay.io/biocontainers/krakenuniq:1.0.0--pl5321h19e8d03_0
  3. execute the test-file

    perl test.pl

    this returns a lot of lines, e.g.

    ...
    [kworker/0:1-eve]
    [kworker/6:0-eve]
    [kworker/3:0-eve]
    [kworker/7:0-cgr]
    [kworker/4:2-eve]
    [kworker/2:1-mm_]
    [kworker/5:1-eve]
    [kworker/1:2-eve]
    [kworker/u17:1]
    [kworker/5:2-mm_]
    [kworker/4:1-mm_]
    [kworker/6:2]
    [kworker/u16:2]
    [kworker/2:2-eve]
    [kworker/7:2-eve]
    /usr/libexec/tracker-store
    {starter-suid} Singularity runtime parent
    /bin/bash --norc
    /lib/systemd/systemd-udevd
    perl test.pl
    ps -o args= 269516

Solution

Currently I just filter the report again with echo "\$(grep -E '^(#|%|[0-9]).*' krakenUniq.report)" > krakenUniq.report

But maybe there is a more elegant way to capture the executed command in the header?

Thanks a lot!

boulund commented 2 years ago

This was fixed in my PR last week, but it seems the change hasn't made it into a new release here on Github (and thus not into bioconda/biocontainer).

https://github.com/fbreitwieser/krakenuniq/pull/117

@alekseyzimin are there any plans for a new release anytime soon?

merszym commented 2 years ago

Ah nice, so its only a matter of time then :) Thanks for looking into it!

alekseyzimin commented 2 years ago

Sure, in fact this has just passed my internal testing so I will release it today.

On Thu, Oct 6, 2022 at 2:54 AM Fredrik Boulund @.***> wrote:

This was fixed in my PR last week, but it seems the change hasn't made it into a new release here on Github (and thus not into bioconda/biocontainer).

117 https://github.com/fbreitwieser/krakenuniq/pull/117

@alekseyzimin https://github.com/alekseyzimin are there any plans for a new release anytime soon?

— Reply to this email directly, view it on GitHub https://github.com/fbreitwieser/krakenuniq/issues/118#issuecomment-1269435313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGPXGHN45VX56ZCQE2RW5C3WBZZTZANCNFSM6AAAAAAQZWGH4I . You are receiving this because you were mentioned.Message ID: @.***>

-- Dr. Alexey V. Zimin Associate Research Scientist Department of Biomedical Engineering, Johns Hopkins University, Baltimore, MD, USA (301)-437-6260 website http://ccb.jhu.edu/people/alekseyz/ blog http://masurca.blogspot.com

boulund commented 2 years ago

The original issue seems resolved in the recent 1.0.1a release. However, I don't get anything other than the two comment lines at the top of the report file when I run KrakenUniq in a container (in my testing I used the official Biocontainer image docker://quay.io/biocontainers/krakenuniq:1.0.1a--pl5321h19e8d03_1). The report file looks just fine if I run the same version with conda outside of a Singularity container. Not sure what is going on. This may actually be the issue reported in #115