Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions apps/PointMutations/PointMutation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import pyrosetta
from pyrosetta.rosetta import protocols
import argparse
from Bio.Data import IUPACData

# parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument('--input_pose', help='PDB file of input pose')
parser.add_argument('--mutation', help='The mutation you would like to make in the form A123B')
parser.add_argument('--output_filename', help='Name of the output PDB')
args = parser.parse_args()

# initialize PyRosetta
pyrosetta.init()

# create a pose
pose = pyrosetta.pose_from_file(args.input_pose)

# get a scorefxn
score_function = pyrosetta.create_score_function('ref2015')

# mutate the residue
target = int(args.mutation[1:-1])
new_res = IUPACData.protein_letters_1to3[args.mutation[-1]].upper()
mutate = protocols.simple_moves.MutateResidue(target, new_res)
mutate.apply(pose)

# output a PDB of the mutation
pose.dump_pdb(args.output_filename)