Ejemplo n.º 1
0
    # loop over different models
    for model in models:
        print('model: ' + model)
        model_path = helper.make_directory(sstype_path, model)

        # loop over different RNA binding proteins
        results = []
        for rbp_index, experiment in enumerate(experiments):
            print('Analyzing: ' + experiment)
            tf.reset_default_graph()  # reset any tensorflow graphs
            np.random.seed(247)  # for reproducibilitjy
            tf.set_random_seed(247)  # for reproducibility

            # load rbp dataset
            train, valid, test = helper.load_dataset_hdf5(data_path,
                                                          ss_type=ss_type,
                                                          rbp_index=rbp_index)

            # process rbp dataset
            train, valid, test = helper.process_data(train,
                                                     valid,
                                                     test,
                                                     method=normalize_method)

            # get shapes
            input_shape = list(train['inputs'].shape)
            input_shape[0] = None
            output_shape = train['targets'].shape

            # load model
            genome_model = helper.import_model(model)
Ejemplo n.º 2
0
	# directory to save parameters of saliency
	classifier_path = helper.make_directory(results_path, normalize_method+'_'+ss_type)
	classifier_path = helper.make_directory(classifier_path, 'ensemble')

	# path to pre-trained model parameters
	best_path = os.path.join(trained_path, 'mixed_'+normalize_method+'_'+ss_type)

	# loop over different RNA binding proteins
	for rbp_name in rbp_names:
		print('Analyzing: '+ rbp_name)
		tf.reset_default_graph() # reset any tensorflow graphs
		np.random.seed(247) # for reproducibilitjy
		tf.set_random_seed(247) # for reproducibility

		# load rbp dataset
		train, valid, test = helper.load_dataset_hdf5(data_path, dataset_name=rbp_name, ss_type=ss_type)

		# process rbp dataset
		train, valid, test = helper.process_data(train, valid, test, method=normalize_method)

		# get shapes
		input_shape = list(train['inputs'].shape)
		input_shape[0] = None
		output_shape = train['targets'].shape

		# get ensemble model predictions
		ensemble_predictions, predictions = helper.ensemble_predictions(train, rbp_name, models,
											input_shape, output_shape, best_path, use_scope=True)
		max_index = np.argsort(ensemble_predictions)[::-1]

		# directories to store classifier model and motifs
Ejemplo n.º 3
0
dataset_file_path = os.path.join(dataset_path,
                                 experiment_name + '_' + str(window) + '.h5')

# set results path
results_path = helper.make_directory('../../results', 'encode_eclip')

# model results path
model_path = helper.make_directory(results_path, model_name)

# path to save model
experiment_name = rbp_name + '_' + cell_name
model_save_path = os.path.join(model_path, experiment_name)

#-----------------------------------------------------------------------------------------
# load dataset
train, valid, test = helper.load_dataset_hdf5(dataset_file_path,
                                              ss_type=ss_type)

# get shapes of data
input_shape = list(train['inputs'].shape)
input_shape[0] = None
output_shape = [None, train['targets'].shape[1]]

# build model
genome_model = helper.import_model(model_name)
model_layers, optimization = genome_model(input_shape, output_shape)

# build neural network class
nnmodel = nn.NeuralNet(seed=247)
nnmodel.build_layers(model_layers, optimization)
nnmodel.inspect_layers()