def Mutagenesis(kinase1, model, template,peptide_instance): """superposition the model and template, remove template and leave peptide behind """ """replace peptide with instance peptide""" list_name = peptide_instance with open(input_data_folder+list_name,'r') as f: instances = f.readlines() instance = [x.strip() for x in instances] print "your peptide: ", instance for pep in instance: cmd.delete('all') cmd.fetch(model) # model_candidate, ex.chk1,chk2... cmd.remove("hetatm") #remove the nonstandard residues cmd.fetch(template) #mutagenesis template, ex.2phk peptide_template = cmd.get_fastastr( "/"+template+'//B') #get the peptide from the template and generate another one for mutagenesis peptide_template = peptide_template + 'G' #peptide of 2phk is 7 amino acid long, when our input peptide is 8 aa, we need to plus one character for aa in peptide_template[6:].lower(): #creat template_peptide for mutagenesis cmd._alt(aa) firstaa = AAcode_1_to_3(peptide_template[6]) #translate template_peptide to 3 letter low_firstaa = firstaa[0].lower() cmd.alter(low_firstaa, 'chain = "B"') #select this template_peptide cmd.show_as("cartoon") cmd.align(model, template) #superpostion of model and template cmd.align(low_firstaa,template) #superpostion of template_peptide and template remove_part = "("+template+" and not resn ATP"+")" cmd.select("remove_part",remove_part) cmd.remove("remove_part") #remove the template except for ATP, there are only model and template_peptide cmd.remove("resn hoh") #remove water cmd.wizard("mutagenesis") peptide_position = 0 for i in pep: #the peptide_position starting point depends the first position of mutagenesis peptide #pymol's peptide start from 1, not 0 mutagenesis_template = '/'+low_firstaa+ '///' + str(peptide_position + 2) # because of 2phk start at 2nd of peptide #mutagenesis_template = '/' + template + '//B/' + str(peptide_position + 2) cmd.get_wizard().do_select(mutagenesis_template) # select peptide position of mutation replace_aminoacid = AAcode_1_to_3(pep)[peptide_position] cmd.get_wizard().set_mode(replace_aminoacid) # select which residue want to mutate to cmd.get_wizard().apply() peptide_position += 1 filename = kinase1 + '_' + model + 'model_' + template + 'muta_' + pep + '.pdb' #build the canonical name cmd.save(filename) ATPchange(filename) #change ATP naming to the format of ATP.params cmd.wizard(None) return
def build_epz1_h(): """Build epz1_h (epz1 with XL domains in alpha-helix)""" cmd._alt('B'.lower()) # N-terminal actyl group build_HP(0) build_XL(1) build_HP(0) build_XL(1) build_HP(0) editor.attach_amino_acid('pk1', 'nhh') cmd.save('/home/zyxue/labwork/pdb_backup/lele/epz1_h.pdb')
def build_XL(ssid=0): """ Build the cross-linking (XL) domain :Parameters: - `ssid`: secondary structure id 0: coil (default) 1: alpha-helix 2: antiparallel beta-sheet 3: parallel beta-sheet """ cmd.set('secondary_structure', ssid) XL1 = 'AAAAAKAAKY' linker = 'GVGTP' XL2 = 'AAAAAKAAAKAAQF' for aa in XL1: cmd._alt(aa.lower()) # because of Pro in the linker, it has to be coil cmd.set('secondary_structure', 0) for aa in linker: cmd._alt(aa.lower()) cmd.set('secondary_structure', ssid) for aa in XL2: cmd._alt(aa.lower())
def build_HP(ssid=0): cmd.set('secondary_structure', ssid) HP = 'GVPGVGVPGVGVPGVGVPGVGVPGVGVPGVGVPGV' for aa in HP: cmd._alt(aa.lower())