if not opts: usage() sys.exit(2) except getopt.GetoptError: print "Incorrect options passed" usage() sys.exit(2) params = parseopts(opts) # check if command-line options are valid try: checkopts(params) except (ValueError, KeyError): sys.exit(2) # load data if params['format'] == 'bed': G = parse_bed.load(params['inputfile']) elif params['format'] == 'str': G = parse_str.load(params['inputfile']) G = np.require(G, dtype=np.uint8, requirements='C') # run the variational algorithm Q, P, other = fastStructure.infer_variational_parameters(G, params['K'], \ params['outputfile'], params['mintol'], \ params['prior'], params['cv']) # write out inferred parameters write_output(Q, P, other, params)
if not opts: usage() sys.exit(2) except getopt.GetoptError: print "Incorrect options passed" usage() sys.exit(2) params = parseopts(opts) # check if command-line options are valid try: checkopts(params) except (ValueError,KeyError): sys.exit(2) # load data if params['format']=='bed': G = parse_bed.load(params['inputfile']) elif params['format']=='str': G = parse_str.load(params['inputfile']) G = np.require(G, dtype=np.uint8, requirements='C') # run the variational algorithm Q, P, other = fastStructure.infer_variational_parameters(G, params['K'], \ params['outputfile'], params['mintol'], \ params['prior'], params['cv']) # write out inferred parameters write_output(Q, P, other, params)