{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# SimpleMetrics的API查询" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "上一节我们对不同类型的Metrics进行了举例说明,这一节将列出**PerResidueRealMetrics, RealMetric,StringMetric, 和CompositeRealMetrics** 所有API的使用方式。" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PyRosetta-4 2021 [Rosetta PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release 2021.31+release.c7009b3115c22daa9efe2805d9d1ebba08426a54 2021-08-07T10:04:12] retrieved from: http://www.pyrosetta.org\n", "(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.\n", "\u001b[0mcore.init: {0} \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n", "\u001b[0mcore.init: {0} \u001b[0mRosetta version: PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release r292 2021.31+release.c7009b3115c c7009b3115c22daa9efe2805d9d1ebba08426a54 http://www.pyrosetta.org 2021-08-07T10:04:12\n", "\u001b[0mcore.init: {0} \u001b[0mcommand: PyRosetta -ex1 -ex2aro -database /opt/miniconda3/lib/python3.7/site-packages/pyrosetta/database\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=2119001967 seed_offset=0 real_seed=2119001967 thread_index=0\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0mRandomGenerator:init: Normal mode, seed=2119001967 RG_type=mt19937\n", "\u001b[0mcore.chemical.GlobalResidueTypeSet: {0} \u001b[0mFinished initializing fa_standard residue type set. Created 983 residue types\n", "\u001b[0mcore.chemical.GlobalResidueTypeSet: {0} \u001b[0mTotal time to initialize 0.695078 seconds.\n", "\u001b[0mcore.import_pose.import_pose: {0} \u001b[0mFile './data/6LZ9_H_L.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 21 94\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 21 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 94 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 21 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 94 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 141 206\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 141 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 206 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 141 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 206 CYD\n", "\u001b[0mcore.import_pose.import_pose: {0} \u001b[0mFile './data/3K2U_H_L.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OXT on residue THR:CtermProteinFull 121\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OXT on residue ARG:CtermProteinFull 229\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 22 96\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 22 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 96 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 22 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 96 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 144 209\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 144 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 209 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 144 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 209 CYD\n" ] } ], "source": [ "#加载与SimpleMetrics调用有关的class.\n", "from pyrosetta import pose_from_pdb, init\n", "from pyrosetta.rosetta.core.simple_metrics.metrics import *\n", "from pyrosetta.rosetta.core.simple_metrics.per_residue_metrics import *\n", "from pyrosetta.rosetta.core.simple_metrics.composite_metrics import *\n", "from pyrosetta.rosetta.core.simple_metrics import *\n", "init()\n", "pose = pose_from_pdb('./data/6LZ9_H_L.pdb')\n", "ref_pose = pose_from_pdb('./data/3K2U_H_L.pdb')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. PerResidueRealMetrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.1 HbondMetric\n", "计算一个selector或者两个selector间每个残基的氢键数量。" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBPoly1D.csv\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBFadeIntervals.csv\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBEval.csv\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/DonStrength.csv\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/AccStrength.csv\n" ] } ], "source": [ "#example1 计算一个selector上每个残基的氢键数量\n", "from pyrosetta.rosetta.core.select.residue_selector import ResidueIndexSelector\n", "hbond = HbondMetric()\n", "hbond_selector = ResidueIndexSelector('67H-71H')\n", "hbond.set_residue_selector(hbond_selector)\n", "hbond.apply(pose,'one_selector_')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "map_unsigned_long_double{66: 1, 67: 2, 68: 0, 69: 2, 70: 2}" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "per_real_metric = sm_data.get_per_residue_real_metric_data()\n", "per_real_metric['one_selector_hbonds']" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "#example2 计算两个selector间每个残基的氢键数量\n", "hbond = HbondMetric()\n", "hbond_selector = ResidueIndexSelector('67H-71H')\n", "hbond_selector2 = ResidueIndexSelector('78H-82H')\n", "hbond.set_residue_selector(hbond_selector)\n", "hbond.set_residue_selector2(hbond_selector2)\n", "hbond.apply(pose,'two_selector_')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "map_unsigned_long_double{66: 0, 67: 2, 68: 0, 69: 2, 70: 0}" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "per_real_metric = sm_data.get_per_residue_real_metric_data()\n", "per_real_metric['two_selector_hbonds']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.2 WaterMediatedHbondMetric\n", "分析选择残基水介导的氢键情况。" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PyRosetta-4 2021 [Rosetta PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release 2021.31+release.c7009b3115c22daa9efe2805d9d1ebba08426a54 2021-08-07T10:04:12] retrieved from: http://www.pyrosetta.org\n", "(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.\n", "\u001b[0mcore.init: {0} \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n", "\u001b[0mcore.init: {0} \u001b[0mRosetta version: PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release r292 2021.31+release.c7009b3115c c7009b3115c22daa9efe2805d9d1ebba08426a54 http://www.pyrosetta.org 2021-08-07T10:04:12\n", "\u001b[0mcore.init: {0} \u001b[0mcommand: PyRosetta -ignore_waters false -database /opt/miniconda3/lib/python3.7/site-packages/pyrosetta/database\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=-1568603508 seed_offset=0 real_seed=-1568603508 thread_index=0\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0mRandomGenerator:init: Normal mode, seed=-1568603508 RG_type=mt19937\n", "\u001b[0mcore.import_pose.import_pose: {0} \u001b[0mFile './data/4r80.pdb' automatically determined to be of type PDB\n" ] } ], "source": [ "from pyrosetta.rosetta.core.select.residue_selector import TrueResidueSelector\n", "init('-ignore_waters false') # 初始化时不能把水自动处理掉了!\n", "wmh_pose = pose_from_pdb('./data/4r80.pdb')\n", "wmh_selector = TrueResidueSelector()\n", "wm_hbond = WaterMediatedHbondMetric()\n", "wm_hbond.set_residue_selector(wmh_selector)\n", "wm_hbond.set_depth(1) #介导氢键的水分子数量,默认是1个水分子\n", "wm_hbond.set_include_only_set_depth(False) #是否仅包括指定的depth。True包括指定的depth个水分子,False包括1-depth个水分子。\n", "wm_hbond.apply(pose)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "map_unsigned_long_double{1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0, 10: 0, 11: 0, 12: 0, 13: 0, 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0, 21: 0, 22: 0, 23: 0, 24: 0, 25: 0, 26: 0, 27: 0, 28: 0, 29: 0, 30: 0, 31: 0, 32: 0, 33: 0, 34: 0, 35: 0, 36: 0, 37: 0, 38: 0, 39: 0, 40: 0, 41: 0, 42: 0, 43: 0, 44: 0, 45: 0, 46: 0, 47: 0, 48: 0, 49: 0, 50: 0, 51: 0, 52: 0, 53: 0, 54: 0, 55: 0, 56: 0, 57: 0, 58: 0, 59: 0, 60: 0, 61: 0, 62: 0, 63: 0, 64: 0, 65: 0, 66: 0, 67: 0, 68: 0, 69: 0, 70: 0, 71: 0, 72: 0, 73: 0, 74: 0, 75: 0, 76: 0, 77: 0, 78: 0, 79: 0, 80: 0, 81: 0, 82: 0, 83: 0, 84: 0, 85: 0, 86: 0, 87: 0, 88: 0, 89: 0, 90: 0, 91: 0, 92: 0, 93: 0, 94: 0, 95: 0, 96: 0, 97: 0, 98: 0, 99: 0, 100: 0, 101: 0, 102: 0, 103: 0, 104: 0, 105: 0, 106: 0, 107: 0, 108: 0, 109: 0, 110: 0, 111: 0, 112: 0, 113: 0, 114: 0, 115: 0, 116: 0, 117: 0, 118: 0, 119: 0, 120: 0, 121: 0, 122: 0, 123: 0, 124: 0, 125: 0, 126: 0, 127: 0, 128: 0, 129: 0, 130: 0, 131: 0, 132: 0, 133: 0, 134: 0, 135: 0, 136: 0, 137: 0, 138: 0, 139: 0, 140: 0, 141: 0, 142: 0, 143: 0, 144: 0, 145: 0, 146: 0, 147: 0, 148: 0, 149: 0, 150: 0, 151: 0, 152: 0, 153: 0, 154: 0, 155: 0, 156: 0, 157: 0, 158: 0, 159: 0, 160: 0, 161: 0, 162: 0, 163: 0, 164: 0, 165: 0, 166: 0, 167: 0, 168: 0, 169: 0, 170: 0, 171: 0, 172: 0, 173: 0, 174: 0, 175: 0, 176: 0, 177: 0, 178: 0, 179: 0, 180: 0, 181: 0, 182: 0, 183: 0, 184: 0, 185: 0, 186: 0, 187: 0, 188: 0, 189: 0, 190: 0, 191: 0, 192: 0, 193: 0, 194: 0, 195: 0, 196: 0, 197: 0, 198: 0, 199: 0, 200: 0, 201: 0, 202: 0, 203: 0, 204: 0, 205: 0, 206: 0, 207: 0, 208: 0, 209: 0, 210: 0, 211: 0, 212: 0, 213: 0, 214: 0, 215: 0, 216: 0, 217: 0, 218: 0, 219: 0, 220: 0, 221: 0, 222: 0, 223: 0}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 没有显示水介导的氢键\n", "per_real_metric = sm_data.get_per_residue_real_metric_data()\n", "per_real_metric['water_mediated_hbonds']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[bug] 此Metrics截止在2021.07之前,有问题,不会输出数量。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.3 PerResidueClashMetric\n", "通过每个原子的兰纳-琼斯半径计算两个selector之间原子冲突数量,默认使用软核,LJ势减少33%。" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.scoring.etable: {0} \u001b[0mStarting energy table calculation\n", "\u001b[0mcore.scoring.etable: {0} \u001b[0msmooth_etable: changing atr/rep split to bottom of energy well\n", "\u001b[0mcore.scoring.etable: {0} \u001b[0msmooth_etable: spline smoothing lj etables (maxdis = 6)\n", "\u001b[0mcore.scoring.etable: {0} \u001b[0msmooth_etable: spline smoothing solvation etables (max_dis = 6)\n", "\u001b[0mcore.scoring.etable: {0} \u001b[0mFinished calculating energy tables.\n", "\u001b[0mcore.simple_metrics.per_residue_metrics.PerResidueClashMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ################ Cloning pose and Scoring! ##############################\n", "\u001b[0mcore.simple_metrics.per_residue_metrics.PerResidueClashMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Ensure that pose is scored\n", "\u001b[0mcore.simple_metrics.per_residue_metrics.PerResidueClashMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m before PerResidueClashMetric for maximum performance!\n", "\u001b[0mcore.simple_metrics.per_residue_metrics.PerResidueClashMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ##########################################################################\n", "\u001b[0mcore.simple_metrics.per_residue_metrics.PerResidueClashMetric: {0} \u001b[0mBonded: atomno= 3 rsd= 24 : atomno= 1 rsd= 25\n" ] } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics.per_residue_metrics import *\n", "inner_selector = ResidueIndexSelector('18-24')\n", "outer_selector = ResidueIndexSelector('25-30')\n", "clash_num = PerResidueClashMetric(inner_selector,outer_selector)\n", "clash_num.set_use_soft_clash(True) # True代表根据原子间距离小于(atomI_LJ + atomJ_LJ)*(1 - dampening_percent)判断冲突。\n", "clash_num.set_soft_dampening(0.01) # 设置dampening_percent 默认0.33\n", "clash_num.set_use_hydrogens(False) #True为默认,仅通过重原子判断冲突,False通过氢原子判断冲突 \n", "clash_num.apply(pose,'per_resid_')" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "map_unsigned_long_double{18: 0, 19: 0, 20: 0, 21: 0, 22: 0, 23: 2, 24: 7}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "per_real_metric = sm_data.get_per_residue_real_metric_data()\n", "per_real_metric['per_resid_atomic_clashes']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.4 PerResidueRMSDMetric\n", "计算两个selector中两段指定残基的每个残基的RMSD值。主selector与ref_selector中原子数目必须相等。<br />\n", "type: [rmsd_all, rmsd_all_heavy, rmsd_protein_bb_ca, rmsd_protein_bb_heavy, rmsd_protein_bb_heavy_including_O, rmsd_sc, rmsd_sc_heavy]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "#计算两个selector的两段指定残基的RMSD\n", "from pyrosetta.rosetta.core.simple_metrics.per_residue_metrics import *\n", "from pyrosetta.rosetta.core.scoring import rmsd_atoms\n", "rmsd_type = rmsd_atoms.rmsd_protein_bb_ca\n", "per_residue_rmsd = PerResidueRMSDMetric()\n", "range_selector = ResidueIndexSelector('46H-50H')\n", "range_selector2 = ResidueIndexSelector('62L-66L')\n", "per_residue_rmsd.set_residue_selector(range_selector) #只计算子集\n", "per_residue_rmsd.set_residue_selector_reference(range_selector2) #只计算子集\n", "per_residue_rmsd.set_comparison_pose(ref_pose)\n", "per_residue_rmsd.set_rmsd_type(rmsd_atoms.rmsd_protein_bb_ca) #CA only\n", "per_residue_rmsd.set_desymmetrize_residue_selector(True) #是否去对称化,默认为True\n", "per_residue_rmsd.apply(pose,'per_')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "map_unsigned_long_double{45: 114.144, 46: 113.949, 47: 113.95, 48: 114.177, 49: 110.526}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "per_real_metric = sm_data.get_per_residue_real_metric_data()\n", "per_real_metric['per_res_rmsd']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1.5 PerResidueDensityFitMetric\n", "计算一个模型与加载的电子密度的相关性或者Z-score." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "#fit_density = PerResidueDensityFitMetric()\n", "#fit_density.set_match_mode(0) # 0=zscore 1=density correlation 默认0\n", "#fit_density.set_residue_selector(range_selector) #选取部分进行计算\n", "#fit_density.set_sliding_window_size(3)\n", "#fit_density.set_mixed_sliding_window(1) #设置混合窗口 3 for protein, 1 for everything else。可能使得结果有偏向性。\n", "#fit_density.apply(pose,'prefix')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. RealMetrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.1 RMSDMetric\n", "计算两个selector组分之间的RMSD值。 目前支持的type有\n", "- rmsd_all\n", "- rmsd_all_heavy\n", "- rmsd_protein_bb_ca\n", "- rmsd_protein_bb_heavy\n", "- rmsd_protein_bb_heavy_including_O\n", "- rmsd_sc\n", "- rmsd_sc_heavy\n", "\n", "默认为rmsd_all" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "<center><img src=\"./img/6LZ9_rmsd.png\" width = \"400\" height = \"300\" align=center /> </center>\n", "(图片来源: 晶泰科技团队)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "#计算图中两个selector主链CA的RMSD\n", "from pyrosetta.rosetta.core.select.residue_selector import ResidueIndexSelector\n", "from pyrosetta.rosetta.core.scoring import rmsd_atoms\n", "range_selector = ResidueIndexSelector('46H-50H')\n", "range_selector2 = ResidueIndexSelector('62L-66L')\n", "rmsd = RMSDMetric(pose)\n", "rmsd.set_residue_selector(range_selector)\n", "rmsd.set_residue_selector_reference(range_selector2)\n", "rmsd.set_rmsd_type(rmsd_atoms.rmsd_protein_bb_ca) #指定具体的某项RMSD.\n", "rmsd.apply(pose,'two_sel_')" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "25.169509903849935" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "real_metric = sm_data.get_real_metric_data()\n", "real_metric['two_sel_rmsd']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.2 TotalEnergyMetric\n", "计算总能量的变化,或者计算系统的总能。 如果设置了set_comparison_pose,那么就会计算两个pose指定残基的总能量差。" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/all.ramaProb\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/prepro.ramaProb\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.all.txt\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.gly.txt\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.pro.txt\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.valile.txt\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA_n\n", "\u001b[0mcore.scoring.P_AA: {0} \u001b[0mshapovalov_lib::shap_p_aa_pp_smooth_level of 1( aka low_smooth ) got activated.\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/shapovalov/10deg/kappa131/a20.prop\n", "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/elec_cp_reps.dat\n", "\u001b[0mcore.scoring.elec.util: {0} \u001b[0mRead 40 countpair representative atoms\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: {0} \u001b[0mshapovalov_lib_fixes_enable option is true.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: {0} \u001b[0mshapovalov_lib::shap_dun10_smooth_level of 1( aka lowest_smooth ) got activated.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: {0} \u001b[0mBinary rotamer library selected: /opt/miniconda3/lib/python3.7/site-packages/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: {0} \u001b[0mUsing Dunbrack library binary file '/opt/miniconda3/lib/python3.7/site-packages/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin'.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: {0} \u001b[0mDunbrack 2010 library took 0.18398 seconds to load from binary\n" ] } ], "source": [ "# 计算两个pose的H链的能量差\n", "from pyrosetta.rosetta.core.select.residue_selector import ResidueIndexSelector, ChainSelector\n", "from pyrosetta import create_score_function\n", "select_heavy_chain = ChainSelector('H')\n", "total_energy = TotalEnergyMetric()\n", "total_energy.set_residue_selector(select_heavy_chain)\n", "scorefxn = create_score_function('ref2015')\n", "total_energy.set_scorefunction(scorefxn)\n", "total_energy.set_comparison_pose(ref_pose) #不指定则只计算pose的总能量\n", "total_energy.apply(pose,'two_pose_H_')" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "98.51662779368385" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "real_metric = sm_data.get_real_metric_data()\n", "real_metric['two_pose_H_total_energy']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.3 SequenceSimilarityMetric\n", "计算pose和参考序列之间的相似性。根据BLOSUM62矩阵计算每个位置。 如果normalize设置了,那么将BLOSUM62 scores/position num.进行标准化。" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSetting LayerSelector to use sidechain neighbors to determine burial.\n", "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSet cutoffs for core and surface to 5.2 and 2, respectively, in LayerSelector.\n", "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSetting core=true boundary=false surface=false in LayerSelector.\n", "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSetting LayerSelector to use rolling ball-based occlusion to determine burial.\n", "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSet cutoffs for core and surface to 20 and 40, respectively, in LayerSelector.\n", "\u001b[0mcore.select.residue_selector.LayerSelector: {0} \u001b[0mSetting radius for rolling ball algorithm to 2 in LayerSelector. (Note that this will have no effect if the sidechain neighbors method is used.)\n" ] } ], "source": [ "#选择内核层残基(SASA法)\n", "from pyrosetta.rosetta.core.select.residue_selector import LayerSelector\n", "layer_selector = LayerSelector()\n", "layer_selector.set_layers(True, False, False) # 只选择内核的设置方法\n", "layer_selector.set_use_sc_neighbors(False) # 使用Sidechain neighbor算法,否则使用SASA-based算法,确定内核残基。\n", "layer_selector.set_cutoffs(20.0, 40.0) # 内核,表层截断半径设置\n", "layer_selector.set_ball_radius(2.0) # 传统值为1.4" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "seq_similar = SequenceSimilarityMetric()\n", "seq_similar.set_residue_selector(layer_selector)\n", "seq_similar.set_native_pose(ref_pose)\n", "seq_similar.set_apply_selector_to_native(True) #是否将选择的残基用于native_pose 默认:False\n", "seq_similar.set_normalize(True) # 是否标准化处理,默认为True(即:标准化处理)\n", "seq_similar.apply(pose,'core_layer_')" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-1.2407407407407407" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "real_metric = sm_data.get_real_metric_data()\n", "real_metric['core_layer_sequence_similarity']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.4 SequenceRecoveryMetric" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "计算两个pose的序列上与原序列的恢复率。有4种比对模式: \n", "- Standard: set_comparison_pose() \n", "- Pass/Fail: load_pssm \n", "- PSSM/Ave: load_pssm、use_ave_pssm() \n", "- PSSM/Delta load_pssm、use_ave_pssm()、set_comparison_pose()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mprotocols.analysis.simple_metrics.SequenceRecoveryMetric: {0} \u001b[0mCalculating sequence metric using the Standard settings.\n" ] } ], "source": [ "from pyrosetta.rosetta.protocols.analysis.simple_metrics import *\n", "seq_recovery = SequenceRecoveryMetric()\n", "seq_recovery.set_comparison_pose(ref_pose)\n", "seq_recovery_selector = ResidueIndexSelector('5H-30H')\n", "seq_recovery_selector_ref = ResidueIndexSelector('55H-80H')\n", "seq_recovery.set_residue_selector(seq_recovery_selector)\n", "seq_recovery.set_residue_selector_ref(seq_recovery_selector_ref)\n", "#seq_recovery.load_pssm(pssm_file) #额外设置\n", "seq_recovery.set_use_ave_pssm(True) #是否使用ave_pssm\n", "seq_recovery.apply(pose,'two_pose_')" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.038461538461538464" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "real_metric = sm_data.get_real_metric_data()\n", "real_metric['two_pose_seqrec']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.5 DihedralDistanceMetric\n", "计算两个pose或一个pose中两个区域的二面角之间的标准化距离。(degrees为单位),可以理解为构象相似性大小。" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "#example1 计算一个pose中两个区域的二面角之间的标准化距离\n", "from pyrosetta.rosetta.core.select.residue_selector import ResidueIndexSelector\n", "dd_selector = ResidueIndexSelector('18H-24H')\n", "dd_selector2 = ResidueIndexSelector('58H-64H')\n", "dihedral_distance = DihedralDistanceMetric()\n", "dihedral_distance.set_comparison_pose(pose)\n", "dihedral_distance.set_include_protein_omega(False) #是否包含omega角\n", "dihedral_distance.set_residue_selector(dd_selector)\n", "dihedral_distance.set_residue_selector_reference(dd_selector2)\n", "dihedral_distance.apply(pose, 'one_pose_')" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "70.54020894906083" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "real_metric = sm_data.get_real_metric_data()\n", "real_metric['one_pose_dihedral_distance']" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "#example2 计算两个pose中两个区域的二面角之间的标准化距离\n", "from pyrosetta.rosetta.core.select.residue_selector import ResidueIndexSelector\n", "dd_selector = ResidueIndexSelector('18H-24H')\n", "dd_selector2 = ResidueIndexSelector('58H-64H')\n", "dihedral_distance = DihedralDistanceMetric()\n", "dihedral_distance.set_comparison_pose(ref_pose)\n", "dihedral_distance.set_include_protein_omega(False) #是否包含omega角\n", "dihedral_distance.set_residue_selector(dd_selector)\n", "dihedral_distance.set_residue_selector_reference(dd_selector2)\n", "dihedral_distance.apply(pose, 'two_pose_')" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "64.26955898015767" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "real_metric = sm_data.get_real_metric_data()\n", "real_metric['two_pose_dihedral_distance']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**结果解读** <br />\n", "数值越小说明两个区域的残基结构越相似。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2.6 InteractionEnergyMetric\n", "计算selector与其余残基或selector与另一个selector之间的长程或短程相互作用的能量。可以设置为只计算短程、长程、或则某一项相互作用的能量。 相互作用选项:/fa_atr/fa_rep/fa_sol/fa_elec/lk_ball_wtd/hbond_bb_sc/hbond_sc,此外rama_prepro和proclose能量项可选。" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "vector1_bool[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]\n" ] } ], "source": [ "range_selector3 = ResidueIndexSelector('25H-30H')\n", "residue_selector3 = range_selector3.apply(pose)\n", "print(residue_selector3)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.scoring.ScoreFunctionFactory: {0} \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ################ Cloning pose and Scoring! ##############################\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Ensure that pose is scored\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m before using InteractionEnergyMetric for maximum performance!\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ##########################################################################\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mfa_rep 0.55\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mUnweighted: 3.05322\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mWeighted: 1.67927\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mfa_sol 1\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mUnweighted: -1.38561\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mWeighted: -1.38561\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mlk_ball_wtd 1\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mUnweighted: -0.202391\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mWeighted: -0.202391\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0m\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mfa_elec 1\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mUnweighted: 0.252937\n", "\u001b[0mcore.simple_metrics.metrics.InteractionEnergyMetric: {0} \u001b[0mWeighted: 0.252937\n" ] } ], "source": [ "#set_ignore_scoretypes传参需要一个vector1,因此我们需要额外创建一个vector1_core_scoring_ScoreType;\n", "from pyrosetta.rosetta.utility import vector1_core_scoring_ScoreType\n", "from pyrosetta.rosetta.core.scoring import fa_atr, fa_rep, fa_elec\n", "from pyrosetta import create_score_function\n", "ie_selector = ResidueIndexSelector('18H-24H')\n", "ie_selector2 = ResidueIndexSelector('25H-30H')\n", "\n", "vector1 = vector1_core_scoring_ScoreType()\n", "vector1.append(fa_atr)\n", "interaction_energy = InteractionEnergyMetric(ie_selector, ie_selector2)\n", "scorefxn = create_score_function('ref2015') #默认ref2015\n", "interaction_energy.set_scorefunction(scorefxn) \n", "interaction_energy.set_include_rama_prepro_and_proclose(False) #是否包括rama_prepro和proclose能量项\n", "interaction_energy.set_ignore_scoretypes(vector1) #用于忽略某项能量项\n", "#interaction_energy.set_include_only_scoretypes(vector1) #只包括某项能量,但有些问题!!\n", "interaction_energy.apply(pose, 'two_selectors_')" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.34420423407252454" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "real_metric = sm_data.get_real_metric_data()\n", "real_metric['two_selectors_interaction_energy']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. StringMetrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.1 SequenceMetric\n", "返回序列的氨基酸缩写。 Mode= oneletter, threeletter, basename, or fullname." ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "seq_AA_selector = ResidueIndexSelector('1L-20L')\n", "seq_AA = SequenceMetric(seq_AA_selector)\n", "seq_AA.set_output_mode('fullname')\n", "prefix = 'seq_AA_'\n", "seq_AA.apply(pose, prefix)" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'ASP:NtermProteinFull,ILE,GLN,MET,THR,GLN,THR,THR,SER,SER,LEU,SER,ALA,SER,LEU,GLY,ASP,ARG,VAL,THR,'" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "string_metric = sm_data.get_string_metric_data()\n", "string_metric['seq_AA_sequence']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.2 SecondaryStructureMetric\n", "返回每个氨基酸的DSSP二级结构的定义,H:螺旋 E:折叠 L:loop" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "select_heavy_chain = ChainSelector('H')\n", "dssp = SecondaryStructureMetric(select_heavy_chain)\n", "dssp.set_use_dssp_reduced(True) #是否使用简化的DSSP字母,默认为True\n", "dssp.apply(pose,'H_')" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'LEEEELLLLELLLLLLEEEEEEEELLLHHHLLEEEEEELLLLLLEEEEEELLLLLEEELLLLHHHEEEEEELLLLEEEEEELLLLHHHLEEEEEEELLHHHHLLLLLLEELLLEEEEL'" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "string_metric = sm_data.get_string_metric_data()\n", "string_metric['H_secondary_structure']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.3 ResidueSummaryMetric\n", "ResidueSummaryMetric是基于PerResidueSasaMetric计算结果进行数据处理,具体的方式如下:<br />\n", "mean, n_res_eq, n_res_gt, n_res_gt_or_eq, n_res_lt, n_res_lt_or_eq, n_res_ne, sum。" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.simple_metrics.metrics.ResidueSummaryMetric: {0} \u001b[0mReturning the mean of the data\n" ] } ], "source": [ "resi_sum = ResidueSummaryMetric()\n", "resi_sum.set_action(mean)\n", "resi_sum.set_action_value(0) #基于一个值计算N个残基某个Metrics,默认是0\n", "resi_sum.set_epsilon(0.0001) #指定有效数字,尤其在action = n_res_eq or n_res_ne时,两者差的绝对值小于这个有效数字认为相等\n", "resi_sum.set_fail_on_missing_cache(True) #如果设置了use_cached_data但cache没有找到,此时是否fail\n", "resi_sum.set_metric(per_residue_rmsd) \n", "resi_sum.apply(pose,'pose_')" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "113.34897941753817" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "real_metric = sm_data.get_real_metric_data()\n", "real_metric['pose_res_summary']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.4 InteractionGraphSummaryMetric\n", "在第6章Rosetta Packer这一节已经讲过InteractionGraph。InteractionGraphSummaryMetric用于Task操作中,InteractionGraph的可读化,用于优化Rosetta的模拟退火。" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.import_pose.import_pose: {0} \u001b[0mFile './data/pose_demo.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OXT on residue SER:CtermProteinFull 12\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 2 11\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 2 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 11 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 2 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 11 CYD\n" ] } ], "source": [ "# 先设置task\n", "from pyrosetta.rosetta.core.pack.task import TaskFactory\n", "from pyrosetta.rosetta.core.pack.task.operation import InitializeFromCommandline, RestrictToRepacking\n", "pack_task = TaskFactory()\n", "pack_task.push_back(InitializeFromCommandline())\n", "pack_task.push_back(RestrictToRepacking())\n", "# 引入需要计算的pose\n", "demo_pose = pose_from_pdb('./data/pose_demo.pdb')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "<center><img src=\"./img/InteractionGraph.png\" width = \"400\" height = \"300\" align=center /> </center>\n", "(图片来源: 晶泰科技团队)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.pack.task: {0} \u001b[0mPacker task: initialize from command line()\n", "\u001b[0mcore.pack.pack_rotamers: {0} \u001b[0mbuilt 144 rotamers at 12 positions.\n", "\u001b[0mcore.pack.pack_rotamers: {0} \u001b[0mRequesting all available threads for interaction graph computation.\n", "\u001b[0mcore.pack.interaction_graph.interaction_graph_factory: {0} \u001b[0mInstantiating DensePDInteractionGraph\n", "\u001b[0mbasic.thread_manager.RosettaThreadManager: {?} \u001b[0mCreating a thread pool of 1 threads.\n", "\u001b[0mbasic.thread_manager.RosettaThreadPool: {?} \u001b[0mLaunched 0 new threads.\n", "\u001b[0mcore.pack.rotamer_set.RotamerSets: {0} \u001b[0mCompleted interaction graph pre-calculation in 1 available threads (1 had been requested).\n" ] } ], "source": [ "from pyrosetta.rosetta.protocols.quantum_annealing import *\n", "interaction_graph = InteractionGraphSummaryMetric()\n", "scorefxn = create_score_function('ref2015') \n", "interaction_graph.set_scorefunction(scorefxn)\n", "interaction_graph.set_short_version(True) #是否简短的输出结果\n", "interaction_graph.set_task_factory(pack_task)\n", "interaction_graph.apply(demo_pose,'prefix')" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(demo_pose)\n", "string_metric = sm_data.get_string_metric_data()\n", "# print(string_metric) 输出很长,需要时在启用!!!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**结果解读** <br />\n", "[BEGIN ONEBODY SEQPOS/ROTINDEX/ENERGY] 这里ONEBODY指单个残基的Rotamer,SEQPOS/ROTINDEX/ENERGY对应的是残基序列、Rotamer序列和相应的能量。<br />\n", "[BEGIN TWOBODY SEQPOS1/ROTINDEX1/SEQPOS2/ROTINDEX2/ENERGY] 这里TWOBODY指两个残基的Rotamer组合,SEQPOS1/ROTINDEX1/\n", "SEQPOS2/ROTINDEX2/ENERGY对应的是残基序列1、残基序列1的Rotamer序列、残基序列2、残基序列2的Rotamer序列和这个组合的能量。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3.5 PolarGroupBurialPyMolStringMetric\n", "返回Pymol极性区域的着色命令.根据buried_unsatisfied_penalty打分并进行着色." ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "scrolled": true, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PyRosetta-4 2021 [Rosetta PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release 2021.31+release.c7009b3115c22daa9efe2805d9d1ebba08426a54 2021-08-07T10:04:12] retrieved from: http://www.pyrosetta.org\n", "(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.\n", "\u001b[0mcore.init: {0} \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n", "\u001b[0mcore.init: {0} \u001b[0mRosetta version: PyRosetta4.conda.mac.cxx11thread.serialization.python37.Release r292 2021.31+release.c7009b3115c c7009b3115c22daa9efe2805d9d1ebba08426a54 http://www.pyrosetta.org 2021-08-07T10:04:12\n", "\u001b[0mcore.init: {0} \u001b[0mcommand: PyRosetta -mute all -database /opt/miniconda3/lib/python3.7/site-packages/pyrosetta/database\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=-492439020 seed_offset=0 real_seed=-492439020 thread_index=0\n", "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0mRandomGenerator:init: Normal mode, seed=-492439020 RG_type=mt19937\n", "\u001b[0mcore.import_pose.import_pose: {0} \u001b[0mFile './data/6LZ9_H.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mFound disulfide between residues 21 94\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 21 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 94 CYS\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 21 CYD\n", "\u001b[0mcore.conformation.Conformation: {0} \u001b[0mcurrent variant for 94 CYD\n" ] } ], "source": [ "from pyrosetta.rosetta.protocols.analysis.burial_metrics import *\n", "init('-mute all') # 输出很长,mute省掉了吧\n", "h_pose = pose_from_pdb('./data/6LZ9_H.pdb')\n", "polar_metric = PolarGroupBurialPyMolStringMetric()\n", "polar_metric.set_scorefxn(scorefxn)\n", "polar_metric.set_verbose(True)\n", "prefix = 'pgb_'\n", "polar_metric.apply(h_pose, prefix)" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "'Pymol commands to colour the pose:;color grey;color cyan, resi 1 AND name O;color cyan, resi 1 AND name N+1H+2H+3H;color cyan, resi 2 AND name O;color cyan, resi 2 AND name OE1;color cyan, resi 2 AND name N+H;color cyan, resi 2 AND name NE2+1HE2+2HE2;color cyan, resi 3 AND name O;color cyan, resi 3 AND name N+H;color cyan, resi 4 AND name O;color cyan, resi 4 AND name N+H;color cyan, resi 4 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 5 AND name O;color cyan, resi 5 AND name OE1;color cyan, resi 5 AND name OE2;color cyan, resi 5 AND name N+H;color cyan, resi 6 AND name O;color cyan, resi 6 AND name OG+HG;color cyan, resi 6 AND name N+H;color cyan, resi 7 AND name O;color cyan, resi 7 AND name N+H;color cyan, resi 8 AND name O;color cyan, resi 9 AND name O;color cyan, resi 9 AND name OD1;color cyan, resi 9 AND name OD2;color cyan, resi 9 AND name N+H;color cyan, resi 10 AND name O;color cyan, resi 10 AND name N+H;color cyan, resi 11 AND name O;color cyan, resi 11 AND name N+H;color cyan, resi 12 AND name O;color cyan, resi 12 AND name OE1;color cyan, resi 12 AND name N+H;color cyan, resi 12 AND name NE2+1HE2+2HE2;color cyan, resi 13 AND name O;color cyan, resi 14 AND name O;color cyan, resi 14 AND name OG+HG;color cyan, resi 14 AND name N+H;color cyan, resi 15 AND name O;color cyan, resi 15 AND name OE1;color cyan, resi 15 AND name N+H;color cyan, resi 15 AND name NE2+1HE2+2HE2;color cyan, resi 16 AND name O;color cyan, resi 16 AND name OG1+HG1;color cyan, resi 16 AND name N+H;color orange, resi 17 AND name O;color orange, resi 17 AND name N+H;color cyan, resi 18 AND name O;color cyan, resi 18 AND name OG+HG;color orange, resi 18 AND name N+H;color cyan, resi 19 AND name O;color orange, resi 19 AND name N+H;color cyan, resi 20 AND name O;color cyan, resi 20 AND name OG1+HG1;color cyan, resi 20 AND name N+H;color cyan, resi 21 AND name O;color orange, resi 21 AND name N+H;color cyan, resi 22 AND name O;color cyan, resi 22 AND name OG1+HG1;color cyan, resi 22 AND name N+H;color cyan, resi 23 AND name O;color cyan, resi 23 AND name N+H;color cyan, resi 24 AND name O;color cyan, resi 24 AND name OG+HG;color cyan, resi 24 AND name N+H;color cyan, resi 25 AND name O;color cyan, resi 25 AND name N+H;color cyan, resi 26 AND name O;color cyan, resi 26 AND name N+H;color cyan, resi 27 AND name O;color cyan, resi 27 AND name OG+HG;color cyan, resi 27 AND name N+H;color cyan, resi 28 AND name O;color cyan, resi 28 AND name N+H;color cyan, resi 29 AND name O;color cyan, resi 29 AND name OG1+HG1;color cyan, resi 29 AND name N+H;color cyan, resi 30 AND name O;color cyan, resi 30 AND name N+H;color cyan, resi 31 AND name O;color orange, resi 31 AND name OH+HH;color cyan, resi 31 AND name N+H;color orange, resi 32 AND name O;color cyan, resi 32 AND name N+H;color orange, resi 33 AND name O;color orange, resi 33 AND name N+H;color orange, resi 34 AND name O;color cyan, resi 34 AND name ND1;color orange, resi 34 AND name N+H;color cyan, resi 34 AND name NE2+HE2;color orange, resi 35 AND name O;color orange, resi 35 AND name N+H;color orange, resi 35 AND name NE1+HE1;color orange, resi 36 AND name O;color orange, resi 36 AND name N+H;color cyan, resi 37 AND name O;color orange, resi 37 AND name N+H;color orange, resi 37 AND name NE+HE;color orange, resi 37 AND name NH1+1HH1+2HH1;color orange, resi 37 AND name NH2+1HH2+2HH2;color cyan, resi 38 AND name O;color cyan, resi 38 AND name OE1;color cyan, resi 38 AND name N+H;color cyan, resi 38 AND name NE2+1HE2+2HE2;color cyan, resi 39 AND name O;color cyan, resi 40 AND name O;color cyan, resi 41 AND name O;color cyan, resi 41 AND name N+H;color cyan, resi 42 AND name O;color cyan, resi 42 AND name N+H;color cyan, resi 42 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 43 AND name O;color cyan, resi 43 AND name N+H;color cyan, resi 44 AND name O;color cyan, resi 44 AND name N+H;color cyan, resi 45 AND name O;color orange, resi 45 AND name OE1;color orange, resi 45 AND name OE2;color cyan, resi 45 AND name N+H;color cyan, resi 46 AND name O;color cyan, resi 46 AND name N+H;color cyan, resi 46 AND name NE1+HE1;color cyan, resi 47 AND name O;color cyan, resi 47 AND name N+H;color cyan, resi 48 AND name O;color cyan, resi 48 AND name N+H;color cyan, resi 49 AND name O;color cyan, resi 49 AND name OG1+HG1;color cyan, resi 49 AND name N+H;color cyan, resi 50 AND name O;color cyan, resi 50 AND name N+H;color cyan, resi 51 AND name O;color cyan, resi 51 AND name N+H;color cyan, resi 52 AND name O;color cyan, resi 52 AND name N+H;color cyan, resi 52 AND name NE1+HE1;color cyan, resi 53 AND name O;color cyan, resi 53 AND name OD1;color cyan, resi 53 AND name N+H;color cyan, resi 53 AND name ND2+1HD2+2HD2;color cyan, resi 54 AND name O;color cyan, resi 54 AND name OD1;color cyan, resi 54 AND name OD2;color cyan, resi 54 AND name N+H;color cyan, resi 55 AND name O;color cyan, resi 55 AND name N+H;color cyan, resi 55 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 56 AND name O;color cyan, resi 56 AND name N+H;color cyan, resi 56 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 57 AND name O;color cyan, resi 57 AND name OH+HH;color cyan, resi 57 AND name N+H;color cyan, resi 58 AND name O;color cyan, resi 58 AND name OH+HH;color cyan, resi 58 AND name N+H;color cyan, resi 59 AND name O;color cyan, resi 59 AND name OD1;color cyan, resi 59 AND name N+H;color cyan, resi 59 AND name ND2+1HD2+2HD2;color cyan, resi 60 AND name O;color cyan, resi 60 AND name OG+HG;color cyan, resi 60 AND name N+H;color cyan, resi 61 AND name O;color cyan, resi 61 AND name N+H;color cyan, resi 62 AND name O;color cyan, resi 62 AND name N+H;color cyan, resi 63 AND name O;color cyan, resi 63 AND name N+H;color cyan, resi 63 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 64 AND name O;color cyan, resi 64 AND name OG+HG;color cyan, resi 64 AND name N+H;color cyan, resi 65 AND name O;color cyan, resi 65 AND name N+H;color cyan, resi 65 AND name NE+HE;color cyan, resi 65 AND name NH1+1HH1+2HH1;color cyan, resi 65 AND name NH2+1HH2+2HH2;color cyan, resi 66 AND name O;color cyan, resi 66 AND name N+H;color cyan, resi 67 AND name O;color cyan, resi 67 AND name OG+HG;color cyan, resi 67 AND name N+H;color cyan, resi 68 AND name O;color cyan, resi 68 AND name N+H;color orange, resi 69 AND name O;color cyan, resi 69 AND name OG+HG;color cyan, resi 69 AND name N+H;color cyan, resi 70 AND name O;color cyan, resi 70 AND name N+H;color cyan, resi 70 AND name NE+HE;color cyan, resi 70 AND name NH1+1HH1+2HH1;color cyan, resi 70 AND name NH2+1HH2+2HH2;color cyan, resi 71 AND name O;color cyan, resi 71 AND name OD1;color cyan, resi 71 AND name OD2;color cyan, resi 71 AND name N+H;color cyan, resi 72 AND name O;color cyan, resi 72 AND name OG1+HG1;color cyan, resi 72 AND name N+H;color cyan, resi 73 AND name O;color cyan, resi 73 AND name OG+HG;color cyan, resi 73 AND name N+H;color cyan, resi 74 AND name O;color cyan, resi 74 AND name N+H;color cyan, resi 74 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 75 AND name O;color cyan, resi 75 AND name OD1;color cyan, resi 75 AND name N+H;color cyan, resi 75 AND name ND2+1HD2+2HD2;color orange, resi 76 AND name O;color orange, resi 76 AND name OE1;color cyan, resi 76 AND name N+H;color cyan, resi 76 AND name NE2+1HE2+2HE2;color orange, resi 77 AND name O;color orange, resi 77 AND name N+H;color cyan, resi 78 AND name O;color orange, resi 78 AND name N+H;color cyan, resi 79 AND name O;color cyan, resi 79 AND name N+H;color cyan, resi 80 AND name O;color cyan, resi 80 AND name N+H;color cyan, resi 80 AND name NZ+1HZ+2HZ+3HZ;color cyan, resi 81 AND name O;color cyan, resi 81 AND name N+H;color cyan, resi 82 AND name O;color cyan, resi 82 AND name OG+HG;color cyan, resi 82 AND name N+H;color cyan, resi 83 AND name O;color cyan, resi 83 AND name OG+HG;color cyan, resi 83 AND name N+H;color cyan, resi 84 AND name O;color cyan, resi 84 AND name N+H;color cyan, resi 85 AND name O;color cyan, resi 85 AND name OE1;color cyan, resi 85 AND name OE2;color cyan, resi 85 AND name N+H;color cyan, resi 86 AND name O;color cyan, resi 86 AND name OG1+HG1;color cyan, resi 86 AND name N+H;color orange, resi 87 AND name O;color cyan, resi 87 AND name OE1;color cyan, resi 87 AND name OE2;color cyan, resi 87 AND name N+H;color orange, resi 88 AND name O;color orange, resi 88 AND name OD1;color orange, resi 88 AND name OD2;color orange, resi 88 AND name N+H;color cyan, resi 89 AND name O;color cyan, resi 89 AND name OG1+HG1;color cyan, resi 89 AND name N+H;color cyan, resi 90 AND name O;color cyan, resi 90 AND name N+H;color cyan, resi 91 AND name O;color cyan, resi 91 AND name N+H;color orange, resi 92 AND name O;color orange, resi 92 AND name OH+HH;color orange, resi 92 AND name N+H;color orange, resi 93 AND name O;color orange, resi 93 AND name OH+HH;color orange, resi 93 AND name N+H;color cyan, resi 94 AND name O;color orange, resi 94 AND name N+H;color orange, resi 95 AND name O;color orange, resi 95 AND name OG1+HG1;color orange, resi 95 AND name N+H;color cyan, resi 96 AND name O;color orange, resi 96 AND name N+H;color orange, resi 96 AND name NE+HE;color orange, resi 96 AND name NH1+1HH1+2HH1;color orange, resi 96 AND name NH2+1HH2+2HH2;color orange, resi 97 AND name O;color cyan, resi 97 AND name OD1;color cyan, resi 97 AND name OD2;color cyan, resi 97 AND name N+H;color cyan, resi 98 AND name O;color cyan, resi 98 AND name N+H;color cyan, resi 99 AND name O;color cyan, resi 99 AND name N+H;color cyan, resi 100 AND name O;color cyan, resi 100 AND name N+H;color cyan, resi 101 AND name O;color cyan, resi 101 AND name N+H;color cyan, resi 102 AND name O;color cyan, resi 102 AND name N+H;color cyan, resi 103 AND name O;color cyan, resi 103 AND name N+H;color cyan, resi 104 AND name O;color orange, resi 104 AND name OH+HH;color cyan, resi 104 AND name N+H;color cyan, resi 105 AND name O;color orange, resi 105 AND name OH+HH;color cyan, resi 105 AND name N+H;color cyan, resi 106 AND name O;color cyan, resi 106 AND name N+H;color cyan, resi 107 AND name O;color cyan, resi 107 AND name N+H;color cyan, resi 108 AND name O;color orange, resi 108 AND name OD1;color orange, resi 108 AND name OD2;color cyan, resi 108 AND name N+H;color cyan, resi 109 AND name O;color cyan, resi 109 AND name OH+HH;color cyan, resi 109 AND name N+H;color cyan, resi 110 AND name O;color cyan, resi 110 AND name N+H;color orange, resi 110 AND name NE1+HE1;color cyan, resi 111 AND name O;color cyan, resi 111 AND name N+H;color cyan, resi 112 AND name O;color cyan, resi 112 AND name OE1;color cyan, resi 112 AND name N+H;color cyan, resi 112 AND name NE2+1HE2+2HE2;color cyan, resi 113 AND name O;color cyan, resi 113 AND name N+H;color cyan, resi 114 AND name O;color cyan, resi 114 AND name OG1+HG1;color cyan, resi 114 AND name N+H;color cyan, resi 115 AND name O;color cyan, resi 115 AND name OG+HG;color cyan, resi 115 AND name N+H;color cyan, resi 116 AND name O;color cyan, resi 116 AND name N+H;color cyan, resi 117 AND name O;color cyan, resi 117 AND name OG1+HG1;color cyan, resi 117 AND name N+H;color cyan, resi 118 AND name O;color cyan, resi 118 AND name OXT;color cyan, resi 118 AND name N+H;'" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(h_pose)\n", "string_metric = sm_data.get_string_metric_data()\n", "pymol_cmd = string_metric['pgb_polar_group_burial_pymol']\n", "pymol_cmd.replace(\"\\n\",\";\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "把字符串粘贴到Pymol中时,包埋的非饱和极性原子标注为橙色,暴露的极性原子标记为青色。很容易一眼识别出来!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "<center><img src=\"./img/6LZ9_H_polar.png\" width = \"400\" height = \"300\" align=center /> </center>\n", "(图片来源: 晶泰科技团队)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. Composite Metrics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 4.1 ElectrostaticComplementMetric\n", "使用APBS计算McCoy, Chandana, Colman Electrostatic complementarity" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**[linux]*注意:需要安装APBS: conda install -c conda-forge apbs*" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mbasic.io.database: {0} \u001b[0mDatabase file opened: scoring/score_functions/sc/sc_radii.lib\n" ] }, { "ename": "RuntimeError", "evalue": "\n\nFile: /Volumes/MacintoshHD3/benchmark/W.fujii.release/rosetta.Fujii.release/_commits_/main/source/src/core/scoring/PoissonBoltzmannPotential.cc:306\n[ ERROR ] UtilityExitException\nERROR: APBS failed to generate the result file.\n\n", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mRuntimeError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m<ipython-input-40-0c702093e40d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mElectrostatic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidue_selector1\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mEC_selector1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0mElectrostatic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mresidue_selector2\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mEC_selector2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0mElectrostatic\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapply\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpose\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m'pose_'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mRuntimeError\u001b[0m: \n\nFile: /Volumes/MacintoshHD3/benchmark/W.fujii.release/rosetta.Fujii.release/_commits_/main/source/src/core/scoring/PoissonBoltzmannPotential.cc:306\n[ ERROR ] UtilityExitException\nERROR: APBS failed to generate the result file.\n\n" ] } ], "source": [ "from pyrosetta.rosetta.core.simple_metrics.composite_metrics import ElectrostaticComplementarityMetric\n", "Electrostatic = ElectrostaticComplementarityMetric()\n", "Electrostatic.ignore_radius(20) #忽略距离界面多远的原子,-1代表保持所有的原子。\n", "Electrostatic.interface_trim_radius(0) # 距离SASA表面多远的分子点截断,默认是0\n", "Electrostatic.partially_solvated(True) # 是否部分溶剂化,True为部分溶剂化,False为全部溶剂化\n", "Electrostatic.report_all_ec(True) #是否输出两个selector的具体数值,否则只输出平均值\n", "EC_selector1 = ResidueIndexSelector('2H-10H')\n", "EC_selector2 = ResidueIndexSelector('11H-20H')\n", "Electrostatic.residue_selector1(EC_selector1)\n", "Electrostatic.residue_selector2(EC_selector2)\n", "Electrostatic.apply(pose,'pose_')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pyrosetta.rosetta.core.simple_metrics import get_sm_data\n", "sm_data = get_sm_data(pose)\n", "composite_real_metric = sm_data.get_composite_real_metric_data()\n", "composite_real_metric['pose_ec']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.10" } }, "nbformat": 4, "nbformat_minor": 4 }