Skip to content

Commit

Permalink
starting to work with genes reseived from the find_exons
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiia committed Nov 27, 2018
1 parent ad02c52 commit 750209a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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()
Expand Down Expand Up @@ -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 = []
Expand All @@ -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]))
Expand Down

0 comments on commit 750209a

Please sign in to comment.