Mercurial > repos > johnheap > vapper
comparison Tryp_V_T.py @ 27:92c5ecb025b6 draft
Uploaded
author | johnheap |
---|---|
date | Wed, 05 Jun 2019 16:17:30 -0400 |
parents | 7983a9305b53 |
children | be77587bdfda |
comparison
equal
deleted
inserted
replaced
26:7983a9305b53 | 27:92c5ecb025b6 |
---|---|
236 def getPhyloNumber(sac): | 236 def getPhyloNumber(sac): |
237 i = sac.find('_') | 237 i = sac.find('_') |
238 return int(sac[1:i]) | 238 return int(sac[1:i]) |
239 | 239 |
240 def combineFPMK(tdict): | 240 def combineFPMK(tdict): |
241 dir_path = os.path.dirname(os.path.realpath(__file__))+'/' | 241 # dir_path = os.path.dirname(os.path.realpath(__file__))+'/' |
242 | 242 cur_path = os.getcwd()+'/' |
243 fpkm_df = pd.read_csv(dir_path+tdict['name']+'.cuff/genes.fpkm_tracking', sep='\t') | 243 fpkm_df = pd.read_csv(cur_path+tdict['name']+'.cuff/genes.fpkm_tracking', sep='\t') |
244 | 244 |
245 #fpkm_df = pd.read_csv('genes.fpkm_tracking',sep='\t') | 245 #fpkm_df = pd.read_csv('genes.fpkm_tracking',sep='\t') |
246 #print(fpkm_df.head()) | 246 #print(fpkm_df.head()) |
247 fpkm_df['locus'] = fpkm_df['locus'].apply(lambda names: names[:names.find(':')]) | 247 fpkm_df['locus'] = fpkm_df['locus'].apply(lambda names: names[:names.find(':')]) |
248 #print(fpkm_df.head()) | 248 #print(fpkm_df.head()) |
249 | 249 |
250 reducedBlast_df = pd.read_csv(dir_path + tdict['name']+'_transcript.csv') | 250 reducedBlast_df = pd.read_csv(cur_path + tdict['name']+'_transcript.csv') |
251 # reducedBlast_df = pd.read_csv('TrinityVT_transcript.csv') | 251 # reducedBlast_df = pd.read_csv('TrinityVT_transcript.csv') |
252 saccverSet = set(reducedBlast_df['saccver']) | 252 saccverSet = set(reducedBlast_df['saccver']) |
253 saccverList = list(saccverSet) | 253 saccverList = list(saccverSet) |
254 saccverList.sort() | 254 saccverList.sort() |
255 # print(saccverList[:5]) | 255 # print(saccverList[:5]) |
357 ax.set_title(title, x=0, wrap='True',ha='left',) | 357 ax.set_title(title, x=0, wrap='True',ha='left',) |
358 | 358 |
359 plt.savefig(tdict['html_resource'] + tdict['name']+"_phylotypes.png") | 359 plt.savefig(tdict['html_resource'] + tdict['name']+"_phylotypes.png") |
360 if tdict['pdf'] == 'PDF_Yes': | 360 if tdict['pdf'] == 'PDF_Yes': |
361 plt.savefig(tdict['html_resource'] + tdict['name']+"phylotypes.pdf") | 361 plt.savefig(tdict['html_resource'] + tdict['name']+"phylotypes.pdf") |
362 plt.show() | 362 # plt.show() |
363 pass | 363 pass |
364 | 364 |
365 | 365 |
366 | 366 |
367 def doBarChart(tdict, sum2_df): | 367 def doBarChart(tdict, sum2_df): |