In [1]:
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
In [2]:
mclab = os.getenv('MCLAB')
fname = os.path.join(mclab, 'cegs_ase_paper/pipeline_output/qsim_bayesian/qsim_bias_wide.csv')
dat = pd.read_csv(fname, index_col='fusion_id')
dat[:3]
Out[2]:
In [3]:
# Pull out only the columns with qsim value
mk = dat.ix[:,1:-1]
# Turn qsim values into binary values
maskLine = mk > 0.5
maskTester = mk < 0.5
mask1 = mk == 0.5
mask2 = mk.isnull()
mk[mask1] = 0
mk[mask2] = 0
mk[maskLine] = 1
mk[maskTester] = -1
mk[:3]
Out[3]:
In [5]:
fig = plt.figure(figsize=(8,8))
plt.imshow(mk, aspect='auto', cmap=plt.cm.Spectral)
plt.xlabel('lines')
plt.ylabel('Exonic Regions')
plt.title(u'Fusions that showed bias in simulations.\nLine Bias (1) and Tester Bias (-1)')
plt.colorbar()
plt.tight_layout()
plt.savefig(os.path.join(mclab,'cegs_ase_paper/pipeline_output/qsim_bayesian/qsim_bias_matrix.png'))
In [ ]: