-
Notifications
You must be signed in to change notification settings - Fork 858
Draft: Nftest migration metaphlan3 #8466
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good already :) While your on this - can you also add stub tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need this here as we have this defined globally :)
setup { | ||
run("UNTAR") { | ||
script "../../../untar/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + 'delete_me/metaphlan_database.tar.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move the setup block out of the actual test to save some runs :)
{ assert path(process.out.biom[0][1]).text.contains('"format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","generated_by"') }, | ||
{ assert snapshot( | ||
process.out.bt2out, | ||
path(process.out.profile.get(0).get(1)).readLines()[2..-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path(process.out.profile.get(0).get(1)).readLines()[2..-1] | |
path(process.out.profile.get(0).get(1)).readLines()[2..-1].join('\n').md5() |
{ assert path(process.out.biom[0][1]).text.contains('"format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","generated_by"') }, | ||
{ assert snapshot( | ||
process.out.bt2out, | ||
path(process.out.profile.get(0).get(1)).readLines()[2..-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path(process.out.profile.get(0).get(1)).readLines()[2..-1] | |
path(process.out.profile.get(0).get(1)).readLines()[2..-1].join('\n').md5() |
setup { | ||
run("UNTAR") { | ||
script "../../../untar/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + 'delete_me/metaphlan_database.tar.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup { | |
run("UNTAR") { | |
script "../../../untar/main.nf" | |
process { | |
""" | |
input[0] = [ | |
[ id:'test' ], | |
file(params.modules_testdata_base_path + 'delete_me/metaphlan_database.tar.gz', checkIfExists: true) | |
] | |
""" | |
} | |
} |
// [ | ||
// [ | ||
// [ | ||
// [id:test, single_end:false], | ||
// /Users/nnsangou/projects/nf-core/modules/.nf-test/tests/1b0b84df5ba4ed86ad76e5e202370d46/work/01/56a87b6f66c6ae | ||
// bfee78b7301d0d0c/test_profile.txt | ||
// ] | ||
// ] | ||
// ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// [ | |
// [ | |
// [ | |
// [id:test, single_end:false], | |
// /Users/nnsangou/projects/nf-core/modules/.nf-test/tests/1b0b84df5ba4ed86ad76e5e202370d46/work/01/56a87b6f66c6ae | |
// bfee78b7301d0d0c/test_profile.txt | |
// ] | |
// ] | |
// ] |
setup { | ||
run("UNTAR") { | ||
script "../../../untar/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.modules_testdata_base_path + 'delete_me/metaphlan_database.tar.gz', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup { | |
run("UNTAR") { | |
script "../../../untar/main.nf" | |
process { | |
""" | |
input[0] = [ | |
[ id:'test' ], | |
file(params.modules_testdata_base_path + 'delete_me/metaphlan_database.tar.gz', checkIfExists: true) | |
] | |
""" | |
} | |
} | |
} |
{ assert path(process.out.biom[0][1]).text.contains('"format": "Biological Observation Matrix 1.0.0","format_url": "http://biom-format.org","generated_by"') }, | ||
{ assert snapshot( | ||
process.out.bt2out, | ||
path(process.out.profile.get(0).get(1)).readLines()[2..-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path(process.out.profile.get(0).get(1)).readLines()[2..-1] | |
path(process.out.profile.get(0).get(1)).readLines()[2..-1].join('\n').md5() |
// publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } |
withName: METAPHLAN3_METAPHLAN3 { | ||
ext.args = '--index mpa_v30_CHOCOPhlAn_201901 --add_viruses --bt2_ps very-sensitive-local' | ||
} | ||
|
||
withName: SAMTOOLS_VIEW { | ||
ext.args = "--output-fmt sam" | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move these to the nf-test file itself? :)
Closes #7621
Description of changes:
This PR migrates unit tests for metaphlan3/metaphlan3 from pytest to nf-test, and makes some minor corrections to these tests, described below.
params.modules_testdata_base_path