Skip to content

Commit

Permalink
Removed all fontsize set in genda.eQTL.plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhsu3 committed Jul 9, 2015
1 parent 3a81f6f commit ee25abd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
12 changes: 5 additions & 7 deletions genda/eQTL/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ def plot_dosage_by_rsID(gene_reference, dos, cov_mat, counts,
c = colors)
if not title:
title = gr.gene
ax.set_title('%s partial regression\non %s' % (title, gr.rsID),
fontsize=22)
ax.set_ylabel('$log_{2}$ CPM', fontsize=16)
ax.set_xlabel('Fitted Dosages', fontsize=16)
ax.set_title('%s partial regression\non %s' % (title, gr.rsID))
ax.set_ylabel('$log_{2}$ CPM')
ax.set_xlabel('Fitted Dosages')
xticks = ax.get_xticks()
yticks = ax.get_yticks()
ax.set_xticks(xticks[1::2])
Expand All @@ -99,7 +98,7 @@ def plot_dosage_by_rsID(gene_reference, dos, cov_mat, counts,
ax.tick_params(axis='both', which='major', labelsize=16)
ax.text(xticks[0] + 0.025 , yticks[annot_y] + annot_y/2*yrange/5,
'$R^{2}$=%s' % str(test.rsquared)[0:4],
style='italic', fontsize=16)
style='italic')
if ax_orig:
return(ax, test)
else:
Expand Down Expand Up @@ -202,12 +201,11 @@ def plot_eQTL(meQTL, gene_name, annotation, dosage, ax=None,
else: pass
if symbol:
gene_name = symbol
#ax.set_title(r'eQTL for %s' % gene_name, fontsize=25)
if ax_orig:
return(ax)
else:
cbar_ax = fig.add_axes([0.87, 0.15, 0.05, 0.7])
bar = fig.colorbar(im, cax=cbar_ax)
bar.ax.tick_params(labelsize=18)
bar.set_label('r$^{2}$', fontsize=24)
bar.set_label('r$^{2}$')
return(fig)
17 changes: 8 additions & 9 deletions genda/plotting/annotation.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@


def snp_arrow(pos, height, snpid, ax):
def snp_arrow(pos, height, snpid, ax, hadjust = 0.0,**kwargs):
""" Draws an arrow pointing at a SNP in
a Manhattan plot
Arguments
=========
pos - an object with pos and height
height - height
snpid - text label for the arrow
ax - matplotlib axes
"""

rel_width = 15
p_width = ax.get_xlim()
#p_width = ax.get_xlim()
p_height = ax.get_ylim()
spacer = (p_height[1] - p_height[0])/rel_width
ax.annotate(snpid, xy=(pos, height),
xytext = (pos, p_height[1] - spacer),
arrowprops=dict(facecolor='black', shrink=0.05))


xytext = (pos, p_height[1] - spacer + hadjust),
arrowprops=dict(facecolor='black', shrink=0.05),
**kwargs)
return ax


0 comments on commit ee25abd

Please sign in to comment.