Having trouble getting this to work properly. Figured it was pretty simple to solve, but 2 hours of scouring google, and reading through the docs hasn't helped.
I'm trying to create a BWA index file for a reference fasta file and then use that index to map my fastq files using BWA mem.
Here's what I have so far (and hasn't worked):
process create_index {
input:
file(fasta_file)
output:
file 'genome.fa*' into bwa_index
script:
"""
bwa index -p genome ${fasta_file}
"""
}
// STEP 3 - MAPPING
process bwa_mem {
input:
set mergeId, id, file(fastq), controlid, mark, quality from trimmed_fastqs
file genome_index from bwa_index.first()
file fasta_file
output:
set mergeId, id, file("${id}.sorted.rmdups.bam"), controlid, mark, quality into bams1, bams2
file("${id}_bwa_mem_summary.txt")
file("${id}_picard_metrics.txt")
script:
"""
bwa mem -t -M ${params.threads} ${genome_index} ${fastq} 2> ${id}_bwa_mem_summary.txt | samtools view -b -F 1804 - | samtools sort -T ${id} -o ${id}.sorted.bam
picard MarkDuplicates I=${id}.sorted.bam O=${id}.sorted.rmdups.bam M=${id}_picard_metrics.txt MAX_FILE_HANDLES_FOR_READ_ENDS_MAP=1000 REMOVE_DUPLICATES=false VALIDATION_STRINGENCY=LENIENT ASSUME_SORTED=true
"""
}
The first process generated multiple files such as genome.ann, genome.pac, genome.amb and so on.
The error i'm getting is that BWA can't find my genome index files represented by the error
[E::bwa_idx_load_from_disk] fail to locate the index filesAny idea how to solve this?