@main.command()
@_seed
@_enu_path
@_germline_path
@_output_path
@_train_size
@_enu_ratio
@_numreps
@_overwrite
def sample_data(enu_path, germline_path, output_path, seed, train_size, enu_ratio, numreps, overwrite):
    'creates train/test sample data'
    if (seed is None):
        seed = int(time.time())
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    np_seed(seed)
    start_time = time.time()
    os.makedirs(output_path, exist_ok=True)
    logfile_path = os.path.join(output_path, 'logs/data_sampling.log')
    if (os.path.exists(logfile_path) and (not overwrite)):
        click.secho(f'Exists: {logfile_path}! use overwrite to force.', fg='red')
        return
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(enu_path)
    LOGGER.input_file(germline_path)
    enu = pandas.read_csv(enu_path, sep='\t', header=0)
    germline = pandas.read_csv(germline_path, sep='\t', header=0)
    train_size = (train_size // 2)
    test_size = train_size
    (train_enu_ratio, test_enu_ratio) = enu_ratio
    (enu_train_size, germ_train_size) = get_enu_germline_sizes(train_size, train_enu_ratio)
    (enu_test_size, germ_test_size) = get_enu_germline_sizes(test_size, test_enu_ratio)
    assert (min(enu_train_size, germ_train_size, enu_test_size, germ_test_size) > 0)
    if (((2 * train_size) > enu.shape[0]) or ((2 * train_size) > germline.shape[0])):
        print(f'ENU data set size: {enu.shape[0]}')
        print(f'Germline data set size: {germline.shape[0]}')
        print(f'Train set size: {train_size}')
        raise ValueError('2 x train size exceeds size of training data source(s)')
    for rep in range(numreps):
        test_outpath = os.path.join(output_path, f'test-{rep}.tsv.gz')
        train_outpath = os.path.join(output_path, f'train-{rep}.tsv.gz')
        (enu_training, enu_testing) = train_test_split(enu, test_size=enu_test_size, train_size=enu_train_size)
        (germ_training, germ_testing) = train_test_split(germline, test_size=germ_test_size, train_size=germ_train_size)
        if any(map((lambda x: (x.shape[0] == 0)), [enu_training, enu_testing, germ_training, germ_testing])):
            raise RuntimeError('screw up in creating test/train set')
        testing = pandas.concat([enu_testing, germ_testing])
        training = pandas.concat([enu_training, germ_training])
        testing.to_csv(test_outpath, index=False, sep='\t', compression='gzip')
        training.to_csv(train_outpath, index=False, sep='\t', compression='gzip')
        LOGGER.output_file(test_outpath)
        LOGGER.output_file(train_outpath)
    duration = (time.time() - start_time)
    LOGGER.log_message(('%.2f' % (duration / 60.0)), label='run duration (minutes)')
    LOGGER.shutdown()
creates train/test sample data
@main.command()
@_seed
@_enu_path
@_germline_path
@_output_path
@_train_size
@_enu_ratio
@_numreps
@_overwrite
def sample_data(enu_path, germline_path, output_path, seed, train_size, enu_ratio, numreps, overwrite):
    
    if (seed is None):
        seed = int(time.time())
    LOGGER.log_args()
    LOGGER.log_versions(['sklearn', 'numpy'])
    np_seed(seed)
    start_time = time.time()
    os.makedirs(output_path, exist_ok=True)
    logfile_path = os.path.join(output_path, 'logs/data_sampling.log')
    if (os.path.exists(logfile_path) and (not overwrite)):
        click.secho(f'Exists: {logfile_path}! use overwrite to force.', fg='red')
        return
    LOGGER.log_file_path = logfile_path
    LOGGER.input_file(enu_path)
    LOGGER.input_file(germline_path)
    enu = pandas.read_csv(enu_path, sep='\t', header=0)
    germline = pandas.read_csv(germline_path, sep='\t', header=0)
    train_size = (train_size // 2)
    test_size = train_size
    (train_enu_ratio, test_enu_ratio) = enu_ratio
    (enu_train_size, germ_train_size) = get_enu_germline_sizes(train_size, train_enu_ratio)
    (enu_test_size, germ_test_size) = get_enu_germline_sizes(test_size, test_enu_ratio)
    assert (min(enu_train_size, germ_train_size, enu_test_size, germ_test_size) > 0)
    if (((2 * train_size) > enu.shape[0]) or ((2 * train_size) > germline.shape[0])):
        print(f'ENU data set size: {enu.shape[0]}')
        print(f'Germline data set size: {germline.shape[0]}')
        print(f'Train set size: {train_size}')
        raise ValueError('2 x train size exceeds size of training data source(s)')
    for rep in range(numreps):
        test_outpath = os.path.join(output_path, f'test-{rep}.tsv.gz')
        train_outpath = os.path.join(output_path, f'train-{rep}.tsv.gz')
        (enu_training, enu_testing) = train_test_split(enu, test_size=enu_test_size, train_size=enu_train_size)
        (germ_training, germ_testing) = train_test_split(germline, test_size=germ_test_size, train_size=germ_train_size)
        if any(map((lambda x: (x.shape[0] == 0)), [enu_training, enu_testing, germ_training, germ_testing])):
            raise RuntimeError('screw up in creating test/train set')
        testing = pandas.concat([enu_testing, germ_testing])
        training = pandas.concat([enu_training, germ_training])
        testing.to_csv(test_outpath, index=False, sep='\t', compression='gzip')
        training.to_csv(train_outpath, index=False, sep='\t', compression='gzip')
        LOGGER.output_file(test_outpath)
        LOGGER.output_file(train_outpath)
    duration = (time.time() - start_time)
    LOGGER.log_message(('%.2f' % (duration / 60.0)), label='run duration (minutes)')
    LOGGER.shutdown()