{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceType":"competition","sourceId":118765,"databundleVersionId":16320058},{"sourceType":"datasetVersion","sourceId":15547929,"datasetId":9947354,"databundleVersionId":16476993},{"sourceType":"datasetVersion","sourceId":15548425,"datasetId":9947636,"databundleVersionId":16477514},{"sourceType":"datasetVersion","sourceId":15531080,"datasetId":9936502,"databundleVersionId":16458773},{"sourceType":"datasetVersion","sourceId":10855324,"datasetId":6742586,"databundleVersionId":11219268},{"sourceType":"kernelVersion","sourceId":305681400}],"dockerImageVersionId":31259,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"### This notebook is part of the 3rd place solution for the Stanford RNA 3D Folding Part 2 competition. This code was executed locally, not on Kaggle.","metadata":{}},{"cell_type":"code","source":"import os\nimport sys\nimport shutil\nsys.version","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-08T20:49:39.529446Z","iopub.execute_input":"2026-04-08T20:49:39.529668Z","iopub.status.idle":"2026-04-08T20:49:39.540237Z","shell.execute_reply.started":"2026-04-08T20:49:39.529649Z","shell.execute_reply":"2026-04-08T20:49:39.539617Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"shutil.copy2('/kaggle/input/usalign/USalign', '/kaggle/working/USalign')\nos.chmod('/kaggle/working/USalign', 0o755)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-08T20:49:39.541738Z","iopub.execute_input":"2026-04-08T20:49:39.541976Z","iopub.status.idle":"2026-04-08T20:49:39.6209Z","shell.execute_reply.started":"2026-04-08T20:49:39.541959Z","shell.execute_reply":"2026-04-08T20:49:39.620019Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!mkdir ~/python-packages\n!cp -r /kaggle/input/datasets/stefanstefanov/srna3d2-rnapro-tbm ~/python-packages/srna3d2-rnapro-tbm","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-08T20:49:39.621756Z","iopub.execute_input":"2026-04-08T20:49:39.62204Z","iopub.status.idle":"2026-04-08T20:49:40.30583Z","shell.execute_reply.started":"2026-04-08T20:49:39.622013Z","shell.execute_reply":"2026-04-08T20:49:40.305015Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"for local_package_name in ['srna3d2-rnapro-tbm']:\n    local_package_path = os.path.expanduser(f'~/python-packages/{local_package_name}')\n    os.environ['PYTHONPATH'] = os.environ.get('PYTHONPATH', '') + os.pathsep + local_package_path\n    sys.path.append(local_package_path)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-08T20:49:40.306864Z","iopub.execute_input":"2026-04-08T20:49:40.307077Z","iopub.status.idle":"2026-04-08T20:49:40.310932Z","shell.execute_reply.started":"2026-04-08T20:49:40.307049Z","shell.execute_reply":"2026-04-08T20:49:40.310382Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"!python -m srna3d.scripts.create_tmscore_dataset \\\n    --train_sequences_csv_path /kaggle/input/stanford-rna-3d-folding-2/train_sequences.csv \\\n    --train_labels_csv_path /kaggle/input/stanford-rna-3d-folding-2/train_labels.csv \\\n    --train_embeddings_path /kaggle/input/datasets/stefanstefanov/srna3d2-train-text-embeddings/train_text_embeddings.safetensors \\\n    --usalign_path /kaggle/working/USalign \\\n    --seed 579 \\\n    --n_jobs 4 \\\n    --output_dir /kaggle/working/tm_score_dataset","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-08T20:49:40.312259Z","iopub.execute_input":"2026-04-08T20:49:40.312463Z","iopub.status.idle":"2026-04-08T20:50:48.099395Z","shell.execute_reply.started":"2026-04-08T20:49:40.312445Z","shell.execute_reply":"2026-04-08T20:50:48.09871Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"from srna3d.scripts.create_tmscore_dataset import combine_and_save_dataset\n\ntm_score_dataset_dir = '/kaggle/working/tm_score_dataset'\n\ncombine_and_save_dataset(\n    template_matches_pkl_path=os.path.join(tm_score_dataset_dir, 'template_matches.pkl'),\n    tm_scores_csv_path=os.path.join(tm_score_dataset_dir, 'tm_scores.csv'),\n    tm_score_dataset_output_path=os.path.join(tm_score_dataset_dir, 'tm_score_dataset.csv')\n)","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}