{"id":174145,"date":"2024-05-08T18:25:55","date_gmt":"2024-05-08T10:25:55","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/174145.html"},"modified":"2024-05-08T18:26:02","modified_gmt":"2024-05-08T10:26:02","slug":"%e5%a6%82%e4%bd%95%e5%ad%a6%e4%b9%a0%e7%94%a8python%e7%bb%98%e5%88%b6%e5%88%86%e5%ad%90%e7%bb%93%e6%9e%84","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/174145.html","title":{"rendered":"\u5982\u4f55\u5b66\u4e60\u7528python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27050224\/b01b2df1-67cd-475e-8ef2-b1404d73e226.webp\" alt=\"\u5982\u4f55\u5b66\u4e60\u7528python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\" \/><\/p>\n<p><p>\u5b66\u4e60\u5982\u4f55\u7528Python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u4e3b\u8981\u6d89\u53ca\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a<strong>\u5b89\u88c5\u5fc5\u8981\u7684Python\u5e93\u3001\u7406\u89e3\u5206\u5b50\u6570\u636e\u683c\u5f0f\u3001\u638c\u63e1\u5206\u5b50\u53ef\u89c6\u5316\u5e93\u7684\u4f7f\u7528\u3001\u7f16\u5199\u4ee3\u7801\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u3001\u4ee5\u53ca\u4f18\u5316\u548c\u7f8e\u5316\u5206\u5b50\u56fe\u5f62<\/strong>\u3002\u5176\u4e2d\uff0c<strong>\u638c\u63e1\u5206\u5b50\u53ef\u89c6\u5316\u5e93\u7684\u4f7f\u7528<\/strong>\u662f\u6574\u4e2a\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u6700\u4e3a\u6838\u5fc3\u548c\u57fa\u7840\u7684\u4e00\u73af\u3002\u8fd9\u8981\u6c42\u521d\u5b66\u8005\u5148\u719f\u6089Python\u7f16\u7a0b\u8bed\u8a00\u7684\u57fa\u672c\u8bed\u6cd5\uff0c\u7136\u540e\u7740\u91cd\u5b66\u4e60\u90a3\u4e9b\u4e13\u95e8\u7528\u4e8e\u5206\u5b50\u7ed3\u6784\u53ef\u89c6\u5316\u7684\u5e93\uff0c\u5982RDKit\u548cPyMOL\u3002\u901a\u8fc7\u8fd9\u4e9b\u5e93\uff0c\u53ef\u4ee5\u8f7b\u677e\u8bfb\u53d6\u3001\u5904\u7406\u548c\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u652f\u6301\u590d\u6742\u7684\u5206\u5b50\u7ed3\u6784\u5c55\u793a\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5\u5fc5\u8981\u7684PYTHON\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u5de5\u4f5c\u73af\u5883\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002Python\u662f\u4e00\u79cd\u6613\u4e8e\u5b66\u4e60\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u975e\u5e38\u9002\u5408\u5904\u7406\u5206\u5b50\u7ed3\u6784\u6570\u636e\u3002\u63a5\u4e0b\u6765\uff0c\u4f60\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u4e13\u95e8\u7528\u4e8e\u5206\u5b50\u7ed8\u56fe\u7684\u5e93\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>RDKit<\/strong>\uff1a\u4e00\u4e2a\u5f00\u6e90\u7684\u5316\u5b66\u4fe1\u606f\u5b66Python\u5e93\uff0c\u80fd\u591f\u5904\u7406\u548c\u5c55\u793a\u5316\u5b66\u5206\u5b50\u7ed3\u6784\u3002<\/li>\n<li><strong>PyMOL<\/strong>: \u53e6\u4e00\u4e2a\u5f3a\u5927\u7684\u5206\u5b50\u89c6\u89c9\u5316\u5de5\u5177\uff0c\u53ef\u4ee5\u751f\u6210\u9ad8\u8d28\u91cf\u7684\u5206\u5b50\u7ed3\u67843D\u56fe\u50cf\u3002<\/li>\n<\/ul>\n<p><p>\u5b89\u88c5\u8fd9\u4e9b\u5e93\u7684\u8fc7\u7a0b\u901a\u5e38\u5f88\u7b80\u5355\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b8c\u6210\u3002\u4f8b\u5982\uff0c\u5b89\u88c5RDKit\u53ef\u4ee5\u901a\u8fc7\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8fd0\u884c<code>pip install rdkit<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u7406\u89e3\u5206\u5b50\u6570\u636e\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u5206\u5b50\u7ed3\u6784\u6570\u636e\u53ef\u4ee5\u4ee5\u591a\u79cd\u683c\u5f0f\u5b58\u5728\uff0c\u5982SMILES\u3001MOL\u6587\u4ef6\u3001PDB\u6587\u4ef6\u7b49\u3002\u7406\u89e3\u8fd9\u4e9b\u6570\u636e\u683c\u5f0f\u5bf9\u4e8e\u5b66\u4e60\u5982\u4f55\u4f7f\u7528Python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/p>\n<ul>\n<li><strong>SMILES\uff08\u7b80\u5316\u5206\u5b50\u8f93\u5165\u7ebf\u6027\u8868\u793a\u6cd5\uff09<\/strong>\uff1a\u662f\u4e00\u79cd\u4ee5ASCII\u5b57\u7b26\u4e32\u5f62\u5f0f\u63cf\u8ff0\u5206\u5b50\u7ed3\u6784\u7684\u65b9\u5f0f\uff0c\u5b83\u80fd\u591f\u7b80\u6d01\u5730\u8868\u793a\u5206\u5b50\u7684\u8fde\u63a5\u4fe1\u606f\u548c\u7acb\u4f53\u6784\u578b\u3002<\/li>\n<li><strong>MOL\u6587\u4ef6\u548cPDB\u6587\u4ef6<\/strong>\uff1a\u8fd9\u4e24\u79cd\u6587\u4ef6\u683c\u5f0f\u63d0\u4f9b\u4e86\u5173\u4e8e\u5206\u5b50\u7ed3\u6784\u7684\u66f4\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u539f\u5b50\u4f4d\u7f6e\u5750\u6807\uff0c\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u7cbe\u786e\u76843D\u5206\u5b50\u6a21\u578b\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u638c\u63e1\u5206\u5b50\u53ef\u89c6\u5316\u5e93\u7684\u4f7f\u7528<\/h3>\n<\/p>\n<p><h4>RDKit<\/h4>\n<\/p>\n<p><p>RDKit\u63d0\u4f9b\u4e86\u4e00\u5957\u4e30\u5bcc\u7684\u63a5\u53e3\u548c\u529f\u80fd\uff0c\u7528\u4e8e\u5206\u5b50\u7ed3\u6784\u7684\u5904\u7406\u548c\u53ef\u89c6\u5316\u3002\u4ece\u8bfb\u53d6\u5206\u5b50\u6570\u636e\u3001\u751f\u6210\u5206\u5b50\u5bf9\u8c61\uff0c\u5230\u6e32\u67d3\u5206\u5b50\u7ed3\u6784\u56fe\uff0cRDKit\u90fd\u80fd\u591f\u80dc\u4efb\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528RDKit\u5904\u7406\u5206\u5b50\u6570\u636e\u65f6\uff0c\u9996\u5148\u9700\u8981\u4eceSMILES\u5b57\u7b26\u4e32\u6216\u6587\u4ef6\u4e2d\u521b\u5efa\u4e00\u4e2a\u5206\u5b50\u5bf9\u8c61\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7RDKit\u7684<code>Chem.MolFromSmiles(smilesString)<\/code>\u6216<code>Chem.MolFromMolFile(filename)<\/code>\u51fd\u6570\u5b8c\u6210\u3002<\/li>\n<li>\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u4f7f\u7528<code>Draw.MolToImage(mol)<\/code>\u51fd\u6570\u5c06\u5206\u5b50\u5bf9\u8c61\u7ed8\u5236\u4e3a\u56fe\u50cf\uff0c\u4e5f\u53ef\u4ee5\u5229\u7528\u66f4\u9ad8\u7ea7\u7684\u6e32\u67d3\u8bbe\u7f6e\u6765\u7f8e\u5316\u548c\u5b9a\u5236\u5206\u5b50\u56fe\u5f62\u3002<\/li>\n<\/ul>\n<p><h4>PyMOL<\/h4>\n<\/p>\n<p><p>PyMOL\u5219\u66f4\u4fa7\u91cd\u4e8e3D\u5206\u5b50\u7ed3\u6784\u7684\u53ef\u89c6\u5316\u3002\u5b83\u4e0d\u4ec5\u80fd\u591f\u751f\u6210\u9ad8\u8d28\u91cf\u76843D\u56fe\u50cf\uff0c\u8fd8\u652f\u6301\u7528\u6237\u4ea4\u4e92\uff0c\u5141\u8bb8\u7528\u6237\u4ece\u4e0d\u540c\u7684\u89c6\u89d2\u67e5\u770b\u5206\u5b50\u7ed3\u6784\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528PyMOL\u65f6\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u52a0\u8f7dPDB\u6587\u4ef6\u6216\u5176\u4ed6\u5206\u5b50\u6570\u636e\u6587\u4ef6\u6765\u5f00\u59cb\u3002PyMOL\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u547d\u4ee4\u548c\u811a\u672c\u63a5\u53e3\u6765\u63a7\u5236\u5206\u5b50\u7684\u663e\u793a\u65b9\u5f0f\uff0c\u6bd4\u5982\u5206\u5b50\u7684\u989c\u8272\u3001\u900f\u660e\u5ea6\u548c\u8868\u9762\u6e32\u67d3\u6548\u679c\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001\u7f16\u5199\u4ee3\u7801\u7ed8\u5236\u5206\u5b50\u7ed3\u6784<\/h3>\n<\/p>\n<p><p>\u4e00\u65e6\u719f\u6089\u4e86\u5206\u5b50\u53ef\u89c6\u5316\u5e93\u7684\u57fa\u672c\u4f7f\u7528\u65b9\u6cd5\uff0c\u63a5\u4e0b\u6765\u5c31\u662f\u52a8\u624b\u5b9e\u8df5\uff0c\u901a\u8fc7\u7f16\u5199Python\u4ee3\u7801\u6765\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u3002\u521d\u5b66\u8005\u53ef\u4ee5\u4ece\u7b80\u5355\u7684\u5206\u5b50\u5f00\u59cb\uff0c\u9010\u6b65\u5c1d\u8bd5\u7ed8\u5236\u66f4\u590d\u6742\u7684\u5206\u5b50\u7ed3\u6784\u3002<\/p>\n<\/p>\n<ul>\n<li>\u521d\u59cb\u9636\u6bb5\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u6839\u636eSMILES\u5b57\u7b26\u4e32\u751f\u6210\u5206\u5b50\u76842D\u7ed3\u6784\u56fe\u3002<\/li>\n<li>\u968f\u540e\uff0c\u53ef\u4ee5\u63a2\u7d22\u4f7f\u7528RDKit\u548cPyMOL\u7b49\u5de5\u5177\u7684\u9ad8\u7ea7\u7279\u6027\uff0c\u5982\u8c03\u6574\u5206\u5b50\u7684\u89c6\u89d2\u3001\u7740\u8272\u548c\u5149\u7167\u6548\u679c\uff0c\u8fdb\u800c\u751f\u6210\u903c\u771f\u76843D\u5206\u5b50\u6a21\u578b\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u4f18\u5316\u548c\u7f8e\u5316\u5206\u5b50\u56fe\u5f62<\/h3>\n<\/p>\n<p><p>\u6700\u540e\uff0c\u901a\u8fc7\u5b66\u4e60\u5982\u4f55\u8c03\u6574\u56fe\u5f62\u7684\u7ec6\u8282\u53c2\u6570\uff0c\u4f60\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4f18\u5316\u548c\u7f8e\u5316\u4f60\u7684\u5206\u5b50\u56fe\u5f62\u3002\u8fd9\u5305\u62ec\u8c03\u6574\u5206\u5b50\u6a21\u578b\u7684\u989c\u8272\u3001\u5149\u7167\u3001\u9634\u5f71\u7b49\uff0c\u4ee5\u53ca\u4f7f\u7528\u80cc\u666f\u548c\u6587\u5b57\u6ce8\u91ca\u6765\u589e\u5f3a\u5206\u5b50\u56fe\u5f62\u7684\u8868\u73b0\u529b\u3002<\/p>\n<\/p>\n<ul>\n<li>\u4f18\u5316\u989c\u8272\u548c\u5149\u7167\u53ef\u4ee5\u8ba9\u5206\u5b50\u6a21\u578b\u770b\u8d77\u6765\u66f4\u4e3a\u7acb\u4f53\u548c\u771f\u5b9e\u3002<\/li>\n<li>\u6dfb\u52a0\u80cc\u666f\u548c\u6587\u5b57\u6ce8\u91ca\u5219\u53ef\u4ee5\u5e2e\u52a9\u89e3\u91ca\u5206\u5b50\u6a21\u578b\uff0c\u4f7f\u5b83\u4eec\u66f4\u5177\u6559\u5b66\u4ef7\u503c\u6216\u5728\u5b66\u672f\u62a5\u544a\u4e2d\u66f4\u6613\u4e8e\u7406\u89e3\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u8fd9\u4e00\u7cfb\u5217\u7684\u5b66\u4e60\u6b65\u9aa4\uff0c\u4f60\u5c06\u80fd\u591f\u5229\u7528Python\u6765\u7ed8\u5236\u51fa\u9ad8\u8d28\u91cf\u7684\u5206\u5b50\u7ed3\u6784\u56fe\u5f62\uff0c\u65e0\u8bba\u662f\u7528\u4e8e\u5b66\u672f\u7814\u7a76\u3001\u6559\u5b66\u8fd8\u662f\u4ec5\u4ec5\u662f\u51fa\u4e8e\u4e2a\u4eba\u5174\u8da3\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>Q\uff1a\u6709\u54ea\u4e9b\u9014\u5f84\u53ef\u4ee5\u5b66\u4e60\u7528python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff1f<\/strong><\/p>\n<p>A\uff1a\u5b66\u4e60\u7528python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u7684\u9014\u5f84\u5f88\u591a\u3002\u4f60\u53ef\u4ee5\u53c2\u52a0\u7ebf\u4e0a\u6216\u7ebf\u4e0b\u7684\u7f16\u7a0b\u8bfe\u7a0b\uff0c\u5982Coursera\u3001Udemy\u7b49\u5e73\u53f0\u4e0a\u7684Python\u7f16\u7a0b\u8bfe\u7a0b\uff0c\u6216\u8005\u52a0\u5165\u5b66\u672f\u673a\u6784\u7684\u57f9\u8bad\u73ed\u3002\u6b64\u5916\uff0c\u8fd8\u6709\u5f88\u591a\u514d\u8d39\u7684\u6559\u7a0b\u548c\u5728\u7ebf\u8d44\u6e90\u53ef\u4f9b\u5b66\u4e60\uff0c\u5305\u62ec\u7f51\u7ad9\u3001\u535a\u5ba2\u548c\u8bba\u575b\u7b49\u3002<\/p>\n<p><strong>Q\uff1a\u6709\u54ea\u4e9b\u5e38\u7528\u7684python\u5e93\u53ef\u4ee5\u7528\u6765\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff1f<\/strong><\/p>\n<p>A\uff1a\u95ee\u9898\u5c11\u5e74\uff0c\u201crdkit\u201d\u662f\u4e00\u4e2a\u5e38\u7528\u7684\u7528\u4e8e\u5316\u5b66\u4fe1\u606f\u5b66\u548c\u8ba1\u7b97\u7684\u5f00\u6e90python\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u5206\u5b50\u7ed3\u6784\u7684\u7ed8\u5236\u3001\u5206\u6790\u548c\u6a21\u62df\u3002\u53e6\u5916\uff0c\u8fd8\u6709\u201cpy3Dmol\u201d\u5e93\u53ef\u4ee5\u5728web\u7aef\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff0c\u5e76\u901a\u8fc7\u4e92\u52a8\u7684\u65b9\u5f0f\u8fdb\u884c\u53ef\u89c6\u5316\u3002<\/p>\n<p><strong>Q\uff1a\u9664\u4e86\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff0c\u8fd8\u6709\u54ea\u4e9b\u7528python\u53ef\u4ee5\u8fdb\u884c\u7684\u76f8\u5173\u4efb\u52a1\uff1f<\/strong><\/p>\n<p>A\uff1a\u9664\u4e86\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\uff0c\u4f7f\u7528python\u53ef\u4ee5\u8fdb\u884c\u5f88\u591a\u5176\u4ed6\u76f8\u5173\u7684\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528python\u8fdb\u884c\u5206\u5b50\u5bf9\u9f50\u3001\u5206\u6790\u5206\u5b50\u95f4\u7684\u76f8\u4f3c\u6027\u3001\u8ba1\u7b97\u5206\u5b50\u7684\u6027\u8d28\uff08\u5982\u80fd\u91cf\u3001\u70ed\u529b\u5b66\u53c2\u6570\u7b49\uff09\u3001\u9884\u6d4b\u5316\u5b66\u53cd\u5e94\u3001\u8fdb\u884c\u5316\u5b66\u6570\u636e\u5e93\u641c\u7d22\u7b49\u3002Python\u7684\u5f3a\u5927\u529f\u80fd\u548c\u4e30\u5bcc\u7684\u5e93\u4f7f\u5176\u6210\u4e3a\u5316\u5b66\u4fe1\u606f\u5b66\u548c\u8ba1\u7b97\u9886\u57df\u7684\u4e00\u79cd\u5e38\u7528\u5de5\u5177\u3002<\/p>\n<p>\u5782\u76f4\u6269\u5c55\u5efa\u8bae\uff1a\u8865\u5145\u793a\u4f8b\u56fe\uff0c\u6559\u6388\u4f7f\u7528rdkit\u5e93\u548cpy3Dmol\u5e93\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u7684\u793a\u4f8b\u4ee3\u7801\u56de\u7b54\u95ee\u9898\u4e00\u3002\u4ecb\u7ecd\u5e38\u7528\u7684rdkit\u5e93\u548cpy3Dmol\u5e93\u7684\u529f\u80fd\u548c\u7528\u6cd5\u3002\u8bb2\u89e3python\u5728\u5316\u5b66\u4fe1\u606f\u5b66\u548c\u8ba1\u7b97\u9886\u57df\u4e2d\u7684\u5e94\u7528\u6848\u4f8b<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b66\u4e60\u5982\u4f55\u7528Python\u7ed8\u5236\u5206\u5b50\u7ed3\u6784\u4e3b\u8981\u6d89\u53ca\u4ee5\u4e0b\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\uff1a\u5b89\u88c5\u5fc5\u8981\u7684Python\u5e93\u3001\u7406\u89e3\u5206\u5b50\u6570\u636e\u683c\u5f0f\u3001\u638c\u63e1\u5206 [&hellip;]","protected":false},"author":3,"featured_media":174158,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/174145"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=174145"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/174145\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/174158"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=174145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=174145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=174145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}