I opened a PR against modules for RiboCode but I a...
# riboseq
j
I opened a PR against modules for RiboCode but I am quite rusty in terms of the latest nf-core guidelines so may need some help getting it in shape. https://github.com/nf-core/modules/pull/9485
i
Thanks! From what I can see, the test failures are snapshot-related due to PDF outputs. Since PDFs generate variable md5sums between runs (even with identical content), replace md5-based assertions with alternative checks for those types of files in your tests. That should sort it out!
j
Thanks Ira! I’ll find an example of a module that outputs a pdf and copy that tomorrow
i
Here's a quick one with PDFs for reference, not sure if this one passes current testing guidelines https://github.com/nf-core/hlatyping/blob/master/modules/nf-core/optitype/tests/main.nf.test.snap
💯 1
j
Thats a great help. Thank you Isaac
🙌 1
j
Reviewing now
First pass review submitted, let me know if you need a hand responding to anything
gratitude thank you 1
Hey @Jack Tierney, would you like me to pick this up and finish it off, get tests passing etc?
j
I was just trying to look into it in more detail before asking for your help. I am stumped on on why some conda are failing and there is another with a subworkflow test failing that, to the best of my knowledge, I didnt touch. I have however noticed that I haven't addressed all of your requested changes yet. I will knock them out this morning and get back to you for help with the others
j
OK, so the issue is that conda environments aren't static. The transitive dependencies (dependencies of dependencies) drift. That means that over time the snapshots between Docker and Conda no longer match, which can cause variation in results. The community is going to address this soon via 'Conda lock files' (which Wave and Seqera containers can make for us). We should fix this by pinning Python in the Biconda recipe I think. Here's my little buddy's summary:
Copy code
⏺ This is a Python 3.10+ compatibility issue with the pyfasta dependency.

  The key error is:
  ImportError: cannot import name 'Mapping' from 'collections'

  What's happening:

  In Python 3.10, collections.Mapping was removed (it had been deprecated since Python 3.3). The correct import is now collections.abc.Mapping.

  The dependency chain is:
  1. RiboCode → pyfasta → tries from collections import Mapping → fails

  The root cause:

  The pyfasta package is outdated and hasn't been updated for Python 3.10+ compatibility. The conda environment is using Python 3.10, which breaks this old import pattern.

  Potential fixes:

  1. Pin Python < 3.10 in the environment.yml:
  dependencies:
    - python=3.9
    - ribocode
  2. Use a patched pyfasta - there may be a fork that fixes this, or the team could pin a specific version that works
  3. Check if RiboCode has a newer version that uses an updated pyfasta or alternative dependency

  This is a common problem with older bioinformatics tools that depend on unmaintained Python packages. Pinning to Python 3.9 is usually the quickest workaround.
(we could fix it in the environment.yml, but we should do it upstream, I can do that now)
j
That makes sense. Thank you. I am going through your comments again right now
j
This is just the spectre of unmaintained bioinformatics software I'm afraid. I see ribocode itself hasn't had a release since 2021
Not sure what's going on with the subworkflow thing either, I've updated your branch to see if it helps, if it's still broken I'll sort that
j
The only think I have left to resolve is the topics instead of
versions.yml
Were you happy with how I defined the versions? example there is no
RiboCode --version
j
Think you're wrong there:
Copy code
❯ docker run --rm <http://quay.io/biocontainers/ribocode:1.2.15--pyhfa5458b_0|quay.io/biocontainers/ribocode:1.2.15--pyhfa5458b_0> RiboCode --version
1.2.14
j
I think I havent woken up properly.. I only have the echo in stubs
j
(though the reported version is wrong I see....)
For the record: there's a specific way we use to set versions if the tool doesn't provide it: https://nf-co.re/docs/guidelines/components/modules#emission-of-versions
j
Thank you. That is good to know
There isnt even a tag for
1.2.15
so I guess the bioconda recipe should say
1.2.14
? although it doesnt look like theres a tag for that either.. 1.2.13 is the latest I see
j
I think someone messed up, both versions are definitely in PyPi. Probably someone forgot to update the version in the released code
They probably didn't couple the GitHub tags/ releases to PyPi, so someone manually made a PyPi release
Bioinformatics software development strikes again!
Actually, the issue that the active repo, which Conda draws from, is: https://github.com/zhengtaoxiao/RiboCode Not: https://github.com/xryanglab/RiboCode
I've smuggled a patch in here to fix the version in the source: https://github.com/bioconda/bioconda-recipes/pull/61360
The pyfasta conda thing should be fixed now and in conda channels, and the ribocode version fix has just merged and will be in channels soon. I'll make some new containers with Seqera containers so we get them quickly
s
Set up Bioconda channels:
Copy code
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
See https://bioconda.github.io/#usage
j
@Jonathan Manning I think I finally have it in ok shape. Just need the bioconda fix, right? https://github.com/nf-core/modules/pull/9485
j
Yep, I'll push some changes for that now if that's OK
Then I'll do a final pass review one we have tests passing
j
Thank you very much. I needed the hand holding on this one
j
Bioconda stuff can be a pain
I think it will be ready to go soon- I just stripped some setup stuff in favour of putting intermediates in test data. Are you in the org and able to review? https://github.com/nf-core/test-datasets/pull/1820
j
Having a look now!
👍 1
✅ 1
Approved!
thankyou 1
j
OK, you're good to go too- tests should pass in a few mins ✅
It's ready!
j
Merged! Thanks again Jonathan.
blob np 1
j
Are you planning to work on the pipeline-level integration?
j
Yup I was just about to ask you about that. I have started including it the same way we have Ribotricer and RiboTISH but we may want to consider a subworkflow instead? Especially as I plan to add at least 3 more tools
j
Yep, subworkflow might be good. Make it a 'local' one while you work it up, get tests running etc, and then migrate to nf-core/modules last thing. Do prompt me for assistance when needed, I know this is a priority for @Felix Krueger
j
Perhaps we get it merged copying the current formatting for now then and move to subworkflow when the other modules are ready. They aren't even in bioconda for the most part so there is so social engineering to be done to get the tool devs to package their tools better
j
Sure, we can mop up later
j
I think the bones of the integration is done. I am just running the full test before making a PR. I suspect I will run into issues if the test samples aren't periodic enough for RiboCodes liking. https://github.com/nf-core/riboseq/tree/feat/add-ribocode
j
Can you make a draft PR so we can see the changes?
j
I thought that might kick off the tests so I was holding off: https://github.com/nf-core/riboseq/pull/136
j
FYI if you put
[skip ci]
in your commit messages it won't trigger CI. It's something I don't do enough, but it's handy for polar bear saving until you're done mucking about
j
Ah. Another good tip. Thank you
🐻‍❄️ 1
blob np 1
Good morning @Jonathan Manning, The full test ran successfully with RiboCode added but only when I added this hack to get around low periodicity. We wouldnt want to make this the default but would it be worthwhile relaxing the defaults to ensure it doesn't error every time. This was Ed Wallaces original complaint about adding RiboCode. Its very precious about the periodic signal needed https://github.com/nf-core/modules/blob/0745ffcda877676de0d0b21208377e841db6218f/modules/nf-core/ribocode/ribocode/tests/nextflow.config#L1
i
Hey! I’m not super familiar with how ribocode works, but I wonder - would the results be reliable if the periodicity requirement it was designed with in mind is not satisfied? And if so, would it be wiser to output an informative error/log instead and not run the tool? Sorry if my q is naive
j
No you're spot on. It'd weaken the confidence in the calls. I do think their standards are very high though. Will we need to change the test data for full test then?
j
So, the basic (non full size) tests are really only there to make the tools run in some way, the output does not need to be at all meaningful in a biological sense. I think I reduced the depth of the reads as much as I could get away with at the time (though they're still not tiny). The hack is perfectly normal in that sense. I'd be more sad if you had to do it to make the full size tests run.
j
Unfortunately this is with
-profile test_full
. I copied the Ribotricer implementation so RiboCode isnt run in the basic tests
j
Ahh, we shouldn't necessarily stop ribocode from running just because we stopped ribotricer. That tool just didn't run at all with the reduced depth sequencing. If Ribocode runs (even if the output is nonsense) we should include it because it helps us monitor differences in behaviour between PRs. As for
test_full
, if one of you knows a nice clean public dataset we could use instead I don't see a problem with switching.
j
Perhaps something of note is that RiboCode doesnt actually error
Copy code
Command output:
  Error, can not determine the P-site locations.Please check your input parameters and try again.
And the process fails because the outputs are missing. We could make the outputs optional?
j
Well, that's just crappy software design and it should error
We should add a line to the module to return a non-zero code when it detects that message
j
Yes that sounds good. That will let us give an informative error message too
👍 1
Perhaps that error should actually be when the previous module outputs an empty file. It is supposed to contain the offsets for each readlenght but if
metaplots
isn't happy with any read lengths it doesnt fail it just passes on a file with headers.
j
Ha, yep, same deal. Bioinformaticians are my people, but I do wonder about us as a species sometimes 😄
j
Okay hope to have a PR for you this morning
j
Great, thanks. If there's anything you haven't got time for I can have Claudio take it the last mile.
j
https://github.com/nf-core/modules/pull/9581 This is all I managed. Could Claudio have a look?
👍 1
j
OK @Jack Tierney, we fixed it up. One of the modules wasn't actually failing when it should, so that's fixed and I've also added tests to make sure the failure modes keep working. I've approved, assuming the tests pass in CI (if they don't I'll fix them) feel fee to merge
OK, all passing!