nl_tokens: Helper that sorts by length giving priority to ones that start with ATG / AUG
pl_tokens: function sortReadingFrames ( a , b ) { var aSort = a . length var bSort = b . length if ( bSort - aSort === 0 ) { var aStartCodon = a . <mask> ( 0 , 3 ) . toUpperCase ( ) . replace ( 'T' , 'U' ) var bStartCodon = b . slice ( 0 , 3 ) . toUpperCase ( ) . replace ( 'T' , 'U' ) if ( aStartCodon === 'AUG' ) { aSort ++ } if ( bStartCodon === 'AUG' ) { bSort ++ } } return bSort - aSort }