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

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

2019-06-24 Thread Jared Sampson
Hi James -  The PyMOL version you are using is quite old, and doesn't support the 'polymer.protein' selector.  Try using just 'polymer' instead. Hope that helps. Jared On June 24, 2019 at 11:58:54 AM, James Starlight (jmsstarli...@gmail.com) wrote: hi Jared, I have tried to use your

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

2019-06-24 Thread James Starlight
hi Jared, I have tried to use your script putting it into my test.sh script I only changed the selection statement in sel = 'tmp and polymer.protein' instead of sel = 'tmp and chain A and polymer.protein' since in my protein there is no chains assigned pdb="./NpXynWT_apo_340K_MD_multi_0434.pdb"

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

2019-06-24 Thread Jared Sampson
Hi James -  You can give multiple commands by leaving the quote open as you did on the first line (see Thomas' post from a day or two ago), but the `print` statement, even though it is valid Python 2, will not work across line breaks as written unless inside a `python` / `python end` block

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

2019-06-24 Thread James Starlight
i also tried more simple sollution directly from terminal but it doesn't work also pymol -c -d " from pymol import cmd cmd.load('my.pdb') cmd.count_atoms('n. CA') " actually what I do need is to compute number of residues and store it in a variable (inside of my shell script) пн, 24

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

2019-06-24 Thread James Starlight
Thank you, Jared! how do you think would it be possible to run this command from no-gui pymol? pymol -c -d " from pymol import cmd print len( set( [(i.chain,i.resi,i.resn) for i in cmd.get_model(selection).atom] ) ) " ? пн, 24 июн. 2019 г. в 16:17, Jared Sampson : > > Hi James - > > Do

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

2019-06-24 Thread Jared Sampson
Hi James -  Do any of the options from this previous BB discussion help? https://sourceforge.net/p/pymol/mailman/message/28466955/ Cheers, Jared On June 24, 2019 at 8:13:47 AM, James Starlight (jmsstarli...@gmail.com) wrote: Dear Pymol Users, that is not very related to pymol question but