Re: [PyMOL] Mutate residues in batch mode

2011-09-22 Thread Troels Emtekær Linnet
And to save it, add this python block

python
for PDB in PDBs:
cmd.save("%s-K.pdb"%PDB,"%s"%PDB)
python end

Troels Emtekær Linnet
Karl-Liebknecht-Straße 53, 2 RE 
04107 Leipzig, Tyskland
Mobil: +49 1577-8944752



2011/9/22 Troels Emtekær Linnet 

> # Firs load files in dirextory with:
> http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/
> # load_sep.py
> # Load multiple PDB files into a multiple PyMOL objects
> #  e.g. load_sep prot_*.pdb, prot
> # will create objects with names, prot1, prot2, prot3, etc.
>
> # Now the rest
> cd /home/tlinnet/Desktop
>
> # Test protein
> fetch 4INS, async=0
>
> # Get all loaded PDB object names in pymol
> PDBs = cmd.get_names()
>
> python
> ### We need to find a way to get the information of chain and resi from the
> loaded list
> ### Create empty list
> ProtChainResiList = []
> for PDB in PDBs:
> #print PDB
> ### Get the ID numbers of CA atom in protein
> CAindex = cmd.identify("%s and name CA"%PDB)
> for CAid in CAindex:
> ### We need to find a way to get the information of chain and resi
> from ID
> pdbstr = cmd.get_pdbstr("%s and id %s"%(PDB,CAid))
> pdbstr_lines = pdbstr.splitlines()
> chain = pdbstr_lines[0].split()[4]
> resi = pdbstr_lines[0].split()[5]
> #print "CAid: %s Chain: %s resi: %s"%(CAid, chain,resi)
> ProtChainResiList.append([PDB,chain,resi])
> #for entry in ProtChainResiList:
> #print entry
> python end
>
> ### We devide it up in several python blocks, so python dont speed ahead:
> python
> ### Start the wizard
> cmd.wizard("mutagenesis")
> ## REMOVE [0:3]
> for p,c,r in ProtChainResiList[0:4]:
> #print p,c,r
> cmd.do("refresh_wizard")
> cmd.get_wizard().set_mode("LYS")
> selection="/%s//%s/%s"%(p,c,r)
> #print selection
> cmd.get_wizard().do_select(selection)
> ### Select frame 1, which is most probable
> cmd.frame(1)
> cmd.get_wizard().apply()
> ### Stop the wizard
> cmd.set_wizard("done")
> python end
>
> Troels Emtekær Linnet
>
>
>
> 2011/9/22 Fabio Gozzo 
>
>>  Hi Pymolers,
>>
>> I need to perform a batch operation but I need a help with script
>> modification.
>> A have a set (~100) of pdb files that I would like to mutate all residues
>> to lysine. I modified mutate02.py script in pymol to perform this task, but
>> I would need two extra "features":
>>
>> 1) the script would need to save the file with a different name. For
>> example, load test.pdb, mutate all residues to lysine and then save the
>> mutated version to test_K.pdb
>> 2) the script would need to perform this task for all the pdb files in a
>> directory.
>>
>> Right now, I am not concerned about the possible rotamers of lysine, any
>> lysine rotamer would work.
>> Could anyone give a hint on how to do it ?
>> Thanks !
>> Fabio.
>>
>>
>>
>> --
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense.
>> http://p.sf.net/sfu/splunk-d2dcopy1
>> ___
>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>
>
>
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Re: [PyMOL] Mutate residues in batch mode

2011-09-22 Thread Troels Emtekær Linnet
# Firs load files in dirextory with:
http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/
# load_sep.py
# Load multiple PDB files into a multiple PyMOL objects
#  e.g. load_sep prot_*.pdb, prot
# will create objects with names, prot1, prot2, prot3, etc.

# Now the rest
cd /home/tlinnet/Desktop

# Test protein
fetch 4INS, async=0

# Get all loaded PDB object names in pymol
PDBs = cmd.get_names()

python
### We need to find a way to get the information of chain and resi from the
loaded list
### Create empty list
ProtChainResiList = []
for PDB in PDBs:
#print PDB
### Get the ID numbers of CA atom in protein
CAindex = cmd.identify("%s and name CA"%PDB)
for CAid in CAindex:
### We need to find a way to get the information of chain and resi
from ID
pdbstr = cmd.get_pdbstr("%s and id %s"%(PDB,CAid))
pdbstr_lines = pdbstr.splitlines()
chain = pdbstr_lines[0].split()[4]
resi = pdbstr_lines[0].split()[5]
#print "CAid: %s Chain: %s resi: %s"%(CAid, chain,resi)
ProtChainResiList.append([PDB,chain,resi])
#for entry in ProtChainResiList:
#print entry
python end

### We devide it up in several python blocks, so python dont speed ahead:
python
### Start the wizard
cmd.wizard("mutagenesis")
## REMOVE [0:3]
for p,c,r in ProtChainResiList[0:4]:
#print p,c,r
cmd.do("refresh_wizard")
cmd.get_wizard().set_mode("LYS")
selection="/%s//%s/%s"%(p,c,r)
#print selection
cmd.get_wizard().do_select(selection)
### Select frame 1, which is most probable
cmd.frame(1)
cmd.get_wizard().apply()
### Stop the wizard
cmd.set_wizard("done")
python end

Troels Emtekær Linnet



2011/9/22 Fabio Gozzo 

> Hi Pymolers,
>
> I need to perform a batch operation but I need a help with script
> modification.
> A have a set (~100) of pdb files that I would like to mutate all residues
> to lysine. I modified mutate02.py script in pymol to perform this task, but
> I would need two extra "features":
>
> 1) the script would need to save the file with a different name. For
> example, load test.pdb, mutate all residues to lysine and then save the
> mutated version to test_K.pdb
> 2) the script would need to perform this task for all the pdb files in a
> directory.
>
> Right now, I am not concerned about the possible rotamers of lysine, any
> lysine rotamer would work.
> Could anyone give a hint on how to do it ?
> Thanks !
> Fabio.
>
>
>
> --
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> ___
> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

[PyMOL] Mutate residues in batch mode

2011-09-22 Thread Fabio Gozzo
Hi Pymolers,

I need to perform a batch operation but I need a help with script
modification.
A have a set (~100) of pdb files that I would like to mutate all residues to
lysine. I modified mutate02.py script in pymol to perform this task, but I
would need two extra "features":

1) the script would need to save the file with a different name. For
example, load test.pdb, mutate all residues to lysine and then save the
mutated version to test_K.pdb
2) the script would need to perform this task for all the pdb files in a
directory.

Right now, I am not concerned about the possible rotamers of lysine, any
lysine rotamer would work.
Could anyone give a hint on how to do it ?
Thanks !
Fabio.
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net