Skip to content

Commit 368387a

Browse files
authored
Merge pull request #131 from apeltzer/fix_indices
Rename reference to fasta in all cases
2 parents 097f1a5 + 9df93e6 commit 368387a

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
### `Added`
1010
* [#127](https://github.com/nf-core/eager/pull/127) - Added a second testcase for testing the pipeline properly
1111
* [#129](https://github.com/nf-core/eager/pull/129) - Support BAM files as [input format](https://github.com/nf-core/eager/issues/41)
12+
* [#131](https://github.com/nf-core/eager/pull/131) - Support different [reference genome file extensions](https://github.com/nf-core/eager/issues/130)
1213

1314
### `Fixed`
1415
* [#128](https://github.com/nf-core/eager/issues/128) - Fixed reference genome handling errors

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ If you prefer, you can specify the full path to your reference genome when you r
168168
```bash
169169
--fasta '[path to Fasta reference]'
170170
```
171-
> If you don't specify appropriate `--bwa_index`, `--fasta_index` parameters, the pipeline will create these indices for you automatically. Note, that saving these for later has to be turned on using `--saveReference`. You may also specify the path to a gzipped (`*.gz` file extension) FastA as reference genome - this will be uncompressed by the pipeline automatically for you.
171+
> If you don't specify appropriate `--bwa_index`, `--fasta_index` parameters, the pipeline will create these indices for you automatically. Note, that saving these for later has to be turned on using `--saveReference`. You may also specify the path to a gzipped (`*.gz` file extension) FastA as reference genome - this will be uncompressed by the pipeline automatically for you. Note that other file extensions such as `.fna`, `.fa` are also supported but will be renamed to `.fasta` automatically by the pipeline.
172172
173173
### `--genome` (using iGenomes)
174174

main.nf

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,11 +417,12 @@ process makeBWAIndex {
417417
file "where_are_my_files.txt"
418418

419419
script:
420+
base = "${fasta.baseName}"
420421
"""
421422
mkdir bwa_index
422-
cp "${fasta}" bwa_index/
423+
mv "${fasta}" "bwa_index/${base}.fasta"
423424
cd bwa_index
424-
bwa index $fasta
425+
bwa index "${base}.fasta"
425426
"""
426427
}
427428

@@ -445,13 +446,17 @@ process makeFastaIndex {
445446
file wherearemyfiles from ch_where_for_fasta_index
446447

447448
output:
448-
file "${fasta}.fai" into ch_fasta_faidx_index
449-
file "${fasta}"
449+
file "faidx/${base}.fasta.fai" into ch_fasta_faidx_index
450+
file "faidx/${base}.fasta"
450451
file "where_are_my_files.txt"
451452

452453
script:
454+
base = "${fasta.baseName}"
453455
"""
454-
samtools faidx $fasta
456+
mkdir faidx
457+
mv $fasta "faidx/${base}.fasta"
458+
cd faidx
459+
samtools faidx "${base}.fasta"
455460
"""
456461
}
457462

@@ -475,12 +480,16 @@ process makeSeqDict {
475480
file wherearemyfiles from ch_where_for_seqdict
476481

477482
output:
478-
file "*.dict" into ch_seq_dict
483+
file "seq_dict/*.dict" into ch_seq_dict
479484
file "where_are_my_files.txt"
480485

481486
script:
487+
base = "${fasta.baseName}.fasta"
482488
"""
483-
picard CreateSequenceDictionary R=$fasta O="${fasta.baseName}.dict"
489+
mkdir -p seq_dict
490+
mv $fasta "seq_dict/${base}"
491+
cd seq_dict
492+
picard CreateSequenceDictionary R=$base O="${fasta.baseName}.dict"
484493
"""
485494
}
486495

0 commit comments

Comments
 (0)