@@ -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