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

Fix bowtie index issue #317

Merged
merged 11 commits into from
Feb 21, 2024
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- "test"
- "test_no_genome"
- "test_umi"
- "test_index"
steps:
- name: Check out pipeline code
uses: actions/checkout@v4
Expand Down
35 changes: 35 additions & 0 deletions conf/test_index.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/smrnaseq -profile test_index,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'Test index profile'
config_profile_description = 'Minimal test dataset to check pipeline function with bowtie index'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '6.GB'
max_time = '6.h'

// Input data

input = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/samplesheet/v2.0/samplesheet.csv'
fasta = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/genome.fa'
bowtie_index = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/bowtie_index.tar.gz'

mirtrace_species = 'hsa'
protocol = 'illumina'
skip_mirdeep = true
save_merged = false
save_aligned_mirna_quant = false

cleanup = true //Otherwise tests dont run through properly.
}
6 changes: 3 additions & 3 deletions conf/test_no_genome.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ params {

// Input data
input = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/samplesheet/v2.0/samplesheet.csv'
mature = 'https://github.com/nf-core/test-datasets/raw/smrnaseq-better-input/reference/mature.fa'
hairpin = 'https://github.com/nf-core/test-datasets/raw/smrnaseq-better-input/reference/hairpin.fa'
mirna_gtf = 'https://github.com/nf-core/test-datasets/raw/smrnaseq-better-input/reference/hsa.gff3'
mature = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/mature.fa'
hairpin = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/hairpin.fa'
mirna_gtf = 'https://github.com/nf-core/test-datasets/raw/smrnaseq/reference/hsa.gff3'
mirtrace_species = 'hsa'
skip_mirdeep = true
protocol = 'illumina'
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
"branch": "master",
"git_sha": "9e56d7a647fbf6f7e45ef123bc916ad66b6f7c9d",
"installed_by": ["fastq_fastqc_umitools_fastp", "modules"]
},
"untarfiles": {
"branch": "master",
"git_sha": "3f5420aa22e00bd030a2556dfdffc9e164ec0ec5",
"installed_by": ["modules"]
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/untarfiles/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions modules/nf-core/untarfiles/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions modules/nf-core/untarfiles/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ profiles {
test_umi { includeConfig 'conf/test_umi.config' }
test_no_genome { includeConfig 'conf/test_no_genome.config' }
test_full { includeConfig 'conf/test_full.config' }
test_index { includeConfig 'conf/test_index.config' }
}

// Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile
Expand Down
11 changes: 9 additions & 2 deletions workflows/smrnaseq.nf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ if (!params.mirgenedb) {
include { INPUT_CHECK } from '../subworkflows/local/input_check'
include { FASTQ_FASTQC_UMITOOLS_FASTP } from '../subworkflows/nf-core/fastq_fastqc_umitools_fastp'
include { FASTP as FASTP_LENGTH_FILTER } from '../modules/nf-core/fastp'
include { UNTARFILES as UNTAR_BOWTIE_INDEX } from '../modules/nf-core/untarfiles'
include { CONTAMINANT_FILTER } from '../subworkflows/local/contaminant_filter'
include { MIRNA_QUANT } from '../subworkflows/local/mirna_quant'
include { GENOME_QUANT } from '../subworkflows/local/genome_quant'
Expand Down Expand Up @@ -153,7 +154,7 @@ workflow SMRNASEQ {
)
ch_versions = ch_versions.mix(FASTQ_FASTQC_UMITOOLS_FASTP.out.versions)

ch_fasta = params.fasta ? file(params.fasta): []
ch_fasta = params.fasta ? file(params.fasta) : []
ch_reads_for_mirna = FASTQ_FASTQC_UMITOOLS_FASTP.out.reads

// even if bowtie index is specified, there still needs to be a fasta.
Expand All @@ -162,7 +163,13 @@ workflow SMRNASEQ {
//Prepare bowtie index, unless specified
//This needs to be done here as the index is used by GENOME_QUANT
if(params.bowtie_index) {
ch_bowtie_index = Channel.fromPath("${index}**ebwt", checkIfExists: true).ifEmpty { error "Bowtie1 index directory not found: ${index}" }
ch_fasta = Channel.fromPath(params.fasta)
if (params.bowtie_index.endsWith(".tar.gz")) {
UNTAR_BOWTIE_INDEX ( [ [], params.bowtie_index ]).files.map { it[1] }.set {ch_bowtie_index}
ch_versions = ch_versions.mix(UNTAR_BOWTIE_INDEX.out.versions)
} else {
Channel.fromPath("${params.bowtie_index}**ebwt", checkIfExists: true).ifEmpty{ error "Bowtie1 index directory not found: ${params.bowtie_index}" }.filter { it != null }.set { ch_bowtie_index }
}
} else {
INDEX_GENOME ( [ [:], ch_fasta ] )
ch_versions = ch_versions.mix(INDEX_GENOME.out.versions)
Expand Down
Loading