regressor_kwargs=method_params[1],
        tf_matrix=tf_matrix,
        tf_matrix_gene_names=tf_matrix_gene_names,
        target_gene_name=target_gene_name,
        target_gene_expression=target_gene_expression,
        include_meta=False,
        early_stop_window_length=EARLY_STOP_WINDOW_LENGTH,
        seed=args.seed)
    return (n)


if __name__ == '__main__':

    start_time = time.time()
    ex_matrix = load_exp_matrix(args.expression_mtx_fname,
                                (args.transpose == 'yes'), args.sparse,
                                args.cell_id_attribute, args.gene_attribute)

    if args.sparse:
        gene_names = ex_matrix[1]
        ex_matrix = ex_matrix[0]
    else:
        gene_names = ex_matrix.columns

    end_time = time.time()
    print(
        f'Loaded expression matrix of {ex_matrix.shape[0]} cells and {ex_matrix.shape[1]} genes in {end_time - start_time} seconds...',
        file=sys.stdout)

    tf_names = load_tf_names(args.tfs_fname)
    print(f'Loaded {len(tf_names)} TFs...', file=sys.stdout)
Beispiel #2
0
def convert(fname_csv, fname_loom, transpose):
    df = load_exp_matrix(fname_csv, transpose)
    save_df_as_loom(df, fname_loom)