#NEWLINE# def check_aln( dbfile , readfile , cpus = 32 ) : #NEWLINE# #INDENT# from jcvi.formats.fastq import guessoffset #NEWLINE# saifile = ( readfile . rsplit ( '.' , 1 ) [ 0 ] + '.sai' ) #NEWLINE# if need_update ( ( dbfile , readfile ) , saifile ) : #NEWLINE# #INDENT# offset = guessoffset ( [ readfile ] ) #NEWLINE# cmd = ( 'bwa aln ' + ' ' . join ( ( dbfile , readfile ) ) ) #NEWLINE# cmd += ' -t {0}' . format ( cpus ) #NEWLINE# if ( offset == 64 ) : #NEWLINE# #INDENT# cmd += ' -I' #NEWLINE# #UNINDENT# sh ( cmd , outfile = saifile ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logging . error ( '`{0}` exists. `bwa aln` already run.' . format ( saifile ) ) #NEWLINE# #UNINDENT# return saifile