Skip to content

Commit

Permalink
test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Jan 10, 2025
1 parent 73cacd5 commit 31706f0
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 208 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ jobs:
- name: Disk space cleanup
uses: jlumbroso/[email protected]

- name: create references
id: references
run: |
mkdir tmp/
nextflow run nf-core/references -profile ${{ matrix.profile }} \
-r 8112ae8 \
--input https://raw.githubusercontent.com/nf-core/references-assets/41545a3631addaf491d22751b17607149b8512ac/assets/test/sarek/GRCh38_chr22.yml \
--tools bwamem1,createsequencedictionary,faidx,intervals,tabix \
--outdir ../references/
cd ..
rm -rf tmp/
- name: use references
id: references-use
run: |
nextflow run . -profile test,${{ matrix.profile }} --outdir results \
-params-file https://raw.githubusercontent.com/nf-core/references-assets/41545a3631addaf491d22751b17607149b8512ac/assets/test/sarek/GRCh38_chr22_params.yml
- name: Start summary
id: print-test
run: |
Expand Down
62 changes: 19 additions & 43 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ include { ANNOTATION_CACHE_INITIALISATION } from './subworkflows/local/annotati
include { DOWNLOAD_CACHE_SNPEFF_VEP } from './subworkflows/local/download_cache_snpeff_vep'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sarek_pipeline'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_sarek_pipeline'
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
include { PREPARE_INTERVALS } from './subworkflows/local/prepare_intervals'
include { PREPARE_REFERENCE_CNVKIT } from './subworkflows/local/prepare_reference_cnvkit'

Expand All @@ -92,6 +91,12 @@ known_snps = params.known_snps ? Channel.fromPath(para
mappability = params.mappability ? Channel.fromPath(params.mappability).collect() : Channel.value([])
pon = params.pon ? Channel.fromPath(params.pon).collect() : Channel.value([]) // PON is optional for Mutect2 (but highly recommended)
sentieon_dnascope_model = params.sentieon_dnascope_model ? Channel.fromPath(params.sentieon_dnascope_model).collect() : Channel.value([])
msisensorpro_scan = params.msisensorpro_scan ? Channel.fromPath(params.msisensorpro_scan).collect() : Channel.empty()
allele_files = params.allele_files ? Channel.fromPath(params.allele_files).collect() : Channel.empty()
chr_files = params.chr_files ? Channel.fromPath(params.chr_files).collect() : Channel.empty()
gc_file = params.gc_file ? Channel.fromPath(params.gc_file).collect() : Channel.empty()
loci_files = params.loci_files ? Channel.fromPath(params.loci_files).collect() : Channel.empty()
rt_file = params.rt_file ? Channel.fromPath(params.rt_file).collect() : Channel.empty()

// Initialize value channels based on params, defined in the params.genomes[params.genome] scope
ascat_genome = params.ascat_genome ?: Channel.empty()
Expand All @@ -104,6 +109,7 @@ vep_cache_version = params.vep_cache_version ?: Channel.empty()
vep_genome = params.vep_genome ?: Channel.empty()
vep_species = params.vep_species ?: Channel.empty()


vep_extra_files = []

if (params.dbnsfp && params.dbnsfp_tbi) {
Expand Down Expand Up @@ -132,56 +138,26 @@ workflow NFCORE_SAREK {
main:
versions = Channel.empty()

// build indexes if needed
PREPARE_GENOME(
params.ascat_alleles,
params.ascat_loci,
params.ascat_loci_gc,
params.ascat_loci_rt,
bcftools_annotations,
params.chr_dir,
dbsnp,
fasta,
germline_resource,
known_indels,
known_snps,
pon)

// Gather built indices or get them from the params
// Built from the fasta file:
dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect()
: PREPARE_GENOME.out.dict
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).map{ it -> [ [id:'fai'], it ] }.collect()
: PREPARE_GENOME.out.fasta_fai
bwa = params.bwa ? Channel.fromPath(params.bwa).map{ it -> [ [id:'bwa'], it ] }.collect()
: PREPARE_GENOME.out.bwa
bwamem2 = params.bwamem2 ? Channel.fromPath(params.bwamem2).map{ it -> [ [id:'bwamem2'], it ] }.collect()
: PREPARE_GENOME.out.bwamem2
dragmap = params.dragmap ? Channel.fromPath(params.dragmap).map{ it -> [ [id:'dragmap'], it ] }.collect()
: PREPARE_GENOME.out.hashtable
dict = params.dict ? Channel.fromPath(params.dict).map{ it -> [ [id:'dict'], it ] }.collect() : Channel.value([])
fasta_fai = params.fasta_fai ? Channel.fromPath(params.fasta_fai).map{ it -> [ [id:'fai'], it ] }.collect() : Channel.value([])
bwa = params.bwa ? Channel.fromPath(params.bwa).map{ it -> [ [id:'bwa'], it ] }.collect() : Channel.empty()
bwamem2 = params.bwamem2 ? Channel.fromPath(params.bwamem2).map{ it -> [ [id:'bwamem2'], it ] }.collect() : Channel.empty()
dragmap = params.dragmap ? Channel.fromPath(params.dragmap).map{ it -> [ [id:'dragmap'], it ] }.collect() : Channel.empty()

// Gather index for mapping given the chosen aligner
index_alignment = (aligner == "bwa-mem" || aligner == "sentieon-bwamem") ? bwa :
aligner == "bwa-mem2" ? bwamem2 :
dragmap

// TODO: add a params for msisensorpro_scan
msisensorpro_scan = PREPARE_GENOME.out.msisensorpro_scan

// For ASCAT, extracted from zip or tar.gz files
allele_files = PREPARE_GENOME.out.allele_files
chr_files = PREPARE_GENOME.out.chr_files
gc_file = PREPARE_GENOME.out.gc_file
loci_files = PREPARE_GENOME.out.loci_files
rt_file = PREPARE_GENOME.out.rt_file

// Tabix indexed vcf files
bcftools_annotations_tbi = params.bcftools_annotations ? params.bcftools_annotations_tbi ? Channel.fromPath(params.bcftools_annotations_tbi).collect() : PREPARE_GENOME.out.bcftools_annotations_tbi : Channel.value([])
dbsnp_tbi = params.dbsnp ? params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : PREPARE_GENOME.out.dbsnp_tbi : Channel.value([])
germline_resource_tbi = params.germline_resource ? params.germline_resource_tbi ? Channel.fromPath(params.germline_resource_tbi).collect() : PREPARE_GENOME.out.germline_resource_tbi : [] //do not change to Channel.value([]), the check for its existence then fails for Getpileupsumamries
known_indels_tbi = params.known_indels ? params.known_indels_tbi ? Channel.fromPath(params.known_indels_tbi).collect() : PREPARE_GENOME.out.known_indels_tbi : Channel.value([])
known_snps_tbi = params.known_snps ? params.known_snps_tbi ? Channel.fromPath(params.known_snps_tbi).collect() : PREPARE_GENOME.out.known_snps_tbi : Channel.value([])
pon_tbi = params.pon ? params.pon_tbi ? Channel.fromPath(params.pon_tbi).collect() : PREPARE_GENOME.out.pon_tbi : Channel.value([])
bcftools_annotations_tbi = params.bcftools_annotations && params.bcftools_annotations_tbi ? Channel.fromPath(params.bcftools_annotations_tbi).collect() : Channel.value([])
dbsnp_tbi = params.dbsnp && params.dbsnp_tbi ? Channel.fromPath(params.dbsnp_tbi).collect() : Channel.value([])
germline_resource_tbi = params.germline_resource && params.germline_resource_tbi ? Channel.fromPath(params.germline_resource_tbi).collect() : [] //do not change to Channel.value([]), the check for its existence then fails for Getpileupsumamries
known_indels_tbi = params.known_indels && params.known_indels_tbi ? Channel.fromPath(params.known_indels_tbi).collect() : Channel.value([])
known_snps_tbi = params.known_snps && params.known_snps_tbi ? Channel.fromPath(params.known_snps_tbi).collect() : Channel.value([])
pon_tbi = params.pon && params.pon_tbi ? Channel.fromPath(params.pon_tbi).collect() : Channel.value([])

// known_sites is made by grouping both the dbsnp and the known snps/indels resources
// Which can either or both be optional
Expand Down Expand Up @@ -224,8 +200,8 @@ workflow NFCORE_SAREK {
} else {
cnvkit_reference = Channel.value([])
}

// Gather used softwares versions
versions = versions.mix(PREPARE_GENOME.out.versions)
versions = versions.mix(PREPARE_INTERVALS.out.versions)

vep_fasta = (params.vep_include_fasta) ? fasta.map{ fasta -> [ [ id:fasta.baseName ], fasta ] } : [[id: 'null'], []]
Expand Down
138 changes: 0 additions & 138 deletions subworkflows/local/prepare_genome/main.nf

This file was deleted.

Loading

0 comments on commit 31706f0

Please sign in to comment.