Git Product home page Git Product logo

Comments (8)

BEFH avatar BEFH commented on July 20, 2024

I had this issue too. Probably can be fixed by changing this:

column_number=\$(cat $samples | head -n 1 | tr '$separator' "\\n" | grep -En "^$variable" | awk -F':' '{print \$1}')

to this:

column_number=\$(cat $samples | head -n 1 | tr '$separator' "\\n" | grep -En "^$variable\$" | awk -F':' '{print \$1}')

in https://github.com/nf-core/differentialabundance/blob/master/modules/nf-core/custom/tabulartogseacls/main.nf

But the file could probably use some fixing up in general. e.g. for that line:

column_number=\$(head -n 1 $samples | tr '$separator' "\\n" | grep -En "^$variable\$" | cut -d: -f1)

I'm also unsure how many backslashes it needs.

from differentialabundance.

BEFH avatar BEFH commented on July 20, 2024

Alternatively, you can replace line 30 and 31 with this:

classes=\$(awk -F '$separator' 'NR==1 { for (i=1; i<=NF; i++) if (\$i == $variable) {lnum = i; next}} 1 {print \$lnum}' $samples)

One-liner with no piping.

from differentialabundance.

asp8200 avatar asp8200 commented on July 20, 2024

Which branch was this error observed on? Is there a simple test nf-cmd to trigger the error?

from differentialabundance.

jenmuell avatar jenmuell commented on July 20, 2024

To come back to the question of @asp8200, on which branch did you observe the error? I could only recreate the error on the main branch. If you pull the pipeline from the dev branch this should solve the issue.
I could not recreate the error on the dev branch.

from differentialabundance.

BEFH avatar BEFH commented on July 20, 2024

Looks like it's already fixed here: https://github.com/nf-core/differentialabundance/blob/dev/modules%2Fnf-core%2Fcustom%2Ftabulartogseacls%2Fmain.nf#L30

But my suggested awk-only replacement of that line and the next might still be more robust. Should I bother with a pull-request or nah?

from differentialabundance.

jenmuell avatar jenmuell commented on July 20, 2024

Hmm, I'm not familiar with the run time of awk. Could we run in some problems with the for-loop in your on-line awk option? Especially, with large datasets.

from differentialabundance.

BEFH avatar BEFH commented on July 20, 2024

from differentialabundance.

WackerO avatar WackerO commented on July 20, 2024

@BEFH I will say I'm not an AWK expert, but if your code solution is more robust, do feel free to make a PR!
@jenmuell thanks for looking into this!

from differentialabundance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.