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

Add pipeline-level nf-test (BUILD_REFERENCES) #605

Merged
merged 9 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
- "latest-stable"
test_profile:
- "test_stub"
- "test_build"
compute_profile:
- "docker"
- "singularity"
Expand Down
29 changes: 27 additions & 2 deletions conf/test_build.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,28 @@
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/rnafusion -profile test_build,<docker/singularity> --outdir <OUTDIR> -stub
nextflow run nf-core/rnafusion -profile test_build,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
Uses a minimal fasta and gtf for testing purposes.
This test is designed to test the `build_references` subworkflow with the following processes on:
- SAMTOOLS_FAIDX
- HGNC_DOWNLOAD
- GATK4_CREATESEQUENCEDICTIONARY
- GET_RRNA_TRANSCRIPTS
- GATK4_BEDTOINTERVALLIST
- GTF_TO_REFFLAT
- GFFREAD
- STAR_GENOMEGENERATE
- ARRIBA_DOWNLOAD
- STARFUSION_BUILD
- FUSIONREPORT_DOWNLOAD

It does not test the following processes of the `build_references` subworkflow:
- GENCODE_DOWNLOAD
- FUSIONCATCHER_BUILD

It does not test the main rnafusion subworkflows by setting references_only = true.
*/

params {
Expand All @@ -18,7 +37,13 @@ params {
references_only = true
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/rnafusion/testdata/human/samplesheet_valid.csv'
no_cosmic = true
all = true
all = false
arriba = true
fusioncatcher = false
starfusion = true
fasta = 'https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.fa'
gtf = 'https://github.com/STAR-Fusion/STAR-Fusion-Tutorial/raw/master/minigenome.gtf'
fusionreport = true

skip_salmon_index = true
starfusion_build = true
Expand Down
27 changes: 27 additions & 0 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,30 @@ references/arriba/blacklist_hg38_GRCh38_v2.4.0.tsv.gz
references/arriba/known_fusions_hg38_GRCh38_v2.4.0.tsv.gz
references/ensembl/Homo_sapiens.GRCh38.102.dna.primary_assembly.fa
references/hgnc/HGNC-DB-timestamp.txt
references/fusion_report_db/DB-timestamp.txt
references/salmon/salmon/ctable.bin
references/salmon/salmon/pos.bin
references/salmon/salmon/pre_indexing.log
references/salmon/salmon/ref_indexing.log
references/salmon/salmon/seq.bin
references/star/Log.out
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.star.idx/
starfusion/ctat_genome_lib_build_dir/PFAM.domtblout.dat.gz
starfusion/ctat_genome_lib_build_dir/blast_pairs.dat.gz
starfusion/ctat_genome_lib_build_dir/blast_pairs.idx
starfusion/ctat_genome_lib_build_dir/fusion_annot_lib.idx
starfusion/ctat_genome_lib_build_dir/pfam_domains.dbm
starfusion/ctat_genome_lib_build_dir/ref_annot.cdna.fa
starfusion/ctat_genome_lib_build_dir/ref_annot.cdna.fa.idx
starfusion/ctat_genome_lib_build_dir/ref_annot.cds
starfusion/ctat_genome_lib_build_dir/ref_annot.cdsplus.fa
starfusion/ctat_genome_lib_build_dir/ref_annot.cdsplus.fa.idx
starfusion/ctat_genome_lib_build_dir/ref_annot.gtf.gene_spans
starfusion/ctat_genome_lib_build_dir/ref_annot.pep
starfusion/ctat_genome_lib_build_dir/ref_annot.prot_info.dbm
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.nin
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.njs
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.star.idx/Log.out
starfusion/ctat_genome_lib_build_dir/trans.blast.align_coords.align_coords.dbm
references/star/genomeParameters.txt
starfusion/ctat_genome_lib_build_dir/ref_genome.fa.star.idx/genomeParameters.txt
40 changes: 40 additions & 0 deletions tests/test_build.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
nextflow_pipeline {

name "Test pipeline"
script "../main.nf"
profile "test_build"
tag "pipeline"
tag "pipeline_rnafusion"
tag "test_build"

test("Test build references") {

when {
params {
outdir = "$outputDir"
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}

}
Loading
Loading