{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":41875,"databundleVersionId":5521661,"sourceType":"competition"},{"sourceId":8100208,"sourceType":"datasetVersion","datasetId":4783430},{"sourceId":8123541,"sourceType":"datasetVersion","datasetId":4800439},{"sourceId":8125388,"sourceType":"datasetVersion","datasetId":4801879}],"dockerImageVersionId":30684,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-04-15T12:00:59.218441Z","iopub.execute_input":"2024-04-15T12:00:59.218826Z","iopub.status.idle":"2024-04-15T12:00:59.244053Z","shell.execute_reply.started":"2024-04-15T12:00:59.21877Z","shell.execute_reply":"2024-04-15T12:00:59.243181Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"cc = np.load('/kaggle/input/cc-dualnetgo/cc_DualNetGO_scores.npy')\nGO_terms = pd.read_csv('/kaggle/input/go-terms/cc-test.csv').columns.values[2:2+cc.shape[1]]\nquery_id = np.load(\"/kaggle/input/query-ids/query_id.npy\",allow_pickle=True)","metadata":{"execution":{"iopub.status.busy":"2024-04-15T11:42:32.5835Z","iopub.execute_input":"2024-04-15T11:42:32.583973Z","iopub.status.idle":"2024-04-15T11:42:32.800968Z","shell.execute_reply.started":"2024-04-15T11:42:32.583929Z","shell.execute_reply":"2024-04-15T11:42:32.799689Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"df_result = pd.DataFrame(cc, columns=GO_terms)\ndf_result['id'] = query_id\ndfm = df_result.melt(id_vars='id',value_vars=GO_terms,ignore_index=True)\ndfm.to_csv('/kaggle/working/cc_DualNetGO_scores.tsv', index=False, sep='\\t', header=None)\nos.system('cp /kaggle/input/cafa-5-protein-function-prediction/sample_submission.tsv /kaggle/working/sample_submission.tsv')\n","metadata":{"execution":{"iopub.status.busy":"2024-04-15T11:42:32.802391Z","iopub.execute_input":"2024-04-15T11:42:32.802815Z","iopub.status.idle":"2024-04-15T11:44:27.359189Z","shell.execute_reply.started":"2024-04-15T11:42:32.802786Z","shell.execute_reply":"2024-04-15T11:44:27.357834Z"},"trusted":true},"execution_count":null,"outputs":[]}]}