lower_limit = read_req - (read_req * 0.1)
    
      print libid, read_req, lower_limit, readcount
        
    self.show_log('info', "{0}.{1} - Library(ies) with read requested set to 0 - {2}".format(self.__classname, getframe().f_code.co_name, self.__zeroread))
    self.show_log('info', "{0}.{1} - Library(ies) with no tracks - {2}".format(self.__classname, getframe().f_code.co_name, self.__zerotrack))
    self.show_log('info', "{0}.{1} - Library(ies) with FQ-files not done - {2}".format(self.__classname, getframe().f_code.co_name, self.__zerofqfile))


'''
  check library status for 'sequencing'
  query reads requested for the libraries
  if reads_requested - 10% is matched -> set libraries to finished/data delivered
  if data_delivered -> publish reads
  question: how find out if finished/data delivered -> via project? what if there are more than one project?
'''

if __name__ == '__main__':
  db = Database(Information.DB_HOST, Information.DB_USER, Information.DB_PW, Information.DB)
  
  logfile = '{0}{1}'.format(Information.LOGDIRECTORY, getLogfile(basename(getframe().f_code.co_filename.rstrip('.py'))))
  mainlog = MainLogger(logfile)
  db_main = DB_Maintain(db)
  db_main.start_logging()
  db.start_logging()
  db.setConnection()
  db_main.check_library_delivery_state()
  #db_main.check_library_sequencing_amount()
  
  db.commitConnection()
  db.closeConnection()
    self.register_fqfiles()
    self.prepare_SGElist()
    if self.__array:
      self.build_ArrayJob()
      self.writeArrayFiles()   
    self.writeSGE()
    self.startSGE()

  sgelist = property(get_sgelist)

if __name__ == '__main__':
  db = None
  parser = Parser()
  parser.parse()
  parser.start_logging()

  if parser.log:
    logfile = '{0}{1}'.format(Information.LOGDIRECTORY, getLogfile(basename(getframe().f_code.co_filename.rstrip('.py'))))
    mainlog = MainLogger(logfile)

  parser.main()

  if parser.query: 
    db = Database(Information.DB_HOST, Information.DB_USER, Information.DB_PW, Information.DB)
    if parser.log: db.start_logging()
    db.setConnection()

  trinst = TransportFastq(parser.log, parser.files, parser.output, parser.zip, parser.array, parser.merge, parser.undet, parser.query, db)
  trinst.main()
  if parser.query:
    db.closeConnection()