-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbar_graphs.py
34 lines (24 loc) · 924 Bytes
/
bar_graphs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys
import pandas
import numpy
import sqlite3 as lite
from pandas.io import sql
import os
import matplotlib.pyplot as plt
# Open connect to database
con = lite.connect('geneSequenceResults.db');
cur = con.cursor()
gene_pairs = pandas.read_sql("select * from gene_pairs", con=con)
geneid = 'ZYX|7791'
# geneid = sys.argv[1]
samples_of_geneid = gene_pairs[gene_pairs['geneid']==geneid].set_index('sample').drop('geneid',axis=1).astype(float)
# Bar graph of NT and TN normcounts for specified Gene ID
plt.figure()
samples_of_geneid[['normcount_NT','normcount_TN']].plot(kind='bar')
plt.savefig("/Users/ehrlich/Syncplicity/bioinformatics_folder/cca_tissue_gene_sequence_results/figures_geneidBarGraphs/" + geneid + ".png")
# Commit to the changes and close connection to geneSequenceResults.db
#con.commit()
con.close()
#####################################
# END OF FILE
#####################################