Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump kallistobustools to 0.28.2 #4981

Merged
merged 19 commits into from
Mar 4, 2024
Merged

Conversation

gennadyFauna
Copy link
Contributor

@gennadyFauna gennadyFauna commented Feb 23, 2024

Changes:

  • Bumped kb version to 0.28.2.
  • Added support for the new nac workflow.
  • Updated main.nf for ref and count to match nomenclature in meta.yml files: intron instead of introns
  • Updated count to match ref and take in a workflow_mode variable. This fixes a bug: the results of the, e.g., lamanno pipeline are incorrect if the workflow is not specified; kb generates one matrix instead of two and ignores the intronic content.
  • Updated tests to account for new quantification logic, removing the nucleus option and adding the nac one, and passing the workflow variable directly into count.
  • Updated the test outputs.

PR checklist

Closes #XXX

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

@gennadyFauna
Copy link
Contributor Author

Note that is a placeholder until the bioconda-recipes PR bioconda/bioconda-recipes#45846 is resolved. Due to incompatibilities between kallisto|bustools and other versions of kallisto, the relevant Docker container is broken.

@gennadyFauna
Copy link
Contributor Author

gennadyFauna commented Feb 27, 2024

The upstream conda distributable has been rebuilt on the relevant repositories; the Docker container (etc.) is now functional.

Copy link
Contributor

@CarsonJM CarsonJM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! At the moment we are trying to migrate modules from pytest to nf-test (https://nf-co.re/docs/contributing/modules#migrating-from-pytest-to-nf-test) would you be able to follow this guide and add nf-test?

@gennadyFauna
Copy link
Contributor Author

gennadyFauna commented Feb 27, 2024

I appreciate it! Unfortunately, at this time, I do not think I am comfortable enough with the pipeline to convert the pytest checks to nf-test, and would prefer to handle that in a future PR.

@gennadyFauna
Copy link
Contributor Author

gennadyFauna commented Feb 29, 2024

Great work! At the moment we are trying to migrate modules from pytest to nf-test (https://nf-co.re/docs/contributing/modules#migrating-from-pytest-to-nf-test) would you be able to follow this guide and add nf-test?

I think there is a test on the dev branch nf-core/scrnaseq written by @fmalmeida that could be straightforward to repurpose. I have already adapted it to the new workflow in the scrnaseq module. But I am not sure how I would insert it here.

@gennadyFauna gennadyFauna requested a review from a team as a code owner February 29, 2024 23:39
@gennadyFauna gennadyFauna requested review from ahvigil and removed request for a team February 29, 2024 23:39
@CarsonJM CarsonJM self-assigned this Feb 29, 2024
@CarsonJM
Copy link
Contributor

@gennadyFauna I went through and added the nf-tests if you are interested in taking a look!

@CarsonJM
Copy link
Contributor

Here is a brief summary of how I went about this:

  1. Ran the following code to add the appropriate files:
    nf-core modules create kallistobustools/ref --migrate-pytest
    ``nf-core modules create kallistobustools/count --migrate-pytest`
  2. I added the files that were used as input in the pytest to the nf-test
  3. I ran the nf-tests using the following command to see if there were any inconsistent hashes in the output
    nf-core modules test kallistobustools/ref
    nf-core modules test kallistobustools/count
  4. There were inconsistent hashes (when the tests fail is will show you which files had changed md5sums). So I added a line to test all files except those with inconsistent hashes:
    path(process.out.count.get(0).get(1)).list().findAll { file(it.toString()).name != "run_info.json" && file(it.toString()).name != "kb_info.json" },
  5. I separate tests for the inconsistent files where I read the lines that don't contain dates/times/runtimes (these are typically what cause inconsistent hashes)
    file(path(process.out.count.get(0).get(1)).list().find { file(it.toString()).name == "kb_info.json" }.toString()).readLines()[2..10],
  6. After going through this process for all inconsistent files and both modules, the tests passed!

Totally okay if this doesn't make sense yet, I just wanted to explain the changes I made and hopefully provide an intro to how nf-tests work!

Copy link
Contributor

@jasmezz jasmezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, another nf-test migration 🎉 Check my comments and update if you find necessary.

modules/nf-core/kallistobustools/count/main.nf Outdated Show resolved Hide resolved
modules/nf-core/kallistobustools/count/tests/main.nf.test Outdated Show resolved Hide resolved
modules/nf-core/kallistobustools/count/tests/main.nf.test Outdated Show resolved Hide resolved
modules/nf-core/kallistobustools/ref/main.nf Outdated Show resolved Hide resolved
process.out.intron_t2c,
).match()
},
{ assert file(process.out.index.get(0)).exists() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot check for file content for these index files?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably could, but I honestly didn't look into it too much haha. I think you're right so I'll see what I can do before merging

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make it slightly more robust. Checking for existence is my last resort when md5 or file content checks are impossible (e.g. a binary file with changing content due to timestamp or something).

Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com>
@CarsonJM
Copy link
Contributor

CarsonJM commented Mar 4, 2024

@gennadyFauna In short, the changes that @jasmezz made to the stub section were to remove unnecessary code. The stub section is basically to perform a "dry run" of a module, so only the outputs are created via touch but nothing is actually run.

The great benefit of this is that you can very quickly make sure that your inputs/outputs chain together correctly without actually running all of the tools.

@CarsonJM
Copy link
Contributor

CarsonJM commented Mar 4, 2024

@jasmezz The index is in some compressed format and I couldn't quickly find out which. Merging for now get this in for @gennadyFauna, but definitely something to look into in the future

@CarsonJM CarsonJM added this pull request to the merge queue Mar 4, 2024
@gennadyFauna
Copy link
Contributor Author

gennadyFauna commented Mar 4, 2024

@jasmezz Thank you – I see, this is for the tests, then. I will read the docs in more detail.

@CarsonJM that should be the kallisto index. But I'm not sure there is documentation about its specifics.

Merged via the queue into nf-core:master with commit de82159 Mar 4, 2024
15 checks passed
jch-13 pushed a commit to jch-13/modules that referenced this pull request Mar 19, 2024
* bump version, add new options from 0.28.2

* waiting on conda

* style

* Update environment.yml

* workflow mode is reqd

* editing tests: the quantification logic has changed

* fixing licenses

* workflow should be specified explicitly

* container fixed at bioconda

* incorrectly recorded md5s

* Added nf-tests for kallistobustools modules

* Delete modules/nf-core/kallistobustools/ref/tests/nextflow.config

* Added kallistobustools/ref tag to kallistobustools/count test

* Don't include path lines in count test

* Apply suggestions from code review

Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com>

---------

Co-authored-by: Carson J Miller <carsonjmiller@outlook.com>
Co-authored-by: Carson J Miller <68351153+CarsonJM@users.noreply.github.com>
Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com>
jennylsmith pushed a commit to RSC-RP/modules that referenced this pull request Mar 20, 2024
* bump version, add new options from 0.28.2

* waiting on conda

* style

* Update environment.yml

* workflow mode is reqd

* editing tests: the quantification logic has changed

* fixing licenses

* workflow should be specified explicitly

* container fixed at bioconda

* incorrectly recorded md5s

* Added nf-tests for kallistobustools modules

* Delete modules/nf-core/kallistobustools/ref/tests/nextflow.config

* Added kallistobustools/ref tag to kallistobustools/count test

* Don't include path lines in count test

* Apply suggestions from code review

Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com>

---------

Co-authored-by: Carson J Miller <carsonjmiller@outlook.com>
Co-authored-by: Carson J Miller <68351153+CarsonJM@users.noreply.github.com>
Co-authored-by: Jasmin Frangenberg <73216762+jasmezz@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants