Hi all,
I have a problem with running bwa in parallel. I'm using this script (as kindly suggested in this topic):
# reference
hg1kv37=/dir/to/reference/and/index/files/human_g1k_v37.fasta
# create a function
bwatosam() {
id="$1"
bwa mem -t 10 -R "@RG\tID:$id\tSM:$id\tPL:ILLUMINA\tLB:$id_exome" -v 1 -M $hg1kv37 "$id"_R1_fq.gz "$id"_R2_fq.gz \
| samtools view -Sb -o "$id".bam
}
export -f bwatosam
# --plus enables {%...} to remove a substring
ls *_R1_fq.gz |
parallel --plus bwatosam {%_R1_fq.gz}
And I keep getting the following error:
[E::bwa_idx_load_from_disk] fail to locate the index files
Although the contents of a /dir/to/reference/and/index/files/
are:
human_g1k_v37.fasta.bwt
human_g1k_v37.dict
human_g1k_v37.fasta.fai
human_g1k_v37.fasta
human_g1k_v37.fasta.amb
human_g1k_v37.fasta.ann
human_g1k_v37.fasta.idx.1.bt2
human_g1k_v37.fasta.idx.4.bt2
human_g1k_v37.fasta.idx.rev.1.bt2
human_g1k_v37.fasta.idx.rev.2.bt2
human_g1k_v37.fasta.idx.2.bt2
human_g1k_v37.fasta.idx.3.bt2
human_g1k_v37.fasta.pac
human_g1k_v37.fasta.sa
The index files were created some time ago but they should be OK because if I run a loop over all files (using a list with their names):
for line in `cat ids_list.txt`
do
bwa mem \
-t 10 \
-M $hg1kv37 \
"$line"_R1_fq.gz \
"$line"_R2_fq.gz \
-v 1 -R '@RG\tID:$line\tSM:$line\tPL:ILLUMINA\tLB:$line_exome' \
-M | samtools view -Sb - > $line.bam
done
everything works. Any ideas?
try option -v 4 to get better debugging output.