lib/FASTAReader.js
function idx2pos(idx, prelen, linelen) {
  prelen  = prelen || 0;
  linelen = linelen || 50;
  idx = Number(idx);
  return Math.max(0, idx - prelen - Math.floor((idx - prelen)/(linelen + 1))) + 1;
}
function idx2pos(idx, prelen, linelen) {
  prelen  = prelen || 0;
  linelen = linelen || 50;
  idx = Number(idx);
  return Math.max(0, idx - prelen - Math.floor((idx - prelen)/(linelen + 1))) + 1;
}
function idx2pos ( idx , prelen , linelen ) { prelen = prelen || 0 ; linelen = linelen || 50 ; idx = Number ( idx ) ; return Math . max ( 0 , idx - prelen - Math . floor ( ( idx - prelen ) / ( linelen + 1 ) ) ) + 1 ; }
FASTAReader.idx2pos
convert charcter index to DNA base position
@param number  idx     : character index (leftside)
@param number  prelen  : header data length
@param number  linelen : one line length
@return number : DNA base position
FASTAReader . idx2pos convert charcter index to DNA base position