def checkopts(params):

    """
    checks if some of the command-line options passed are valid.
    In the case of invalid options, an exception is always thrown.
    """

    if params['mintol']<=0:
        print "a non-positive value was provided as convergence criterion"
        raise ValueError
    
    if params['cv']<0:
        print "a negative value was provided for the number of cross-validations folds"
        raise ValueError

    if not params.has_key('K'):
        print "a positive integer should be provided for number of populations"
        raise KeyError

    if ['bed','str'] not in params['format']:
        print "%s data format is not currently implemented"
        raise ValueError

    if params['K']<=0:
        print "a negative value was provided for the number of populations"
        raise ValueError
    
    if not params.has_key('inputfile'):
        print "an input file needs to be provided"
        raise KeyError 

    if not params.has_key('outputfile'):
        print "an output file needs to be provided"
        raise KeyError
dataset/ETHPy150Open rajanil/fastStructure/structure.py/checkopts/swapped operands of `not in`