-
Notifications
You must be signed in to change notification settings - Fork 5
Add content tests #169
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
Add content tests #169
Conversation
|
| path("${params.outdir}/summary_tables/magmap.rRNA.counts.tsv.gz").linesGzip.findAll { l -> l.contains('orf') }, | ||
| path("${params.outdir}/summary_tables/magmap.rRNA.counts.tsv.gz").csv(sep: '\t', decompress: true, header: true).columns["tpm"].sum().round(), | ||
| path("${params.outdir}/summary_tables/magmap.tmRNA.counts.tsv.gz").linesGzip.findAll { l -> l.contains('orf') }, | ||
| path("${params.outdir}/summary_tables/magmap.tmRNA.counts.tsv.gz").csv(sep: '\t', decompress: true, header: true).columns["tpm"].sum().toBigDecimal().round(), |
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.
I had to add the function toBigDecimal() for round() to work in this case. sum() returns a class of Integer when there is only one row in the csv, while when there are more than 1 line, the sum() returns a class of BigDecimal, which can be used as input for round().
Here is the error I had, when I was running the test with .sum().round():
Test [e5339dde] '-profile test' groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.round() is applicable for argument types: () values: []
Possible solutions: find(), find(groovy.lang.Closure), and(java.lang.Number), mod(java.lang.Number), minus(java.lang.Character), minus(java.lang.Number)
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.
I suppose we should add that to all.
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 all good. One comment, but fine to merge as it is. We can add toBigDecimal() later/when needed.
Also: One test failed but it seems to be because that run was cancelled, so no problem.
| path("${params.outdir}/summary_tables/magmap.rRNA.counts.tsv.gz").linesGzip.findAll { l -> l.contains('orf') }, | ||
| path("${params.outdir}/summary_tables/magmap.rRNA.counts.tsv.gz").csv(sep: '\t', decompress: true, header: true).columns["tpm"].sum().round(), | ||
| path("${params.outdir}/summary_tables/magmap.tmRNA.counts.tsv.gz").linesGzip.findAll { l -> l.contains('orf') }, | ||
| path("${params.outdir}/summary_tables/magmap.tmRNA.counts.tsv.gz").csv(sep: '\t', decompress: true, header: true).columns["tpm"].sum().toBigDecimal().round(), |
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.
I suppose we should add that to all.
Yes, let's do that! I will now merge then. |
PR checklist
nf-core lint).nextflow run . -profile test,docker).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).