cpToGrp[brd] = drugLabels['class'][ibrd] inameDict = {} for ibrd, brd in enumerate(drugLabels['pert_id']): inameDict[brd] = drugLabels.ix[ibrd]['pert_iname'] ### cell line match mode wkdir = '/xchip/cogs/sig_tools/sig_summly/pcl/dw_sep_24' if not os.path.exists(wkdir): os.mkdir(wkdir) reload(pcla) metric = 'wtcs' po = pcla.PCLA(grpToCp, metric, wkdir, summly_out_prefix='summly_out', pairwise_prefix='pairwise_matrices', cell_match_mode=True, row_space='lm') po.get_sig_ids() # po.run_summly(rerun_mode=False) # summPath = po.out + '/summly_out/sep11' summPath = '/xchip/cogs/projects/connectivity/summly/matched/src' po.make_summly_path_dict(summPath) # po.run_summly(rerun_mode=True) # po.make_summly_path_dict(summPath_nMtch) po.get_inames() # po.test_groups(make_heatmaps=True, # group_size_min=3, # sum_score_metric='sum_score_4', # rankpt_metric='mean_rankpt_4')
ttd_cp_dict[groupName + '-' + groupCat] = cpLst inameDict = {} for x in drugLabels.iterrows(): brds = x[1]['pert_ids_merged'] iname = x[1]['Drug_name'] for brd in brds: inameDict[brd] = iname reload(pcla) gp_type = 'KD' metric = 'wtcs' po = pcla.PCLA(ttd_cp_dict, metric, wkdir, summly_out_prefix='summly_out', pairwise_prefix='pairwise_matrices_by_Category', cell_match_mode=True, row_space='lm') po.get_sig_ids() # po.run_summly(rerun_mode=False) # summPath = po.out + '/summly_out/sep11' summPath = '/xchip/cogs/data/rnwork/batch_summly/summly_lm50' po.make_summly_path_dict(summPath) # po.run_summly(rerun_mode=True) # po.make_summly_path_dict(summPath) po.inameDict = inameDict po.test_groups(make_heatmaps=False, group_size_min=15, sum_score_metric='sum_score_4', rankpt_metric='mean_rankpt_4')
### load in data for individual groups llo = ldc.label_loader() pclDict = llo.load_drugbank_by_gene(group_by_action=False) #get updated pcl dict (to summly space) using pcla module ### class analysis wkdir = '/xchip/cogs/projects/pharm_class/TTd_Oct29' if not os.path.exists(wkdir): os.mkdir(wkdir) reload(pcla) metric = 'wtcs' po = pcla.PCLA(pclDict, metric, wkdir, pairwise_prefix='pairwise_matrices', rankpt_metric='mean_rankpt_4', sum_score_metric='sum_score_4', row_space='lm', cell_match_mode=True) po.get_inames() po.load_summly_mtrx() summDict = po.pclResultDict dbGenes = summDict.keys() dbGenes.remove('-666') #look up baseline expression of these genes MC = mu.MongoContainer() ci = MC.gene_info.find({'pr_gene_symbol': { '$in': dbGenes }}, { 'is_expressed': True,