code: def checkArgs(args):
      
      # Check if we have the tped and the tfam files
      for fileName in [args.bfile + i for i in [".bed", ".bim", ".fam"]]:
          if not os.path.isfile(fileName):
              msg = "%(fileName)s: no such file" % locals()
              raise ProgramError(msg)
  
      # Check the HW pvalue
      hwValue = args.hwe
      try:
          hwValue = float(hwValue)
      except ValueError:
          msg = "%(hwValue)s: not a valid HW value" % locals()
          raise ProgramError(msg)
      if (hwValue < 0) or (hwValue > 1):
          msg = "%s: not a valid HW value" % args.hwe
          raise ProgramError(msg)
  
      return True
docs: Checks the arguments and options.
  
      :param args: a :py:class:`argparse.Namespace` object containing the options
                   of the program.
  
      :type args: :py:class:`argparse.Namespace`
  
      :returns: ``True`` if everything was OK.
  
      If there is a problem with an option, an exception is raised using the
      :py:class:`ProgramError` class, a message is printed to the
      :py:class:`sys.stderr` and the program exists with code 1.