Last active
August 29, 2015 14:06
-
-
Save ajasja/7a5ba957f43de922f56b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "import os\nimport numpy as np\nimport rosetta as r\nimport random\nr.init()\nr.__version__", | |
"prompt_number": 1, | |
"outputs": [ | |
{ | |
"text": "'56891:56891:6efc58f8abb54611ace5a6cdd7e69e6c970a01ef'", | |
"output_type": "pyout", | |
"metadata": {}, | |
"prompt_number": 1 | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "#Makin a mutation after the helix is created also works\n#Create sequence \nseq = 'R'*5 + 'K'+'R'*5; print seq\npose = r.pose_from_sequence(seq, res_type=\"fa_standard\") \nscorefxn = r.get_fa_scorefxn()\n\n#Create perfect alpha helix\n#phi = -57.8, Psi -47.0\nfor i in range(1, pose.total_residue()+1):\n pose.set_phi(i, -57.9)\n pose.set_psi(i, -47.9)\n\n\n #pack side chains\npacker_task = r.standard_packer_task(pose)\npacker_task.restrict_to_repacking() \nprint packer_task\npack_mover = r.PackRotamersMover(scorefxn, packer_task) \npack_mover.apply(pose) \n\n#show the resuls\nprint scorefxn(pose)\n", | |
"prompt_number": 14, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "RRRRRKRRRRR\n#Packer_Task\n\nresid\tpack?\tdesign?\tallowed_aas\n1\tTRUE\tFALSE\tARG:NtermProteinFull\n2\tTRUE\tFALSE\tARG\n3\tTRUE\tFALSE\tARG\n4\tTRUE\tFALSE\tARG\n5\tTRUE\tFALSE\tARG\n6\tTRUE\tFALSE\tLYS\n7\tTRUE\tFALSE\tARG\n8\tTRUE\tFALSE\tARG\n9\tTRUE\tFALSE\tARG\n10\tTRUE\tFALSE\tARG\n11\tTRUE\tFALSE\tARG:CtermProteinFull\n\n-0.165960801682", | |
"stream": "stdout" | |
}, | |
{ | |
"output_type": "stream", | |
"text": "\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "pose.residue(6).chi(r.Vector1([1.,2.,3.,4.]))\nprint scorefxn(pose)\n#As expected energy not updated", | |
"prompt_number": 15, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "-0.165960801682\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "pack_mover.apply(pose) \nprint scorefxn(pose)\npose.residue(6).set_chi(1, 90.)\nprint scorefxn(pose)\n#Energy still not updated??", | |
"prompt_number": 11, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "0.121413424414\n0.121413424414\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "pack_mover.apply(pose) \nprint scorefxn(pose)\npose.residue(6).set_all_chi(r.Vector1([1.,2.,3.,4.]))\nprint scorefxn(pose)\n#Energy still not updated??", | |
"prompt_number": 12, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "0.112666631125\n0.112666631125\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "pack_mover.apply(pose) \nprint scorefxn(pose)\npose.set_chi(1,6,90.)\nprint scorefxn(pose)\n#Ahh, energy finally updated", | |
"prompt_number": 13, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"text": "-0.165960801682\n11.3687762064\n", | |
"stream": "stdout" | |
} | |
], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
}, | |
{ | |
"metadata": {}, | |
"cell_type": "code", | |
"input": "", | |
"outputs": [], | |
"language": "python", | |
"trusted": true, | |
"collapsed": false | |
} | |
], | |
"metadata": {} | |
} | |
], | |
"metadata": { | |
"name": "", | |
"signature": "sha256:d336dc43cd1a87ac4b7fb27acabd93aef08ee30e82c0fdcf2865b2f2c9696f65", | |
"gist_id": "7a5ba957f43de922f56b" | |
}, | |
"nbformat": 3 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment