Skip to content

Commit a2b0c7c

Browse files
authored
Merge pull request #80 from nf-core/index_file_handling
Index file handling fixing #79
2 parents 97ea5f8 + 02b528a commit a2b0c7c

4 files changed

Lines changed: 53 additions & 34 deletions

File tree

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ script:
3737
# Lint the pipeline code
3838
- nf-core lint ${TRAVIS_BUILD_DIR}
3939
# Run the basic pipeline with the test profile
40-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd
40+
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --saveReference
4141
# Run the basic pipeline with single end data (pretending its single end actually)
42-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --singleEnd
42+
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --singleEnd --bwa_index results/reference_genome/bwa_index/
4343
# Run the same pipeline testing optional step: fastp, complexity
44-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --complexity_filter
44+
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --complexity_filter --bwa_index results/reference_genome/bwa_index/
4545
# Test BAM Trimming
46-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --trim_bam
46+
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --trim_bam --bwa_index results/reference_genome/bwa_index/
4747
# Test running with CircularMapper
4848
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --circularmapper --circulartarget 'NC_007596.2'
4949
# Test running with BWA Mem
50-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --bwamem
50+
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker --pairedEnd --bwamem --bwa_index results/reference_genome/bwa_index/
5151
# Test basic pipeline with Conda too
52-
- nextflow run ${TRAVIS_BUILD_DIR} -profile test,conda --pairedEnd
52+
- travis_wait 25 nextflow run ${TRAVIS_BUILD_DIR} -profile test,conda --pairedEnd --bwa_index results/reference_genome/bwa_index/

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## unpublished
88

9+
### `Added`
10+
* [#80](https://github.com/nf-core/eager/pull/80) - BWA Index file handling
11+
* [#77](https://github.com/nf-core/eager/pull/77) - Lots of documentation updates by [@jfy133](https://github.com/jfy133)
912

1013
## [2.0.2] - 2018-11-03
1114

environment.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ channels:
44
- bioconda
55
- conda-forge
66
dependencies:
7-
- openjdk=8.0.152
8-
- fastqc=0.11.8
9-
- adapterremoval=2.2.2
10-
- adapterremovalfixprefix=0.0.4
11-
- bwa=0.7.17
12-
- picard=2.18.15
13-
- samtools=1.9
14-
- dedup=0.12.3
15-
- angsd=0.923
16-
- circularmapper=1.93.4
17-
- gatk4=4.0.11.0
18-
- qualimap=2.2.2b
19-
- vcf2genome=0.91
20-
- damageprofiler=0.3.11
21-
- multiqc=1.6
22-
- pmdtools=0.60
23-
- r-rmarkdown=1.10
24-
- libiconv=1.15
25-
- sequencetools=1.2.2
26-
- preseq=2.0.3
27-
- fastp=0.19.4
28-
- bamutil=1.0.14
7+
- anaconda::openjdk=8.0.152
8+
- bioconda::fastqc=0.11.8
9+
- bioconda::adapterremoval=2.2.2
10+
- bioconda::adapterremovalfixprefix=0.0.4
11+
- bioconda::bwa=0.7.17
12+
- bioconda::picard=2.18.15
13+
- bioconda::samtools=1.9
14+
- bioconda::dedup=0.12.3
15+
- bioconda::angsd=0.923
16+
- bioconda::circularmapper=1.93.4
17+
- bioconda::gatk4=4.0.11.0
18+
- bioconda::qualimap=2.2.2b
19+
- bioconda::vcf2genome=0.91
20+
- bioconda::damageprofiler=0.3.11
21+
- bioconda::multiqc=1.6
22+
- bioconda::pmdtools=0.60
23+
- conda-forge::r-rmarkdown=1.10
24+
- conda-forge::libiconv=1.15
25+
- bioconda::sequencetools=1.2.2
26+
- bioconda::preseq=2.0.3
27+
- bioconda::fastp=0.19.4
28+
- bioconda::bamutil=1.0.14
2929
#Missing Schmutzi,snpAD

main.nf

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,24 @@ wherearemyfiles = file("$baseDir/assets/where_are_my_files.txt")
211211

212212
// Validate inputs
213213
Channel.fromPath("${params.fasta}")
214-
.ifEmpty { exit 1, "No genome specified! Please specify one with --fasta or --bwa_index"}
214+
.ifEmpty { exit 1, "No genome specified! Please specify one with --fasta"}
215215
.into {ch_fasta_for_bwa_indexing;ch_fasta_for_faidx_indexing;ch_fasta_for_dict_indexing; ch_fasta_for_bwa_mapping; ch_fasta_for_damageprofiler; ch_fasta_for_qualimap; ch_fasta_for_pmdtools; ch_fasta_for_circularmapper; ch_fasta_for_circularmapper_index;ch_fasta_for_bwamem_mapping}
216216

217+
//Index files provided? Then check whether they are correct and complete
218+
if (params.aligner != 'bwa' && !params.circularmapper && !params.bwamem){
219+
exit 1, "Invalid aligner option. Default is bwa, but specify --circularmapper or --bwamem to use these."
220+
}
221+
if( params.bwa_index && (params.aligner == 'bwa' | params.bwamem)){
222+
bwa_index = Channel
223+
.fromPath("${params.bwa_index}/**.*")
224+
.ifEmpty { exit 1, "BWA index not found: ${params.bwa_index}" }
225+
.into{ch_bwa_index_existing;ch_bwa_index_bwamem_existing}
226+
} else {
227+
//Create empty channels to make sure later mix() does not fail
228+
ch_bwa_index_existing = Channel.empty()
229+
ch_bwa_index_bwamem_existing = Channel.empty()
230+
}
231+
217232
//Validate that either pairedEnd or singleEnd has been specified by the user!
218233
if( params.singleEnd || params.pairedEnd ){
219234
} else {
@@ -280,6 +295,7 @@ summary['Pipeline Version'] = workflow.manifest.version
280295
summary['Run Name'] = custom_runName ?: workflow.runName
281296
summary['Reads'] = params.reads
282297
summary['Fasta Ref'] = params.fasta
298+
if(params.bwa_index) summary['BWA Index'] = params.bwa_index
283299
summary['Data Type'] = params.singleEnd ? 'Single-End' : 'Paired-End'
284300
summary['Max Memory'] = params.max_memory
285301
summary['Max CPUs'] = params.max_cpus
@@ -364,7 +380,7 @@ process makeBWAIndex {
364380
else null
365381
}
366382

367-
when: !params.bwa_index && params.fasta && params.aligner == 'bwa'
383+
when: !params.bwa_index && params.fasta && (params.aligner == 'bwa' || params.bwamem)
368384

369385
input:
370386
file fasta from ch_fasta_for_bwa_indexing
@@ -561,7 +577,7 @@ process bwa {
561577

562578
input:
563579
file(reads) from ch_clipped_reads
564-
file "*" from ch_bwa_index
580+
file "*" from ch_bwa_index.mix(ch_bwa_index_existing).collect()
565581
file fasta from ch_fasta_for_bwa_mapping
566582

567583
output:
@@ -638,7 +654,7 @@ process bwamem {
638654

639655
input:
640656
file(reads) from ch_clipped_reads_bwamem
641-
file "*" from ch_bwa_index_bwamem
657+
file "*" from ch_bwa_index_bwamem.mix(ch_bwa_index_bwamem_existing).collect()
642658
file fasta from ch_fasta_for_bwamem_mapping
643659

644660
output:
@@ -868,10 +884,10 @@ process markDup{
868884
}
869885

870886
//If no deduplication runs, the input is mixed directly from samtools filter, if it runs either markdup or dedup is used thus mixed from these two channels
871-
ch_dedup_for_pmdtools = Channel.create()
887+
ch_dedup_for_pmdtools = Channel.empty()
872888

873889
//Bamutils TrimBam Channel
874-
ch_for_bamutils = Channel.create()
890+
ch_for_bamutils = Channel.empty()
875891

876892
if(!params.skip_deduplication){
877893
ch_dedup_for_pmdtools.mix(ch_markdup_bam,ch_dedup_bam).into {ch_for_pmdtools;ch_for_bamutils}

0 commit comments

Comments
 (0)