Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
Awesome, thanks so much Jared for your usefull suggestions! all the best james вт, 25 июн. 2019 г. в 22:00, Jared Sampson : > > Hi James - Glad you got it working. > > > chains_array = ["A", "B"] > > If you want a list of chains without having to hard-code them, try the > `get_chains` command.

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread Jared Sampson
Hi James - Glad you got it working. > chains_array = ["A", "B"] If you want a list of chains without having to hard-code them, try the `get_chains` command. ``` chains_array = cmd.get_chains() ``` > cmd.load('${pdb}') > cmd.alter('chain ' + '+'.join(chains_array), 'chain=\"\"') Alternatively,

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
I have got it, it works now! in my example the double quotes were not escaped in pymol script :-) the only (more python-oriented) question, would it be possible to indicate chains_array for all letters A-Z (e.g. using some python regex, rather just for A and B, chains_array = ["A", "B"], like in m

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
I actually tried to do like that still defining chains_array = ["A", "B"] inside of pymol script and use external bash loop to loop over pdbs but it does not works ;( #!/bin/bash # this script rename chains in pdb to "empty" chain home=$(pwd) pdb_folder=$home/pdbs output=$home/output rm -r $output

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
yes, actually it is better because we avoid looping! and how it would be possible to use array provided in the externall shell? #!/bin/bash pdb="final.pdb" output=$(pwd) # array given in bash chains_array=('A' 'B') # chains are cutted by pymol pymol -c -d " cmd.load('${pdb}') cmd.alter('chain '

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread Thomas Holder
If you want to rename multiple chains at once, make a selection like (chain A+B+C). This list selection syntax is documented here: https://pymolwiki.org/index.php/Property_Selectors cmd.load(pdb) cmd.alter('chain ' + '+'.join(chains_array), 'chain=""') cmd.save('output.pdb') Cheers, Thomas

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
in python version I have got it # to be run with PyMOL: #pymol -ckqr pymol_cut_off.py cut_off.py # from pymol import cmd pdb = "final.pdb" chains_array = ["A", "B"] # two chains will be cuted for chain in chains_array: cmd.load(pdb) cmd.alter('chain ' + chain, 'chain=

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
OK Lorenzo, thank you ! As an alternative question, would it be possible to put that loop while renaming of the chains in the processed PBD within the bash loop? Here is an idea #!/bin/bash # this script rename chains in pdb to "empty" chain pdb="my.pdb" output=$(pwd) # chain array is provided

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
thanks so much Thomas, for this example! Actually, your python script does exactly what my bash script - produces number of pdbs for each of the renamed chain. I would like rather to produce at the end ONE pdb with all chains renamed to empty chain... I guess I need to save the result outside of t

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread Lorenzo Gaifas
Hi James, not sure if it's relevant in this case, but you might also want to use retain_order, to avoid messing up your pdbs. https://pymolwiki.org/index.php/Retain_order Cheers, Lorenzo Il giorno mar 25 giu 2019 alle ore 16:04 Thomas Holder < thomas.hol...@schrodinger.com> ha scritto: > > gene

[PyMOL] `selection` argument in load_traj

2019-06-25 Thread Lorenzo Gaifas
Dear pymol users, What is the purpose of the `selection` argument in the `load_traj` command? My intuition would say that it allows to somehow select which atoms to load into pymol before the actual loading happens. However, it seems to do nothing whatsoever. What am I missing? Thanks, Lorenzo _

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread Thomas Holder
> generally if I integrate a pymol silent script inside my > bash script, I do not need to use cmd.* syntax, right? Correct. The -d argument takes PyMOL commands, like a .pml script. Python syntax is optional. Python syntax (cmd.*) is necessary and most useful if you write a Python script (.py

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
one extra programming question: imagine now in my pdb I have severals chain which I would like to rename to blank chain. I can do it simply like this # a case for 3 chains to be renamed #!/bin/bash pdb="my.pdb" output=$(pwd) pymol -c -d " cmd.load('${pdb}') cmd.alter('(chain A)', 'chain=\"\"') c

Re: [PyMOL] Thermal ellipsoid plot

2019-06-25 Thread koji naka
Dear Mr. Thomas Holder, Thank you very much for your kind reply. I am very happy to know the scale factor for the 50% probability, but I don't understand well. >From the table, can I take a value the scale? For example, in case of 30% probability, is it ok to set " set sphere_scale, 1.1932"? or n

Re: [PyMOL] Thermal ellipsoid plot

2019-06-25 Thread Thomas Holder
Hi Koji, Interesting question, I wasn't aware of the ellipsoid_probability setting. The probability to radius conversion is done with a lookup table, see: https://github.com/schrodinger/pymol-open-source/blob/d1359f125d/layer2/RepEllipsoid.cpp#L114 To get sphere scaling equivalent of ellipsoid_p

Re: [PyMOL] PDB post-processing and TER records

2019-06-25 Thread Thomas Holder
Hi James, pdb_use_ter_records works in PyMOL 2.3.0, but not in previous versions (was broken and then removed). See https://pymolwiki.org/index.php/pdb_use_ter_records Cheers, Thomas > On Jun 25, 2019, at 10:25 AM, James Starlight wrote: > > Dear Pymol Users! > > I need to process input P

[PyMOL] PDB post-processing and TER records

2019-06-25 Thread James Starlight
Dear Pymol Users! I need to process input PDB via pymol (this time no need to do it via no-gui mode!!) to remove chain id from PDB. I am using alter command to do it with the following syntax #rename chain A to phantom chain :-) alter (chain A),chain='' the problem that in my initial PDBs there

Re: [PyMOL] counting number of standard amino acids in PDB

2019-06-25 Thread James Starlight
Thank so much Jared! So here is modified script: #!/bin/bash pdb="./NpXynWT_apo_340K_MD_multi_0434.pdb" LENGTH="$(pymol -cQ -d " from pymol import cmd load ${pdb}, tmp sel = 'tmp and polymer' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) ")" echo $LENGTH I guess