{"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":"code","source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-10-27T11:20:11.656804Z","iopub.execute_input":"2023-10-27T11:20:11.657386Z","iopub.status.idle":"2023-10-27T11:20:12.285337Z","shell.execute_reply.started":"2023-10-27T11:20:11.657329Z","shell.execute_reply":"2023-10-27T11:20:12.283768Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_data = pd.read_csv('/kaggle/input/stanford-ribonanza-rna-folding/train_data.csv')\ntrain_data.head()","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:20:12.288509Z","iopub.execute_input":"2023-10-27T11:20:12.289236Z","iopub.status.idle":"2023-10-27T11:22:11.660337Z","shell.execute_reply.started":"2023-10-27T11:20:12.289187Z","shell.execute_reply":"2023-10-27T11:22:11.659103Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cols = train_data.columns.to_numpy()\nreactivity_cols = [x for x in cols if 'reactivity' in x and 'error' not in x]\nerror_cols = [x for x in cols if 'error' in x]\nprint(len(reactivity_cols))\nprint(len(error_cols))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:22:11.662296Z","iopub.execute_input":"2023-10-27T11:22:11.662759Z","iopub.status.idle":"2023-10-27T11:22:11.672370Z","shell.execute_reply.started":"2023-10-27T11:22:11.662724Z","shell.execute_reply":"2023-10-27T11:22:11.670809Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(np.unique(train_data.experiment_type.to_numpy()))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:23:24.468785Z","iopub.execute_input":"2023-10-27T11:23:24.469338Z","iopub.status.idle":"2023-10-27T11:23:27.233427Z","shell.execute_reply.started":"2023-10-27T11:23:24.469296Z","shell.execute_reply":"2023-10-27T11:23:27.232091Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Reactivity 2A3:","metadata":{}},{"cell_type":"code","source":"reactivity_2A3_MaP = train_data.loc[train_data.experiment_type == '2A3_MaP'][reactivity_cols].to_numpy()\nreactivity_2A3_MaP = np.concatenate(reactivity_2A3_MaP)\nreactivity_2A3_MaP = reactivity_2A3_MaP[~np.isnan(reactivity_2A3_MaP)]\nprint(len(reactivity_2A3_MaP))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:26:26.966944Z","iopub.execute_input":"2023-10-27T11:26:26.967471Z","iopub.status.idle":"2023-10-27T11:26:31.432311Z","shell.execute_reply.started":"2023-10-27T11:26:26.967433Z","shell.execute_reply":"2023-10-27T11:26:31.431093Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Reactivity DMS:","metadata":{}},{"cell_type":"code","source":"reactivity_DMS_MaP = train_data.loc[train_data.experiment_type == 'DMS_MaP'][reactivity_cols].to_numpy()\nreactivity_DMS_MaP = np.concatenate(reactivity_DMS_MaP)\nreactivity_DMS_MaP = reactivity_DMS_MaP[~np.isnan(reactivity_DMS_MaP)]\nprint(len(reactivity_DMS_MaP))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:26:49.421700Z","iopub.execute_input":"2023-10-27T11:26:49.422171Z","iopub.status.idle":"2023-10-27T11:26:53.746370Z","shell.execute_reply.started":"2023-10-27T11:26:49.422137Z","shell.execute_reply":"2023-10-27T11:26:53.744944Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"We can see that they are not even equal in length, and obviusly not equal. For example:\n","metadata":{}},{"cell_type":"code","source":"reactivity_2A3_MaP[:10] == reactivity_DMS_MaP[:10]","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:28:26.228671Z","iopub.execute_input":"2023-10-27T11:28:26.229262Z","iopub.status.idle":"2023-10-27T11:28:26.238608Z","shell.execute_reply.started":"2023-10-27T11:28:26.229222Z","shell.execute_reply":"2023-10-27T11:28:26.237219Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Error 2A3:","metadata":{}},{"cell_type":"code","source":"error_2A3_MaP = train_data.loc[train_data.experiment_type == '2A3_MaP'][error_cols].to_numpy()\nerror_2A3_MaP = np.concatenate(error_2A3_MaP)\nerror_2A3_MaP = error_2A3_MaP[~np.isnan(error_2A3_MaP)]\nprint(len(error_2A3_MaP))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:29:16.268086Z","iopub.execute_input":"2023-10-27T11:29:16.269268Z","iopub.status.idle":"2023-10-27T11:29:21.218560Z","shell.execute_reply.started":"2023-10-27T11:29:16.269215Z","shell.execute_reply":"2023-10-27T11:29:21.217284Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Error DMS:","metadata":{}},{"cell_type":"code","source":"error_DMS_MaP = train_data.loc[train_data.experiment_type == 'DMS_MaP'][error_cols].to_numpy()\nerror_DMS_MaP = np.concatenate(error_DMS_MaP)\nerror_DMS_MaP = error_DMS_MaP[~np.isnan(error_DMS_MaP)]\nprint(len(error_DMS_MaP))","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:30:09.727599Z","iopub.execute_input":"2023-10-27T11:30:09.728211Z","iopub.status.idle":"2023-10-27T11:30:14.733292Z","shell.execute_reply.started":"2023-10-27T11:30:09.728167Z","shell.execute_reply":"2023-10-27T11:30:14.731549Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"They are the same length, and moreover, they are exactly equal: ","metadata":{}},{"cell_type":"code","source":"np.mean(error_2A3_MaP == error_DMS_MaP)","metadata":{"execution":{"iopub.status.busy":"2023-10-27T11:31:23.165097Z","iopub.execute_input":"2023-10-27T11:31:23.165576Z","iopub.status.idle":"2023-10-27T11:31:23.409661Z","shell.execute_reply.started":"2023-10-27T11:31:23.165540Z","shell.execute_reply":"2023-10-27T11:31:23.408101Z"},"trusted":true},"execution_count":null,"outputs":[]}]}