def check_flowgram_ali_exe():
 ali_exe = get_flowgram_ali_exe()
 if (which(ali_exe) is None):
  raise ApplicationNotFoundError(('The alignment program %s is not accessible via the PATH environment variable.' % ali_exe))
 command = ('%s -h' % ali_exe)
 proc = Popen(command, shell=True, universal_newlines=True, stdout=PIPE, stderr=STDOUT)
 if (proc.wait() != 0):
  raise ApplicationError(('Calling %s failed. Check permissions and that it is in fact an executable.' % ali_exe))
 result = proc.stdout.read()
 if (not result.startswith('Usage')):
  raise ApplicationError(('Calling %s failed. Check permissions and that it is in fact an executable.' % ali_exe))
 return True

def check_flowgram_ali_exe ( ) : ali_exe = get_flowgram_ali_exe ( ) if ( which ( ali_exe ) is None ) : raise ApplicationNotFoundError ( ( 'The alignment program %s is not accessible via the PATH environment variable.' % ali_exe ) ) command = ( '%s -h' % ali_exe ) proc = Popen ( command , shell = True , universal_newlines = True , stdout = PIPE , stderr = STDOUT ) if ( proc . wait ( ) != 0 ) : raise ApplicationError ( ( 'Calling %s failed. Check permissions and that it is in fact an executable.' % ali_exe ) ) result = proc . stdout . read ( ) if ( not result . startswith ( 'Usage' ) ) : raise ApplicationError ( ( 'Calling %s failed. Check permissions and that it is in fact an executable.' % ali_exe ) ) return True
check if we have a working flowgramaligner .