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

How to use the same samplesheet (containg relativ paths) for both nextflow & nf-test? #222

Closed
rollf opened this issue Jun 13, 2024 · 5 comments

Comments

@rollf
Copy link

rollf commented Jun 13, 2024

Hi,
I have a samplesheet that contains the paths to test data relative to the project root directory (i.e. ./tests/fastq.fq). This can be fed into nextflow just fine. I cannot use it for nf-test because lauchnDir is <root>/.nf-test/tests/ec09802a1b5407d9ce413b436ce44403 in there, these paths are not correct. Using stage { symlink <dir-containing-the-fastq-files> } doesn't work neither because the symlink is created in $launchDir/meta (and not in $launchDir directly). Besides, the docs say that file is/will become obsolete.

How can I use the same samplesheet for both nextflow and nf-test?

(I'm sorry if this is explained somewhere, I didn't find any match here or in the docs.)

@rollf rollf changed the title How to use the same samplesheet (containg relativ paths) for both nextflow & nf-test How to use the same samplesheet (containg relativ paths) for both nextflow & nf-test? Jun 13, 2024
@lukfor
Copy link
Collaborator

lukfor commented Jun 13, 2024

Hi! Thank you! This issue should be resolved in version 0.9.0-rc2. We now use <root> as the launchDir, making staging obsolete. I plan to release 0.9.0 tomorrow.

@lukfor
Copy link
Collaborator

lukfor commented Jun 13, 2024

Btw: you can test it with version 0.9.0-rc2 by installing it using this command:

wget -qO- https://get.nf-test.com | bash -s 0.9.0-rc2

@rollf
Copy link
Author

rollf commented Jun 13, 2024

Okay, cool, thank you!

@rollf
Copy link
Author

rollf commented Jun 14, 2024

I tried version 2bc23bc73d7f2643bc7a70b042dc52b9f45190ff (9.0.0-rc2) and I'm still not able to run nf-test as expected. Maybe I'm doing it wrong 🤔. This is how my test data looks like. I'm able to run nextflow ... --input tests/data/tsc/samplesheet.csv but nf-test will still complain.

❯ cat tests/data/tsc/samplesheet.csv
sample,fastq_1,fastq_2
HD200-rep1_S1,./tests/data/tsc/HD200-rep1_S1_R1_001.fastq.gz,./tests/data/tsc/HD200-rep1_S1_R2_001.fastq.gz
HD701-rep1_S2,./tests/data/tsc/HD701-rep1_S2_R1_001.fastq.gz,./tests/data/tsc/HD701-rep1_S2_R2_001.fastq.gz
❯ ls tests/data/tsc/*gz
tests/data/tsc/HD200-rep1_S1_R1_001.fastq.gz  tests/data/tsc/HD200-rep1_S1_R2_001.fastq.gz  tests/data/tsc/HD701-rep1_S2_R1_001.fastq.gz  tests/data/tsc/HD701-rep1_S2_R2_001.fastq.gz
❯ cat nf-test.config
config {
    testsDir "."
    workDir ".nf-test"
    configFile "conf/test.config"
    profile "test,docker"
}
❯ ls tests/stub.main.nf.test
tests/stub.main.nf.test

I get the following errors:

  * -- Entry 1 - fastq_2: the file or directory './tests/data/tsc/HD200-rep1_S1_R2_001.fastq.gz' does not exist.
  * -- Entry 2 - fastq_2: the file or directory './tests/data/tsc/HD701-rep1_S2_R2_001.fastq.gz' does not exist.
  * -- Entry 1 - fastq_1: the file or directory './tests/data/tsc/HD200-rep1_S1_R1_001.fastq.gz' does not exist.
  * -- Entry 2 - fastq_1: the file or directory './tests/data/tsc/HD701-rep1_S2_R1_001.fastq.gz' does not exist.

The launchDir is still <root>.nf-test/tests/4d4e01064dbde7e0ba4382f8f56466c8 (as shown when running nf-test test --verbose --debug)

@rollf
Copy link
Author

rollf commented Sep 5, 2024

I resolved this problem by using NXF_FILE_ROOT (docs): The samplesheet should designed to work with nextflow out of the box (i.e. make paths relative to pipeline root dir). But I run nf-test with cd <pipeline>; export NXF_FILE_ROOT=$PWD; nf-test test ....

@rollf rollf closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants