{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Install/import","metadata":{}},{"cell_type":"code","source":"import time\nt0start = time.time()\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport sys\nfrom tqdm import tqdm\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\n!pip install --quiet tables\n\n\nimport h5py\n!pip install hdf5plugin~=2.0 # https://forum.hdfgroup.org/t/cant-open-directory-usr-local-hdf5-lib-plugin/9738/4\nimport hdf5plugin","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:29:40.203045Z","iopub.execute_input":"2022-12-01T15:29:40.203436Z","iopub.status.idle":"2022-12-01T15:30:02.554330Z","shell.execute_reply.started":"2022-12-01T15:29:40.203406Z","shell.execute_reply":"2022-12-01T15:30:02.552633Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# \"Load\" data and work with it ","metadata":{}},{"cell_type":"code","source":"print('Look on Features: ')\nfilename = '/kaggle/input/open-problems-multimodal/train_multi_targets.h5'\n\nft = h5py.File(filename,'r')#, mode)","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:28.363598Z","iopub.execute_input":"2022-12-01T14:54:28.363986Z","iopub.status.idle":"2022-12-01T14:54:28.382769Z","shell.execute_reply.started":"2022-12-01T14:54:28.363952Z","shell.execute_reply":"2022-12-01T14:54:28.381420Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(ft.keys() )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:28.384702Z","iopub.execute_input":"2022-12-01T14:54:28.385081Z","iopub.status.idle":"2022-12-01T14:54:28.397286Z","shell.execute_reply.started":"2022-12-01T14:54:28.385033Z","shell.execute_reply":"2022-12-01T14:54:28.396231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"first_key = 'train_multi_targets'\nstr_data_inf = ' MAGIC Multi Train '\n\nprint( ft['train_multi_targets'].keys() )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:28.398366Z","iopub.execute_input":"2022-12-01T14:54:28.398712Z","iopub.status.idle":"2022-12-01T14:54:28.412898Z","shell.execute_reply.started":"2022-12-01T14:54:28.398681Z","shell.execute_reply":"2022-12-01T14:54:28.411455Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"for k in ft[first_key].keys():\n    print(type(ft[first_key][k]), ft[first_key][k].shape)","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:28.417679Z","iopub.execute_input":"2022-12-01T14:54:28.418183Z","iopub.status.idle":"2022-12-01T14:54:28.433649Z","shell.execute_reply.started":"2022-12-01T14:54:28.418119Z","shell.execute_reply":"2022-12-01T14:54:28.432704Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"genes = [t.decode() for t in ft[first_key]['axis0'] ]\nprint( len(genes), genes[:10] )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:28.435274Z","iopub.execute_input":"2022-12-01T14:54:28.436338Z","iopub.status.idle":"2022-12-01T14:54:30.654456Z","shell.execute_reply.started":"2022-12-01T14:54:28.436299Z","shell.execute_reply":"2022-12-01T14:54:30.653056Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"indexes = [t.decode() for t in ft[first_key]['axis1'] ]\nprint(len(indexes) , indexes[:10] )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:30.655940Z","iopub.execute_input":"2022-12-01T14:54:30.656455Z","iopub.status.idle":"2022-12-01T14:54:40.572440Z","shell.execute_reply.started":"2022-12-01T14:54:30.656412Z","shell.execute_reply":"2022-12-01T14:54:40.571116Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print( type(ft[first_key]['block0_values']), dir(ft[first_key]['block0_values'] ) )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:40.573825Z","iopub.execute_input":"2022-12-01T14:54:40.574242Z","iopub.status.idle":"2022-12-01T14:54:40.580835Z","shell.execute_reply.started":"2022-12-01T14:54:40.574210Z","shell.execute_reply":"2022-12-01T14:54:40.579827Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"meta=pd.read_csv('/kaggle/input/open-problems-multimodal/metadata.csv', index_col=0)\nmeta=meta.loc[indexes]\nmeta.head()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:40.582219Z","iopub.execute_input":"2022-12-01T14:54:40.582791Z","iopub.status.idle":"2022-12-01T14:54:41.283651Z","shell.execute_reply.started":"2022-12-01T14:54:40.582758Z","shell.execute_reply":"2022-12-01T14:54:41.282726Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# G1/S-G2/M cell proliferation cycle plot for all cells \n\nIt will not be very clear - we need to separate days and cell types - see next subsections.","metadata":{}},{"cell_type":"code","source":"\nG1S_genes_Tirosh = ['ENSMUSG00000005410', 'ENSMUSG00000027342', 'ENSMUSG00000025747', 'ENSMUSG00000024742', 'ENSMUSG00000002870', 'ENSMUSG00000022673', 'ENSMUSG00000030978', 'ENSMUSG00000029591', 'ENSMUSG00000031821', 'ENSMUSG00000026355', 'ENSMUSG00000055612', 'ENSMUSG00000037474', 'ENSMUSG00000025395', 'ENSMUSG00000001228', 'ENSMUSG00000031629', 'ENSMUSG00000025001', 'ENSMUSG00000023104', 'ENSMUSG00000028884', 'ENSMUSG00000028693', 'ENSMUSG00000030346', 'ENSMUSG00000006715', 'ENSMUSG00000027242', 'ENSMUSG00000004642', 'ENSMUSG00000028212', 'ENSMUSG00000041712', 'ENSMUSG00000030726', 'ENSMUSG00000024151', 'ENSMUSG00000022360', 'ENSMUSG00000027323', 'ENSMUSG00000020649', 'ENSMUSG00000000028', 'ENSMUSG00000017499', 'ENSMUSG00000039748', 'ENSMUSG00000032397', 'ENSMUSG00000022422', 'ENSMUSG00000030528', 'ENSMUSG00000028282', 'ENSMUSG00000028560', 'ENSMUSG00000042489', 'ENSMUSG00000006678', 'ENSMUSG00000022945', 'ENSMUSG00000034329', 'ENSMUSG00000046179']\nG2M_genes_Tirosh = ['ENSMUSG00000054717', 'ENSMUSG00000019942', 'ENSMUSG00000027306', 'ENSMUSG00000001403', 'ENSMUSG00000017716', 'ENSMUSG00000027469', 'ENSMUSG00000020914', 'ENSMUSG00000024056', 'ENSMUSG00000062248', 'ENSMUSG00000026683', 'ENSMUSG00000028044', 'ENSMUSG00000031004', 'ENSMUSG00000019961', 'ENSMUSG00000026605', 'ENSMUSG00000037313', 'ENSMUSG00000020808', 'ENSMUSG00000034349', 'ENSMUSG00000032218', 'ENSMUSG00000048327', 'ENSMUSG00000037725', 'ENSMUSG00000020897', 'ENSMUSG00000027379', 'ENSMUSG00000012443', 'ENSMUSG00000015749', 'ENSMUSG00000036752', 'ENSMUSG00000022385', 'ENSMUSG00000024795', 'ENSMUSG00000044783', 'ENSMUSG00000023505', 'ENSMUSG00000020737', 'ENSMUSG00000006398', 'ENSMUSG00000038379', 'ENSMUSG00000044201', 'ENSMUSG00000028678', 'ENSMUSG00000022391', 'ENSMUSG00000038252', 'ENSMUSG00000037544', 'ENSMUSG00000048922', 'ENSMUSG00000028873', 'ENSMUSG00000027699', 'ENSMUSG00000032254', 'ENSMUSG00000020330', 'ENSMUSG00000027496', 'ENSMUSG00000068744', 'ENSMUSG00000036777', 'ENSMUSG00000004880', 'ENSMUSG00000040549', 'ENSMUSG00000045328', 'ENSMUSG00000005698', 'ENSMUSG00000026622', 'ENSMUSG00000035293', 'ENSMUSG00000074802', 'ENSMUSG00000009575', 'ENSMUSG00000029177']\n\nG1S_genes_Tirosh = ['MCM5', 'PCNA', 'TYMS', 'FEN1', 'MCM2', 'MCM4', 'RRM1', 'UNG', 'GINS2', 'MCM6', 'CDCA7', 'DTL', 'PRIM1', 'UHRF1', 'MLF1IP', 'HELLS', 'RFC2', 'RPA2', 'NASP', 'RAD51AP1', 'GMNN', 'WDR76', 'SLBP', 'CCNE2', 'UBR7', 'POLD3', 'MSH2', 'ATAD2', 'RAD51', 'RRM2', 'CDC45', 'CDC6', 'EXO1', 'TIPIN', 'DSCC1', 'BLM', 'CASP8AP2', 'USP1', 'CLSPN', 'POLA1', 'CHAF1B', 'BRIP1', 'E2F8']\nG2M_genes_Tirosh = ['HMGB2', 'CDK1', 'NUSAP1', 'UBE2C', 'BIRC5', 'TPX2', 'TOP2A', 'NDC80', 'CKS2', 'NUF2', 'CKS1B', 'MKI67', 'TMPO', 'CENPF', 'TACC3', 'FAM64A', 'SMC4', 'CCNB2', 'CKAP2L', 'CKAP2', 'AURKB', 'BUB1', 'KIF11', 'ANP32E', 'TUBB4B', 'GTSE1', 'KIF20B', 'HJURP', 'CDCA3', 'HN1', 'CDC20', 'TTK', 'CDC25C', 'KIF2C', 'RANGAP1', 'NCAPD2', 'DLGAP5', 'CDCA2', 'CDCA8', 'ECT2', 'KIF23', 'HMMR', 'AURKA', 'PSRC1', 'ANLN', 'LBR', 'CKAP5', 'CENPE', 'CTCF', 'NEK2', 'G2E3', 'GAS2L3', 'CBX5', 'CENPA']\nlist_genes_fastCCsign = ['CDK1', 'UBE2C', 'TOP2A', 'TMPO', 'HJURP', 'RRM1', 'RAD51AP1', 'RRM2', 'CDC45', 'BLM', 'BRIP1', 'E2F8', 'HIST2H2AC']\n\nG1S_genes_Tirosh = ['ENSG00000100297', 'ENSG00000132646', 'ENSG00000176890', 'ENSG00000168496', 'ENSG00000073111', 'ENSG00000104738', 'ENSG00000167325', 'ENSG00000076248', 'ENSG00000131153', 'ENSG00000076003', 'ENSG00000144354', 'ENSG00000143476', 'ENSG00000198056', 'ENSG00000276043', 'ENSG00000151725', 'ENSG00000119969', 'ENSG00000049541', 'ENSG00000117748', 'ENSG00000132780', 'ENSG00000111247', 'ENSG00000112312', 'ENSG00000092470', 'ENSG00000163950', 'ENSG00000175305', 'ENSG00000012963', 'ENSG00000077514', 'ENSG00000095002', 'ENSG00000156802', 'ENSG00000051180', 'ENSG00000171848', 'ENSG00000093009', 'ENSG00000094804', 'ENSG00000174371', 'ENSG00000075131', 'ENSG00000136982', 'ENSG00000197299', 'ENSG00000118412', 'ENSG00000162607', 'ENSG00000092853', 'ENSG00000101868', 'ENSG00000159259', 'ENSG00000136492', 'ENSG00000129173']\nG2M_genes_Tirosh = ['ENSG00000164104', 'ENSG00000170312', 'ENSG00000137804', 'ENSG00000175063', 'ENSG00000089685', 'ENSG00000088325', 'ENSG00000131747', 'ENSG00000080986', 'ENSG00000123975', 'ENSG00000143228', 'ENSG00000173207', 'ENSG00000148773', 'ENSG00000120802', 'ENSG00000117724', 'ENSG00000013810', 'ENSG00000129195', 'ENSG00000113810', 'ENSG00000157456', 'ENSG00000169607', 'ENSG00000136108', 'ENSG00000178999', 'ENSG00000169679', 'ENSG00000138160', 'ENSG00000143401', 'ENSG00000188229', 'ENSG00000075218', 'ENSG00000138182', 'ENSG00000123485', 'ENSG00000111665', 'ENSG00000189159', 'ENSG00000117399', 'ENSG00000112742', 'ENSG00000158402', 'ENSG00000142945', 'ENSG00000100401', 'ENSG00000010292', 'ENSG00000126787', 'ENSG00000184661', 'ENSG00000134690', 'ENSG00000114346', 'ENSG00000137807', 'ENSG00000072571', 'ENSG00000087586', 'ENSG00000134222', 'ENSG00000011426', 'ENSG00000143815', 'ENSG00000175216', 'ENSG00000138778', 'ENSG00000102974', 'ENSG00000117650', 'ENSG00000092140', 'ENSG00000139354', 'ENSG00000094916', 'ENSG00000115163']\nlist_genes_fastCCsign = ['ENSG00000170312', 'ENSG00000175063', 'ENSG00000131747', 'ENSG00000120802', 'ENSG00000123485', 'ENSG00000167325', 'ENSG00000111247', 'ENSG00000171848', 'ENSG00000093009', 'ENSG00000197299', 'ENSG00000136492', 'ENSG00000129173', 'ENSG00000184260']\n\n\n","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:41.285285Z","iopub.execute_input":"2022-12-01T14:54:41.285914Z","iopub.status.idle":"2022-12-01T14:54:41.305604Z","shell.execute_reply.started":"2022-12-01T14:54:41.285882Z","shell.execute_reply":"2022-12-01T14:54:41.304510Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"IX = np.where(pd.Series(genes).isin(G1S_genes_Tirosh) >0) [0]\nlen(IX), len( G1S_genes_Tirosh)","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:41.307536Z","iopub.execute_input":"2022-12-01T14:54:41.307910Z","iopub.status.idle":"2022-12-01T14:54:41.337311Z","shell.execute_reply.started":"2022-12-01T14:54:41.307867Z","shell.execute_reply":"2022-12-01T14:54:41.335836Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\nvt1 = ft['train_multi_targets']['block0_values'][:,IX].sum(axis = 1 )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:54:41.339165Z","iopub.execute_input":"2022-12-01T14:54:41.339632Z","iopub.status.idle":"2022-12-01T14:55:49.447740Z","shell.execute_reply.started":"2022-12-01T14:54:41.339589Z","shell.execute_reply":"2022-12-01T14:55:49.446365Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"IX = np.where(pd.Series(genes ).isin(G2M_genes_Tirosh) >0) [0]\nlen(IX), len( G2M_genes_Tirosh)","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:55:49.449459Z","iopub.execute_input":"2022-12-01T14:55:49.449933Z","iopub.status.idle":"2022-12-01T14:55:49.466064Z","shell.execute_reply.started":"2022-12-01T14:55:49.449890Z","shell.execute_reply":"2022-12-01T14:55:49.464550Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"%%time\nvt2 = ft['train_multi_targets']['block0_values'][:,IX].sum(axis = 1 )\nprint( len(vt2), type(vt2), vt2.shape) ","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:55:49.471161Z","iopub.execute_input":"2022-12-01T14:55:49.471582Z","iopub.status.idle":"2022-12-01T14:56:17.077607Z","shell.execute_reply.started":"2022-12-01T14:55:49.471551Z","shell.execute_reply":"2022-12-01T14:56:17.076432Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\nsns.scatterplot(x = vt1, y=vt2, hue=meta.cell_type, palette='rainbow', alpha=0.5, s=10)\nplt.title(str_data_inf+'colored by cell type')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:56:17.079711Z","iopub.execute_input":"2022-12-01T14:56:17.080091Z","iopub.status.idle":"2022-12-01T14:56:19.804061Z","shell.execute_reply.started":"2022-12-01T14:56:17.080059Z","shell.execute_reply":"2022-12-01T14:56:19.802775Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\nsns.scatterplot(x = vt1, y=vt2, hue=meta.day, palette='rainbow', alpha=0.5, s=5)\nplt.title(str_data_inf+'colored by day')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:56:19.805538Z","iopub.execute_input":"2022-12-01T14:56:19.806126Z","iopub.status.idle":"2022-12-01T14:56:22.200366Z","shell.execute_reply.started":"2022-12-01T14:56:19.806093Z","shell.execute_reply":"2022-12-01T14:56:22.199354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\nsns.scatterplot(x = vt1, y=vt2, hue=meta.donor, palette='rainbow', alpha=0.5, s=5)\nplt.title(str_data_inf+' colored by donor')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T14:56:22.201935Z","iopub.execute_input":"2022-12-01T14:56:22.202614Z","iopub.status.idle":"2022-12-01T14:56:24.625783Z","shell.execute_reply.started":"2022-12-01T14:56:22.202577Z","shell.execute_reply":"2022-12-01T14:56:24.624575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fi = h5py.File(\"/kaggle/input/open-problems-multimodal/train_multi_inputs.h5\",'r')\nregions = [t.decode() for t in fi['train_multi_inputs']['axis0'] ]\nindexes = [t.decode() for t in fi['train_multi_inputs']['axis1'] ]\nprint(len(regions))\nprint(len(indexes))\n\n","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:13:58.885727Z","iopub.execute_input":"2022-12-01T15:13:58.886303Z","iopub.status.idle":"2022-12-01T15:14:30.766261Z","shell.execute_reply.started":"2022-12-01T15:13:58.886254Z","shell.execute_reply":"2022-12-01T15:14:30.764740Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"xmeans=np.zeros(len(regions))\nx2means=np.zeros(len(regions))\nxv1means=np.zeros(len(regions))\nxv2means=np.zeros(len(regions))\n\nbatch_size=500\nn=len(indexes)\n\n#iterations through rows goes faster\n\nfor k in tqdm(range(0,n, batch_size)):\n    reg=fi['train_multi_inputs']['block0_values'][k:k+batch_size,:]\n    v1b=vt1[k:k+batch_size, None]\n    v2b=vt2[k:k+batch_size, None]\n\n    xmeans+=np.sum(reg, axis=0)\n    x2means+=np.sum(reg**2, axis=0)\n    xv1means+=np.sum(reg*v1b, axis=0)\n    xv2means+=np.sum(reg*v2b, axis=0)\n\n\nv1cors=(n*xv1means-xmeans*np.sum(vt1)) / (np.sqrt(n*x2means-xmeans**2) * \\\n                                         np.sqrt(n*np.sum(vt1**2)-np.sum(vt1)**2) + 1e-25)\nv2cors=(n*xv2means-xmeans*np.sum(vt2)) / (np.sqrt(n*x2means-xmeans**2) * \\\n                                         np.sqrt(n*np.sum(vt2**2)-np.sum(vt2)**2) + 1e-25)\n\nd=np.stack([v1cors,v2cors], axis=1)\n\n\ncorrs=pd.DataFrame(columns=['G1S_correlation','G2M_correlation'],\n               index=regions, data=d)\n\ncorrs.to_csv('multi_tirosh_correlations.csv')","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:39:42.809715Z","iopub.execute_input":"2022-12-01T15:39:42.810381Z","iopub.status.idle":"2022-12-01T15:46:00.122560Z","shell.execute_reply.started":"2022-12-01T15:39:42.810343Z","shell.execute_reply":"2022-12-01T15:46:00.121457Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#corrs=pd.read_csv('multi_tirosh_correlations.csv', index_col=0)\ncorrs.head()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:47:21.820177Z","iopub.execute_input":"2022-12-01T15:47:21.820636Z","iopub.status.idle":"2022-12-01T15:47:21.835521Z","shell.execute_reply.started":"2022-12-01T15:47:21.820600Z","shell.execute_reply":"2022-12-01T15:47:21.834622Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.hist(corrs.G1S_correlation, bins=50, alpha=0.5)\nplt.hist(corrs.G2M_correlation, bins=50, alpha=0.5)\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:47:26.950832Z","iopub.execute_input":"2022-12-01T15:47:26.951248Z","iopub.status.idle":"2022-12-01T15:47:27.400587Z","shell.execute_reply.started":"2022-12-01T15:47:26.951214Z","shell.execute_reply":"2022-12-01T15:47:27.399066Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\na=corrs.G1S_correlation.sort_values()\nplt.scatter(range(len(a)),a, marker='_')\nb=corrs.G2M_correlation.sort_values()\nplt.scatter(range(len(b)),b, marker='_')\nplt.plot()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:47:31.117378Z","iopub.execute_input":"2022-12-01T15:47:31.117830Z","iopub.status.idle":"2022-12-01T15:47:32.031014Z","shell.execute_reply.started":"2022-12-01T15:47:31.117796Z","shell.execute_reply":"2022-12-01T15:47:32.029541Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fi = h5py.File('/kaggle/input/open-problems-multimodal/train_multi_inputs.h5','r')\nregions = [t.decode() for t in fi['train_multi_inputs']['axis0'] ]\nindexes=[t.decode() for t in fi['train_multi_inputs']['axis1'] ]\n","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:47:35.463820Z","iopub.execute_input":"2022-12-01T15:47:35.464631Z","iopub.status.idle":"2022-12-01T15:48:06.831793Z","shell.execute_reply.started":"2022-12-01T15:47:35.464591Z","shell.execute_reply":"2022-12-01T15:48:06.830551Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"n=100\nIX = np.where(pd.Series(regions ).isin(a[-n:].index) >0) [0]\nv1 = fi['train_multi_inputs']['block0_values'][:,IX].sum(axis = 1 )\n\nIX = np.where(pd.Series(regions ).isin(b[-n:].index) >0) [0]\nv2 = fi['train_multi_inputs']['block0_values'][:,IX].sum(axis = 1 )","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:48:06.833909Z","iopub.execute_input":"2022-12-01T15:48:06.834453Z","iopub.status.idle":"2022-12-01T15:52:20.857777Z","shell.execute_reply.started":"2022-12-01T15:48:06.834410Z","shell.execute_reply":"2022-12-01T15:52:20.856561Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,6))\nplt.subplot(121)\nplt.scatter(x = v1, y=vt1, alpha=0.5, s=2)\nplt.title(str_data_inf+'G1S')\nplt.subplot(122)\nplt.scatter(x = v2, y=vt2, alpha=0.5, s=2)\nplt.title(str_data_inf+'G2M')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:52:20.880961Z","iopub.execute_input":"2022-12-01T15:52:20.881437Z","iopub.status.idle":"2022-12-01T15:52:21.368741Z","shell.execute_reply.started":"2022-12-01T15:52:20.881401Z","shell.execute_reply":"2022-12-01T15:52:21.366128Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,10))\nsns.scatterplot(x = v1, y=v2, hue=meta.day, palette='rainbow', alpha=0.5, s=5)\nplt.title(str_data_inf+'colored by day')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:52:21.370912Z","iopub.execute_input":"2022-12-01T15:52:21.371247Z","iopub.status.idle":"2022-12-01T15:52:23.893648Z","shell.execute_reply.started":"2022-12-01T15:52:21.371218Z","shell.execute_reply":"2022-12-01T15:52:23.892287Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"plt.figure(figsize=(20,6))\nplt.subplot(121)\nsns.scatterplot(x = v1, y=v2, hue=vt1, palette='rainbow', alpha=0.5, s=5)\nplt.title(str_data_inf+'colored by G1S')\nplt.subplot(122)\nsns.scatterplot(x = v1, y=v2, hue=vt2, palette='rainbow', alpha=0.5, s=5)\nplt.title(str_data_inf+'colored by G2M')\n\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:52:23.894928Z","iopub.execute_input":"2022-12-01T15:52:23.895398Z","iopub.status.idle":"2022-12-01T15:52:30.583458Z","shell.execute_reply.started":"2022-12-01T15:52:23.895360Z","shell.execute_reply":"2022-12-01T15:52:30.582199Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print('%.1f seconds passed total '%(time.time()-t0start) )\n","metadata":{"execution":{"iopub.status.busy":"2022-12-01T15:52:30.585315Z","iopub.execute_input":"2022-12-01T15:52:30.585757Z","iopub.status.idle":"2022-12-01T15:52:30.593721Z","shell.execute_reply.started":"2022-12-01T15:52:30.585719Z","shell.execute_reply":"2022-12-01T15:52:30.592236Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}