This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bwa -N 1 -N Options, What They Mean?

HI,

I am curious as what this exactly means:

bwa aln -n 1 -N ...

-n NUM Maximum edit distance if the value is INT, or the fraction of missing alignments given 2% uniform base error rate if FLOAT. In the latter case, the maximum edit distance is automatically chosen for different read lengths. [0.04]

-N Disable iterative search. All hits with no more than maxDiff differences will be found. This mode is much slower than the default.

I read the documentation of bwa but I couldn't figure out what the option -n 1 -N would mean.

Help would be appreciated.

thanks!

bwa

@Michael, thanks!

1 answer

-n if the value in INT means the maximum edit distance. Check the link to read about edit distance: http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Dynamic/Edit/ . Basically it is total number of mismatches , insertions and deletions allowed when aligning a short read against the genome. 1 mismatch or 1 bp insertion or 1 bp deletion will count towards one edit distance.

-n if float is same as edit distance but the edit distance for a read will be chosen based on the read length. So if you specify a float value of .06, that means bwa will choose the edit distance of 6 bp for a 100 bp read and 12 bp for a 200 bp read. If your data set has reads with equal length than based on how much mismatches you want to allow you can use an INT value for -n otherwise you can choose a float value and edit distance will be calculated automatically. Also bwa assumes that some of the mismatches between read and the reference can be due to sequencing error in the read. so it allows for 2% base error rate (other than chosen edit distance) that is typical of most of the Illumina sequencers.

I am not sure about -N . I can be totally wrong on this but I think using -N means that bwa will try to find out the all the possible alignments of a read before deciding the best alignment. I think by default, once bwa finds out a good alignment of a read then it wont go looking for some other alignments that still meet the edit distance constraint but are not good as the best alignment.

I usually use default setting for bwa and it works great for me.

Based on the link in the comment above by Micheal, I think my explanation for the -n may not be correct.

Log in to answer this question.