Git Lab CI for docker build enabled! You can enable it using .gitlab-ci.yml in your project. Check file template at https://gitlab.bio.di.uminho.pt/snippets/5

Commit 86ac1d93 authored by Diogo Batista Lima's avatar Diogo Batista Lima
Browse files

Upload New File

parent 26c790e6
from geo_arrayexpress import *
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
def simple_lineplot(x,y,title,xlab,ylab,color="black",font="serif"):
# creates a line plot using matplotlib.pyplot with 1 variable of data only
fig=plt.figure(figsize=(7,5))
plt.rc('font', family=font)
plt.title(title)
plt.xlabel(xlab)
plt.ylabel(ylab)
plt.plot(x,y,color=color)
return fig
def double_barplot(n_bars,values1,values2,title,bar_labels,xlabel,ylabel,legend,
color1="red",color2="blue",font="serif",width=0.35):
# creates a barplot with matplotlib.pyplot with 2 different variables of data
# legend attribute must be a list/tuple with len(legend)=n_bars
fig, ax = plt.subplots()
ind = np.arange(n_bars) # the x locations for the groups
width = width # the width of the bars
p1 = ax.bar(ind,values1, width, color=color1, bottom=0)
p2 = ax.bar(ind + width,values2, width,
color=color2, bottom=0)
ax.set_title(title)
ax.set_xticks(ind + width / 2)
bar_labels=bar_labels
ax.set_xticklabels(bar_labels)
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.rc("font",family=font)
ax.legend((p1[0], p2[0]),legend)
return fig
if __name__=="__main__":
graph1=simple_lineplot(years,number_of_series,"Publicly available experimental series in GEO",
"Years","Number of series",color="black",font="Times New Roman")
graph2=double_barplot(7,geo_microarray,geo_hst,"Types of expression"
" studies available in GEO",
["EP", "GVP", "GB/OP", "MP", "PP", "NcRP", "Other"],"Expression studies",
"Number of series",('Microarray ('+str(sum(geo_microarray))+")"
, 'Next Generation Sequencing ('+str(sum(geo_hst))+")"),
color1="black",color2="grey",font="Times New Roman")
ae_ngs=[0,0,2344,432,67]
ae_microarray=[8150,417,0,0,967]
graph3=double_barplot(5,ae_microarray,ae_ngs,"Types of expression studies available in ArrayExpress",
["TP", "CGHbA","RNA-Seq", "ChIP-seq", "Other"],"Expression studies",
"Number of series",('Microarray ('+str(sum(ae_microarray))+")"
, 'Next Generation Sequencing ('+str(sum(ae_ngs))+")"),
color1="black",color2="grey",font="Times New Roman")
pp = PdfPages('graphs_article1.pdf')
pp2 = PdfPages('graphs_article2.pdf')
pp3 = PdfPages('graphs_article3.pdf')
pp.savefig(graph1)
pp2.savefig(graph2)
pp3.savefig(graph3)
pp.close()
pp2.close()
pp3.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment