Hi there,
I'm using bwa mem for alignment but I noticed this behavior which I don't fully understand:
I created large aws ec2 instances (60G RAM and 32 cores), installed bwa, downloaded the human reference (=3G), indexed it, the bwa command is very straightforward: bwa mem human_ref.fasta input.fq
What happens is that the first time I use the command it takes a long time. It doesn't output anything onto stdout or stderr but I noticed it is loading something in the RAM (I think its the reference index), after it loads 5G or so, bwa "runs" fast enough with respect to the small input size (in megas). This Scenario only happens the first time I run the command on the machine, any runs after that don't take such time and finish reasonably fast.
Is this is normal? Why doesn't bwa take such long time after the first run?
Any help is appreciated.
Thanks,
Shazly
I think you are right about the loading of the reference index into memory. Also, I seem to recall that the system bwa uses for memory mapping of the index allows it to be reused in subsequent runs. That's why things get faster after the first run. If you load your memory with something else between two runs, your second run should be slow, too.