heard'emsay

反省してます

fail to open file 'foo.fna.nt.ann'. Abort!

$ bwa samse /home/genome/NC_000913.fna SRR022885.sai ../SRR022885.200k.fastq > SRR022885.sam 
<b>[bns_restore_core] fail to open file '/home/genome/NC_000913.fna.nt.ann'. Abort!
</b>アボートしました (コアダンプ)

となるので諸々試行錯誤。".nt"なる拡張子が何だかわからんかったので調べると

the .nt extension stands for nucleotide

http://intro-prog-bioinfo-2010.wikispaces.com/Session+5.2

とのこと。.ntでbwaのソースコードを検索かけると

while ((c = getopt(argc, argv, "ca:p:")) >= 0) {
	switch (c) {
	case 'a': // if -a is not set, algo_type will be determined later
		if (strcmp(optarg, "div") == 0) algo_type = 1;
		else if (strcmp(optarg, "bwtsw") == 0) algo_type = 2;
		else if (strcmp(optarg, "is") == 0) algo_type = 3;
		else err_fatal(__func__, "unknown algorithm: '%s'.", optarg);
		break;
	case 'p': prefix = strdup(optarg); break;
	case 'c': is_color = 1; break;
	default: return 1;
	}
}
中略
if (is_color == 0) { // nucleotide indexing
//中略
} else { // color indexing
	strcat(strcpy(str, prefix), ".nt");
後略
}
https://github.com/lh3/bwa/blob/master/bwtindex.c

とあり、どうやらオプションに"-c"をつければ.ntファイルを生成してくれるらしい。実際生成してくれたのでめでたしめでたし。ちなみに.annファイルは人力で読めるので読んで比較したところ、.nt.annと単なる.annは全く相違なし。何だったんだ一体。

追記:
SourceForge.net: Burrows-Wheeler Aligner: bio-bwa-help
関係あるかもしれんので後で読む。