From 750209a4cb75e40a6c24b3a388a74a70830abb38 Mon Sep 17 00:00:00 2001 From: anastasiia Date: Tue, 27 Nov 2018 10:43:38 +0100 Subject: [PATCH] starting to work with genes reseived from the find_exons --- visualize.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/visualize.py b/visualize.py index 892ed57..026a8e5 100644 --- a/visualize.py +++ b/visualize.py @@ -62,17 +62,20 @@ def make_box_plot(group1, group2, gene_names, scores, output_directory, figure_n group_one = [] group_two = [] - for name in group1: - group_one.append(scores[gene_names.index(name)]) + #for name in group1: + # group_one.append(scores[gene_names.index(name)]) - for name in group2: - group_two.append(scores[gene_names.index(name)]) + #for name in group2: + # group_two.append(scores[gene_names.index(name)]) #plt.figure() #plt.boxplot([group_one, group_two]) - groups_names = ['Important in ED', 'Not important in ED'] + groups_names = ['gen1', 'gen2'] + #data = [group_one, group_two] + group_one = [2] + group_two = [8, 6] data = [group_one, group_two] fig, ax1 = plt.subplots(figsize=(10,10)) @@ -92,11 +95,11 @@ def make_box_plot(group1, group2, gene_names, scores, output_directory, figure_n #ax1.set_axisbelow(True) ax1.set_title('The visualization of correlation between gene and exons length') - ax1.set_xlabel('Groups') - ax1.set_ylabel('Number') + ax1.set_xlabel('Genen') + ax1.set_ylabel('Scores') #ax1.set_ylim(bottom, top) - ax1.set_xticklabels(np.repeat(groups_names, 2), rotation=45, fontsize=8) + ax1.set_xticklabels(np.repeat(groups_names, 5), rotation=45, fontsize=8) #something is failing with this annotation plt.show() @@ -150,6 +153,7 @@ def make_reg_plot(x_array, y_array, gene_names, output_directory, figure_name, c def read_correlation(correlation_file): gene_names = [] + #transcript_names = [] scores = [] gene_lengths = [] exons_lengths = [] @@ -158,6 +162,10 @@ def read_correlation(correlation_file): if not cor_line.startswith('#'): cor_line_array = re.split(r'\t', cor_line.rstrip('\n')) gene_names.append(cor_line_array[0]) + #transcript_names.append(cor_line_array[1]) + #scores.append(float(cor_line_array[2])) + #gene_lengths.append(int(cor_line_array[3])) + #exons_lengths.append(int(cor_line_array[4])) scores.append(float(cor_line_array[1])) gene_lengths.append(int(cor_line_array[2])) exons_lengths.append(int(cor_line_array[3]))