{"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 pandas as pd\nimport numpy as np\nimport collections","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-09-28T19:18:21.053923Z","iopub.execute_input":"2023-09-28T19:18:21.054338Z","iopub.status.idle":"2023-09-28T19:18:21.058966Z","shell.execute_reply.started":"2023-09-28T19:18:21.054308Z","shell.execute_reply":"2023-09-28T19:18:21.058121Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = pd.read_csv('../input/stanford-ribonanza-rna-folding/train_data.csv')","metadata":{"execution":{"iopub.status.busy":"2023-09-28T19:18:21.063243Z","iopub.execute_input":"2023-09-28T19:18:21.063568Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train = train[train[\"experiment_type\"]== \"DMS_MaP\"] # only removing duplicates, because every sequence is in there twice","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"count_agcu = pd.DataFrame(train[\"sequence\"].apply(lambda x: dict(collections.Counter(x).most_common())).tolist())\ncount_agcu","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# total len of all seq in train\ncount_agcu.sum().sum()","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"print(\"total count\")\nprint(count_agcu.sum())\nprint(\"ratio\")\nprint(count_agcu.sum()/count_agcu.sum().sum())","metadata":{"trusted":true},"execution_count":null,"outputs":[]}]}