Skip to content

Commit

Permalink
plotting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhsu3 committed Jul 9, 2015
1 parent 3f84d4a commit 3a81f6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
16 changes: 1 addition & 15 deletions genda/eQTL/plotting.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
""" Plotting functions for eQTLs
"""
from collections import defaultdict
import re

import numpy as np
import pandas as pd
import matplotlib
import statsmodels.api as sm
import matplotlib.pyplot as plt
from statsmodels.graphics import utils as smutils
from statsmodels.graphics.regressionplots import abline_plot

from genda.plotting import (should_not_plot, add_gene_bounderies,
snp_arrow)
from genda.plotting import (should_not_plot, snp_arrow)
from genda import calculate_minor_allele_frequency, calculate_ld


def var_boxplot(ax, x, colors=None):
"""
Arguments:
----------
ax - axis object
"""
for i in x:
pass


class gene_reference(object):
"""
Expand Down Expand Up @@ -150,7 +137,6 @@ def plot_eQTL(meQTL, gene_name, annotation, dosage, ax=None,
else: pass

x_formatter = matplotlib.ticker.ScalarFormatter(useOffset=False)
cm = plt.cm.get_cmap('Blues')
x_scale= 1e6
try:
adj_pv = -1*np.log10(subset.ix[:,'p-value'])
Expand Down
17 changes: 3 additions & 14 deletions genda/plotting/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,17 @@ def snp_arrow(pos, height, snpid, ax):
pos - an object with pos and height
height - height
snpid - text label for the arrow
ax - matplotlib axes
"""

rel_width = 25

rel_width = 15
p_width = ax.get_xlim()
p_height = ax.get_ylim()
'''
spacer = (p_height[1] - p_height[0])/rel_width
a_head_width = (p_width[1] - p_width[0])/rel_width
a_head_length = p_height[1] - p_height[0]/rel_width
arrow_length = p_height - height - spacer
ax.arrow(pos, p_height[1], 0,
arrow_length,
head_width = a_head_width,
head_length = a_head_length,
fc = 'k')
'''

ax.annotate(snpid, xy=(pos, height),
xytext = (pos, p_height[1]),
xytext = (pos, p_height[1] - spacer),
arrowprops=dict(facecolor='black', shrink=0.05))


Expand Down

0 comments on commit 3a81f6f

Please sign in to comment.