-
Notifications
You must be signed in to change notification settings - Fork 708
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
nf-test quantify pseudoalignment #1246
Merged
adamrtalbot
merged 13 commits into
nf-core:dev
from
adamrtalbot:nf-test_quantify_pseudoalignment
Mar 12, 2024
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c71189f
Add nf-test for quantify_psueudoalignment
adamrtalbot 8c68e1d
Some improvements but not working :(
adamrtalbot bc57910
uncomment the comment
adamrtalbot 40c006d
Swap to nf-core rnaseq test data (full path currently)
adamrtalbot 9f27403
Reference genome path mistake
adamrtalbot 4a5c107
Fix bugs in quantify_pseudoalignment
adamrtalbot b179291
fixup
adamrtalbot 1b2b8a4
Update to use samplesheet in test-datasets repo
adamrtalbot 80acef9
Merge branch 'dev' into nf-test_quantify_pseudoalignment
adamrtalbot 2fc7e4d
Omit variable files from snap
adamrtalbot da29edb
SALMON tests keepDuplicates
adamrtalbot 63f71d7
Merge branch 'dev' into nf-test_quantify_pseudoalignment
adamrtalbot 35ff7ad
Merge branch 'dev' into nf-test_quantify_pseudoalignment
adamrtalbot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
modules/nf-core/summarizedexperiment/summarizedexperiment/main.nf
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
modules/nf-core/summarizedexperiment/summarizedexperiment/templates/summarizedexperiment.r
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 16 additions & 16 deletions
32
modules/nf-core/summarizedexperiment/summarizedexperiment/tests/main.nf.test.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
subworkflows/local/quantify_pseudo_alignment/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
nextflow_workflow { | ||
|
||
name "Test Workflow QUANTIFY_PSEUDO_ALIGNMENT" | ||
script "../main.nf" | ||
workflow "QUANTIFY_PSEUDO_ALIGNMENT" | ||
|
||
tag 'SALMON_QUANT' | ||
tag 'KALLISTO_QUANT' | ||
tag 'CUSTOM_TX2GENE' | ||
tag 'TXIMETA_TXIMPORT' | ||
tag 'SUMMARIZEDEXPERIMENT_SUMMARIZEDEXPERIMENT' | ||
|
||
test("salmon") { | ||
|
||
setup { | ||
run("SALMON_INDEX") { | ||
script "../../../../modules/nf-core/salmon/index/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.fasta", checkIfExists: true)]) | ||
input[1] = Channel.of([file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/transcriptome.fasta", checkIfExists: true)]) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = [ | ||
[ id: 'samplesheet' ], | ||
file(params.pipelines_testdata_base_path + '/csv/samplesheet_micro.csv', checkIfExists: true) | ||
] | ||
input[1] = [ | ||
[ id: 'test' ], | ||
[ | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) | ||
] | ||
] | ||
input[2] = SALMON_INDEX.out.index | ||
input[3] = Channel.of(file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/transcriptome.fasta", checkIfExists: true)) | ||
input[4] = Channel.of(file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.gtf", checkIfExists: true)) | ||
input[5] = 'gene_id' | ||
input[6] = 'gene_name' | ||
input[7] = 'salmon' | ||
input[8] = false | ||
input[9] = 'A' | ||
input[10] = null | ||
input[11] = null | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert workflow.success }, | ||
{ assert snapshot( | ||
workflow.out.tpm_gene, | ||
workflow.out.counts_gene, | ||
workflow.out.lengths_gene, | ||
workflow.out.counts_gene_length_scaled, | ||
workflow.out.tpm_transcript, | ||
workflow.out.lengths_transcript, | ||
workflow.out.merged_gene_rds, | ||
workflow.out.merged_gene_rds_length_scaled, | ||
workflow.out.merged_gene_rds_scaled, | ||
workflow.out.merged_counts_transcript, | ||
workflow.out.merged_tpm_transcript, | ||
workflow.out.merged_transcript_rds, | ||
// NOT multiqc, results, versions | ||
pinin4fjords marked this conversation as resolved.
Show resolved
Hide resolved
|
||
).match() | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
test("kallisto") { | ||
|
||
setup { | ||
run("KALLISTO_INDEX") { | ||
script "../../../../modules/nf-core/kallisto/index/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.of([ | ||
[ id:'transcriptome' ], // meta map | ||
file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/transcriptome.fasta", checkIfExists: true) | ||
]) | ||
""" | ||
} | ||
} | ||
} | ||
|
||
|
||
when { | ||
workflow { | ||
""" | ||
input[0] = [ | ||
[ id: 'samplesheet' ], | ||
file(params.pipelines_testdata_base_path + '/csv/samplesheet_micro.csv', checkIfExists: true) | ||
] | ||
input[1] = [ | ||
[ id: 'test' ], | ||
[ | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz', checkIfExists: true), | ||
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz', checkIfExists: true) | ||
] | ||
] | ||
input[2] = KALLISTO_INDEX.out.index | ||
input[3] = Channel.of(file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/transcriptome.fasta", checkIfExists: true)) | ||
input[4] = Channel.of(file(params.modules_testdata_base_path + "genomics/homo_sapiens/genome/genome.gtf", checkIfExists: true)) | ||
input[5] = 'gene_id' | ||
input[6] = 'gene_name' | ||
input[7] = 'kallisto' | ||
input[8] = null | ||
input[9] = null | ||
input[10] = [] | ||
input[11] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert workflow.success }, | ||
{ assert snapshot( | ||
workflow.out.tpm_gene, | ||
workflow.out.counts_gene, | ||
workflow.out.lengths_gene, | ||
workflow.out.counts_gene_length_scaled, | ||
workflow.out.tpm_transcript, | ||
workflow.out.lengths_transcript, | ||
workflow.out.merged_gene_rds, | ||
workflow.out.merged_gene_rds_length_scaled, | ||
workflow.out.merged_gene_rds_scaled, | ||
workflow.out.merged_counts_transcript, | ||
workflow.out.merged_tpm_transcript, | ||
workflow.out.merged_transcript_rds, | ||
// NOT multiqc, results, versions | ||
).match() | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure what sort of behaviour this is going to have @adamrtalbot so a bit reluctant to add it in without some proper testing. Did we need to add it to fix something else? Otherwise maybe we create an issue outlining why we need it in and do a proper assessment before adding to the pipeline.
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 discovered it while fixing the tests. When you have two identical sequence transcripts, Salmon will just drop one of them. Downstream, the tools for matching transcripts/genes/names causes an error because it's missing some data. This flag disables this behaviour and makes it match STAR-RSEM, Kallisto etc.
@pinin4fjords has fixed as many downstream problems as he can, but silently dropping transcripts feels like the wrong behaviour in the first place.
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.
Reverted SALMON_INDEX from keeping duplicates, raised this issue to discuss further: #1259
When combined with the fix for the module, the tests should pass now (famous last words).