schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.15k stars 275 forks source link

Why I can not convert amino acid using pymol? #305

Open JonasLi-19 opened 1 year ago

JonasLi-19 commented 1 year ago

Dear developer, I want to mutate all GLN&ASN to LEU of protein files to do some further research, but EVEN THOUGH the python scripts runs well without error, the output file still have all the GLN&ASN left.

AND the command terminal code output is like:

 Selector: selection "res" defined with 14 atoms.
PyMOL>cmd.get_wizard().set_mode('LEU')
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 1aaq_protein and chain B and resi 98
 Selector: selection "res" defined with 14 atoms.
PyMOL>cmd.get_wizard().set_mode('LEU')
PyMOL>cmd.get_wizard().apply()
JonasLi-19 commented 1 year ago

Any suggestions?

speleo3 commented 1 year ago

Before cmd.get_wizard().apply(), add this:

cmd.get_wizard().do_select("res")
speleo3 commented 1 year ago

You could also use psico.modelling.mutate_all.

psico.modelling.mutate_all(f"{base_name} and resn ASN+GLN", "LEU")
SanFran-Me commented 1 year ago

I find pymol might turn ASP into VAL or ALA using this code, but I set as ASP→LEU, why?

JonasLi-19 commented 1 year ago

Thanks for your constructive suggestions, and I have a little detailed question about mutation process of pymol to ask you.
When pymol executes the mutation using

mut_dict = {...}
              ...
                        cmd.do(f'select ...')
                        cmd.do(f"cmd.get_wizard().set_mode('{...}')")
                        cmd.do('...')
              ...

HOW DOES IT AVOID SPACIAL STRUCTURE CLASHES? I have noticed that it has something to do with rotamers for one specific amino acid.

PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 14 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.016 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.35
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
PyMOL>select res, 3zze_pocket and chain A and resi 1235
 Selector: selection "res" defined with 20 atoms.
PyMOL>cmd.get_wizard().set_mode('PHE')
PyMOL>cmd.get_wizard().do_select("res")
Selected!
 ExecutiveRMSPairs: RMSD =    0.000 (4 to 4 atoms)
 Mutagenesis: no phi/psi, using backbone-independent rotamers.
 Mutagenesis: 6 rotamers loaded.
 Rotamer 2/6, strain=56.31
PyMOL>cmd.get_wizard().apply()
JonasLi-19 commented 1 year ago

I find pymol might turn ASP into VAL or ALA using this code, but I set as ASP→LEU, why?

I also find a few residues did not convert as I want, and do not know why.