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

create ASCAT nf tests and remove pytest #5314

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mauro-saporita
Copy link
Contributor

PR checklist

Closes #5170

nf-test not working - pytest runs as expected but the nf-test I've created returns the following error: Path value cannot be null

  • 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

Comment on lines -25 to -34
// extended tests running with 1000 genomes data. Data is downloaded as follows:
// wget http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/HG00154/alignment/HG00154.mapped.ILLUMINA.bwa.GBR.low_coverage.20101123.bam
// wget http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/HG00154/alignment/HG00154.mapped.ILLUMINA.bwa.GBR.low_coverage.20101123.bam.bai
// wget http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/HG00155/alignment/HG00155.mapped.ILLUMINA.bwa.GBR.low_coverage.20101123.bam
// wget http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase1/data/HG00155/alignment/HG00155.mapped.ILLUMINA.bwa.GBR.low_coverage.20101123.bam.bai
// wget https://www.dropbox.com/s/l3m0yvyca86lpwb/G1000_loci_hg19.zip
// wget https://www.dropbox.com/s/3fzvir3uqe3073d/G1000_alleles_hg19.zip
// wget https://www.dropbox.com/s/v0tgr1esyoh1krw/GC_G1000_hg19.zip
// wget https://www.dropbox.com/s/50n7xb06x318tgl/RT_G1000_hg19.zip

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we could keep this info somewhere for local testing on input file changes. maybe we can add a readme here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I'm going to save it in a readme; where do you suggest I should save it? In modules/nf-core/ascat/tests?

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 that is a good palce


then {
assertAll (
{ assert process.success }
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a check for the version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added; but unfortunately the test doesn't work, I get the following error: Path value cannot be null

Copy link
Contributor

Choose a reason for hiding this comment

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

when you ru the module manually do you get a versions file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I get the error when it runs { assert process.success } so it doesn't run the test at all - could be something wrong with the way I declare the inputs?

                input[1] = []
                input[2] = []
                input[3] = []
                input[4] = []
                input[5] = []
                input[6] = []

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the pytest runs with the following:

ASCAT_SIMPLE ( input , [], [], [], [], [], [])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Path value cannot be null issue solved by @sateeshperi - but test still not working

@lgrochowalski lgrochowalski self-requested a review March 20, 2024 13:08
@maxulysse maxulysse added this pull request to the merge queue Mar 20, 2024
@mauro-saporita mauro-saporita removed this pull request from the merge queue due to a manual request Mar 20, 2024
@mauro-saporita
Copy link
Contributor Author

@maxulysse let's hold a bit on this PR; tests are not working yet 😣

modules/nf-core/ascat/tests/main.nf.test Outdated Show resolved Hide resolved
file(params.test_data['homo_sapiens']['illumina']['test2_paired_end_sorted_bam_bai'], checkIfExists: true)
]
input[1] = file(params.test_data['homo_sapiens']['illumina']['test2_allele_specific_recal'], checkIfExists: true)
input[2] = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you check if path(loci_files) is optional aswell? I know we discussed that on slack but maybe that is why the nf-test does not run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be optional but for some reason pytest works without loci and allele files. I'm trying to figure out why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also would like to run nf-test using loci_files and allele_files but they are not in test_data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be optional but for some reason pytest works without loci and allele files. I'm trying to figure out why.

Got it now, pytest only executed stub test: nextflow run ./tests/modules/nf-core/ascat -entry test_ascat -c ./tests/config/nextflow.config -stub-run

Copy link
Contributor

@famosab famosab Mar 21, 2024

Choose a reason for hiding this comment

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

Edit: I just say that you said there are none so we need to add them via PR.

(Ok then we'll need to search for alternatives for those files here here or if there are none add them.)

{ assert snapshot(process.out.versions).match("versions") }
)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to add the stub test here aswell. You can just copy the normal test and add stub to the name as well as a line saying options "-stub"

@@ -43,9 +43,6 @@ artic/guppyplex:
artic/minion:
- modules/nf-core/artic/minion/**
- tests/modules/nf-core/artic/minion/**
ascat:
Copy link
Contributor

Choose a reason for hiding this comment

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

Does anyone know why the CI pytest is triggered despite removal from the config by the CI nf-test is not triggered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only pytest-changes is triggered (not sure if it should run or not); pytest doesn't run.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes my bad! But nf-test should be triggered but is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could it be because snapshot is not available yet?

Copy link
Contributor

Choose a reason for hiding this comment

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

But then the linting should fail first and that is also not triggered. Can you run nf-test locally?
nf-core modules test ascat --profile docker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But then the linting should fail first and that is also not triggered. Can you run nf-test locally? nf-core modules test ascat --profile docker?

I run the test locally but it fails because loci_files and allele_files are missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@famosab could you help me to identify the right loci_files and allele_files for testing?

Can we use the files used in Sarek?
https://github.com/nf-core/sarek/blob/6aeac929c924ba382baa42a0fe969b4e0e753ca9/conf/igenomes.config#L15

Copy link
Contributor

Choose a reason for hiding this comment

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

These should work when they work with sarek - I would go for the latest reference genome: https://github.com/nf-core/sarek/blob/6aeac929c924ba382baa42a0fe969b4e0e753ca9/conf/igenomes.config#L46
Somewhere in the sarek conf it also says that you can setup the reference for ascat yourself and there are some intermediate steps to take but I guess they already did those for igenomes. I think we just have to make sure that the test_data input is also hg38 if we use human data.

Copy link
Contributor

Choose a reason for hiding this comment

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

mauro-saporita and others added 3 commits March 21, 2024 11:59
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
include { UNZIP as UNZIP_RT } from '../../../../modules/nf-core/unzip/main.nf'

workflow test_ascat {
input = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also update the path as in #5281 ? :)

@famosab
Copy link
Contributor

famosab commented May 15, 2024

@mauro-saporita Do you still have time to work on the proposed changes?

@mauro-saporita
Copy link
Contributor Author

@mauro-saporita Do you still have time to work on the proposed changes?

I'm sorry lately I've been off the radar; busy with some other projects. I can work on this issue in June unless someone else would like to take it in the next week Hackathon event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Todo
Development

Successfully merging this pull request may close these issues.

ascat
5 participants