You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(13) |
Nov
(22) |
Dec
(35) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(33) |
Feb
(46) |
Mar
(56) |
Apr
(29) |
May
(56) |
Jun
(30) |
Jul
(64) |
Aug
(54) |
Sep
(86) |
Oct
(106) |
Nov
(50) |
Dec
(67) |
2003 |
Jan
(78) |
Feb
(98) |
Mar
(51) |
Apr
(95) |
May
(53) |
Jun
(103) |
Jul
(93) |
Aug
(64) |
Sep
(87) |
Oct
(93) |
Nov
(78) |
Dec
(86) |
2004 |
Jan
(83) |
Feb
(90) |
Mar
(64) |
Apr
(112) |
May
(103) |
Jun
(57) |
Jul
(101) |
Aug
(84) |
Sep
(92) |
Oct
(96) |
Nov
(86) |
Dec
(32) |
2005 |
Jan
(88) |
Feb
(108) |
Mar
(111) |
Apr
(107) |
May
(120) |
Jun
(134) |
Jul
(143) |
Aug
(129) |
Sep
(75) |
Oct
(171) |
Nov
(125) |
Dec
(65) |
2006 |
Jan
(95) |
Feb
(105) |
Mar
(114) |
Apr
(124) |
May
(87) |
Jun
(66) |
Jul
(88) |
Aug
(65) |
Sep
(71) |
Oct
(92) |
Nov
(94) |
Dec
(60) |
2007 |
Jan
(81) |
Feb
(84) |
Mar
(82) |
Apr
(68) |
May
(58) |
Jun
(80) |
Jul
(30) |
Aug
(47) |
Sep
(68) |
Oct
(92) |
Nov
(59) |
Dec
(17) |
2008 |
Jan
(69) |
Feb
(81) |
Mar
(60) |
Apr
(34) |
May
(47) |
Jun
(65) |
Jul
(46) |
Aug
(49) |
Sep
(84) |
Oct
(43) |
Nov
(33) |
Dec
(30) |
2009 |
Jan
(62) |
Feb
(48) |
Mar
(123) |
Apr
(73) |
May
(72) |
Jun
(69) |
Jul
(78) |
Aug
(72) |
Sep
(99) |
Oct
(82) |
Nov
(70) |
Dec
(53) |
2010 |
Jan
(112) |
Feb
(95) |
Mar
(127) |
Apr
(110) |
May
(135) |
Jun
(91) |
Jul
(91) |
Aug
(79) |
Sep
(136) |
Oct
(63) |
Nov
(38) |
Dec
(64) |
2011 |
Jan
(59) |
Feb
(109) |
Mar
(191) |
Apr
(130) |
May
(94) |
Jun
(90) |
Jul
(89) |
Aug
(127) |
Sep
(135) |
Oct
(113) |
Nov
(136) |
Dec
(140) |
2012 |
Jan
(158) |
Feb
(131) |
Mar
(151) |
Apr
(88) |
May
(121) |
Jun
(85) |
Jul
(82) |
Aug
(56) |
Sep
(55) |
Oct
(125) |
Nov
(87) |
Dec
(65) |
2013 |
Jan
(81) |
Feb
(64) |
Mar
(90) |
Apr
(77) |
May
(80) |
Jun
(92) |
Jul
(92) |
Aug
(70) |
Sep
(69) |
Oct
(60) |
Nov
(99) |
Dec
(50) |
2014 |
Jan
(89) |
Feb
(66) |
Mar
(52) |
Apr
(70) |
May
(68) |
Jun
(44) |
Jul
(68) |
Aug
(81) |
Sep
(152) |
Oct
(106) |
Nov
(74) |
Dec
(57) |
2015 |
Jan
(93) |
Feb
(48) |
Mar
(60) |
Apr
(107) |
May
(82) |
Jun
(64) |
Jul
(74) |
Aug
(38) |
Sep
(49) |
Oct
(99) |
Nov
(105) |
Dec
(51) |
2016 |
Jan
(68) |
Feb
(87) |
Mar
(55) |
Apr
(90) |
May
(68) |
Jun
(25) |
Jul
(25) |
Aug
(41) |
Sep
(35) |
Oct
(55) |
Nov
(24) |
Dec
(26) |
2017 |
Jan
(59) |
Feb
(49) |
Mar
(24) |
Apr
(50) |
May
(45) |
Jun
(63) |
Jul
(36) |
Aug
(26) |
Sep
(22) |
Oct
(23) |
Nov
(26) |
Dec
(29) |
2018 |
Jan
(17) |
Feb
(21) |
Mar
(30) |
Apr
(34) |
May
(24) |
Jun
(47) |
Jul
(65) |
Aug
(30) |
Sep
(24) |
Oct
(52) |
Nov
(21) |
Dec
(17) |
2019 |
Jan
(9) |
Feb
(39) |
Mar
(32) |
Apr
(22) |
May
(30) |
Jun
(69) |
Jul
(40) |
Aug
(48) |
Sep
(17) |
Oct
(26) |
Nov
(30) |
Dec
(19) |
2020 |
Jan
(32) |
Feb
(26) |
Mar
(16) |
Apr
(34) |
May
(50) |
Jun
(87) |
Jul
(51) |
Aug
(23) |
Sep
(25) |
Oct
(48) |
Nov
(32) |
Dec
(6) |
2021 |
Jan
(12) |
Feb
(31) |
Mar
(15) |
Apr
(31) |
May
(13) |
Jun
(13) |
Jul
(24) |
Aug
(9) |
Sep
(11) |
Oct
(28) |
Nov
(26) |
Dec
(25) |
2022 |
Jan
(47) |
Feb
(22) |
Mar
(22) |
Apr
(12) |
May
(4) |
Jun
(26) |
Jul
(17) |
Aug
(2) |
Sep
(13) |
Oct
(6) |
Nov
(13) |
Dec
(4) |
2023 |
Jan
(7) |
Feb
(6) |
Mar
(13) |
Apr
(2) |
May
(25) |
Jun
(13) |
Jul
(12) |
Aug
(10) |
Sep
(5) |
Oct
(13) |
Nov
(19) |
Dec
(7) |
2024 |
Jan
(3) |
Feb
(12) |
Mar
(1) |
Apr
(13) |
May
(11) |
Jun
|
Jul
(20) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
(4) |
Dec
(6) |
2025 |
Jan
(16) |
Feb
(8) |
Mar
(10) |
Apr
(6) |
May
(13) |
Jun
(7) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Sarameri, J. <jes...@he...> - 2019-06-26 06:23:19
|
Hello! (English is not my native language; please excuse typing errors.) Goal is to recolor molecule so it stays that way after the edit. This is how I thought it would work: Lets start by opening any molecule (like downloading 5jh0.cif from https://www.rcsb.org/structure/5jh0) Changed the color of the molecule to grey, save as session (.pse file), open it and still grey, great! But if I want to export to molecule (.pdb for example), open the molecule, no changes applied. Tried to change Saved state settings and different formats but no effect. No error messages either. I did RTFM and STFW not able to find answer. (If I missed it, feel free to send pics with red circles and arrows to highlight it.) Software and hardware used: Open source PyMOL version 2.1.0. Windows 10 Lenovo X280 Laptop Many thanks for help incase someone else might encounter this problem. Regards, Jesse Sarameri |
From: Jared S. <jar...@co...> - 2019-06-25 20:00:10
|
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, if you want to remove all the chain IDs (which it appears you might), you don't need a list of chains at all, and can just do: ``` alter all, chain='' ``` Hope that helps. Cheers, Jared On June 25, 2019 at 11:48:32 AM, James Starlight (jms...@gm...) wrote: 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 my example? вт, 25 июн. 2019 г. в 17:22, James Starlight <jms...@gm...>: > > 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 > mkdir $output > > #pymol -cQkd " > for pdb in "${pdb_folder}"/*.pdb ; do > pdb_name2=$(basename "${pdb}") > pdb_name="${pdb_name2/pdb}" > pymol -c -d " > from pymol import cmd > chains_array = ["A", "B"] > cmd.load('${pdb}') > cmd.alter('chain ' + '+'.join(chains_array), 'chain=\"\"') > cmd.set('pdb_use_ter_records', 1) > cmd.set('retain_order', 1) > cmd.save('${output}/output_without'+"".join(chains_array) + '.pdb') > " > $output/pymol_${pdb_name}.log > done > > вт, 25 июн. 2019 г. в 16:58, James Starlight <jms...@gm...>: > > > > 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 ' + '+'.join($chains_array), 'chain=\"\"') > > cmd.set('pdb_use_ter_records', 1) > > cmd.set('retain_order', 1) > > cmd.save('output_without'+"".join($chains_array) + '.pdb') > > " > > > > вт, 25 июн. 2019 г. в 16:47, Thomas Holder <tho...@sc...>: > > > > > > 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 > > > > > > > > > > On Jun 25, 2019, at 4:14 PM, James Starlight <jms...@gm...> wrote: > > > > > > > > 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 the loop something like this > > > > > > > > ################ hop hey lalaley ##### > > > > from pymol import cmd > > > > pdb = "Ev_complex_model_final.pdb" > > > > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > > > > > > > # loop over chains to rename it > > > > for chain in chains_array: > > > > cmd.load(pdb) > > > > cmd.alter('chain ' + chain, 'chain=""') > > > > cmd.delete('*') > > > > ###################################### > > > > > > > > # save output as pdb > > > > # I need to add something in the name of output indicating how much > > > > chains have been renamed > > > > # like output_withoutAB.pdb > > > > cmd.save('output_' + '.pdb') > > > > > > > > thanks in advance for help! > > > > > > -- > > > Thomas Holder > > > PyMOL Principal Developer > > > Schrödinger, Inc. > > > _______________________________________________ PyMOL-users mailing list Archives: http://www.mail-archive.com/pym...@li... Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: James S. <jms...@gm...> - 2019-06-25 15:46:41
|
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 my example? вт, 25 июн. 2019 г. в 17:22, James Starlight <jms...@gm...>: > > 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 > mkdir $output > > #pymol -cQkd " > for pdb in "${pdb_folder}"/*.pdb ; do > pdb_name2=$(basename "${pdb}") > pdb_name="${pdb_name2/pdb}" > pymol -c -d " > from pymol import cmd > chains_array = ["A", "B"] > cmd.load('${pdb}') > cmd.alter('chain ' + '+'.join(chains_array), 'chain=\"\"') > cmd.set('pdb_use_ter_records', 1) > cmd.set('retain_order', 1) > cmd.save('${output}/output_without'+"".join(chains_array) + '.pdb') > " > $output/pymol_${pdb_name}.log > done > > вт, 25 июн. 2019 г. в 16:58, James Starlight <jms...@gm...>: > > > > 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 ' + '+'.join($chains_array), 'chain=\"\"') > > cmd.set('pdb_use_ter_records', 1) > > cmd.set('retain_order', 1) > > cmd.save('output_without'+"".join($chains_array) + '.pdb') > > " > > > > вт, 25 июн. 2019 г. в 16:47, Thomas Holder <tho...@sc...>: > > > > > > 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 > > > > > > > > > > On Jun 25, 2019, at 4:14 PM, James Starlight <jms...@gm...> wrote: > > > > > > > > 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 the loop something like this > > > > > > > > ################ hop hey lalaley ##### > > > > from pymol import cmd > > > > pdb = "Ev_complex_model_final.pdb" > > > > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > > > > > > > # loop over chains to rename it > > > > for chain in chains_array: > > > > cmd.load(pdb) > > > > cmd.alter('chain ' + chain, 'chain=""') > > > > cmd.delete('*') > > > > ###################################### > > > > > > > > # save output as pdb > > > > # I need to add something in the name of output indicating how much > > > > chains have been renamed > > > > # like output_withoutAB.pdb > > > > cmd.save('output_' + '.pdb') > > > > > > > > thanks in advance for help! > > > > > > -- > > > Thomas Holder > > > PyMOL Principal Developer > > > Schrödinger, Inc. > > > |
From: James S. <jms...@gm...> - 2019-06-25 15:22:21
|
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 mkdir $output #pymol -cQkd " for pdb in "${pdb_folder}"/*.pdb ; do pdb_name2=$(basename "${pdb}") pdb_name="${pdb_name2/pdb}" pymol -c -d " from pymol import cmd chains_array = ["A", "B"] cmd.load('${pdb}') cmd.alter('chain ' + '+'.join(chains_array), 'chain=\"\"') cmd.set('pdb_use_ter_records', 1) cmd.set('retain_order', 1) cmd.save('${output}/output_without'+"".join(chains_array) + '.pdb') " > $output/pymol_${pdb_name}.log done вт, 25 июн. 2019 г. в 16:58, James Starlight <jms...@gm...>: > > 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 ' + '+'.join($chains_array), 'chain=\"\"') > cmd.set('pdb_use_ter_records', 1) > cmd.set('retain_order', 1) > cmd.save('output_without'+"".join($chains_array) + '.pdb') > " > > вт, 25 июн. 2019 г. в 16:47, Thomas Holder <tho...@sc...>: > > > > 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 > > > > > > > On Jun 25, 2019, at 4:14 PM, James Starlight <jms...@gm...> wrote: > > > > > > 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 the loop something like this > > > > > > ################ hop hey lalaley ##### > > > from pymol import cmd > > > pdb = "Ev_complex_model_final.pdb" > > > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > > > > > # loop over chains to rename it > > > for chain in chains_array: > > > cmd.load(pdb) > > > cmd.alter('chain ' + chain, 'chain=""') > > > cmd.delete('*') > > > ###################################### > > > > > > # save output as pdb > > > # I need to add something in the name of output indicating how much > > > chains have been renamed > > > # like output_withoutAB.pdb > > > cmd.save('output_' + '.pdb') > > > > > > thanks in advance for help! > > > > -- > > Thomas Holder > > PyMOL Principal Developer > > Schrödinger, Inc. > > |
From: James S. <jms...@gm...> - 2019-06-25 14:59:02
|
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 ' + '+'.join($chains_array), 'chain=\"\"') cmd.set('pdb_use_ter_records', 1) cmd.set('retain_order', 1) cmd.save('output_without'+"".join($chains_array) + '.pdb') " вт, 25 июн. 2019 г. в 16:47, Thomas Holder <tho...@sc...>: > > 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 > > > > On Jun 25, 2019, at 4:14 PM, James Starlight <jms...@gm...> wrote: > > > > 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 the loop something like this > > > > ################ hop hey lalaley ##### > > from pymol import cmd > > pdb = "Ev_complex_model_final.pdb" > > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > > > # loop over chains to rename it > > for chain in chains_array: > > cmd.load(pdb) > > cmd.alter('chain ' + chain, 'chain=""') > > cmd.delete('*') > > ###################################### > > > > # save output as pdb > > # I need to add something in the name of output indicating how much > > chains have been renamed > > # like output_withoutAB.pdb > > cmd.save('output_' + '.pdb') > > > > thanks in advance for help! > > -- > Thomas Holder > PyMOL Principal Developer > Schrödinger, Inc. > |
From: Thomas H. <tho...@sc...> - 2019-06-25 14:47:13
|
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 > On Jun 25, 2019, at 4:14 PM, James Starlight <jms...@gm...> wrote: > > 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 the loop something like this > > ################ hop hey lalaley ##### > from pymol import cmd > pdb = "Ev_complex_model_final.pdb" > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > # loop over chains to rename it > for chain in chains_array: > cmd.load(pdb) > cmd.alter('chain ' + chain, 'chain=""') > cmd.delete('*') > ###################################### > > # save output as pdb > # I need to add something in the name of output indicating how much > chains have been renamed > # like output_withoutAB.pdb > cmd.save('output_' + '.pdb') > > thanks in advance for help! -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. |
From: James S. <jms...@gm...> - 2019-06-25 14:37:48
|
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=""') cmd.set('pdb_use_ter_records', 1) cmd.set('retain_order', 1) cmd.save('output_without'+"".join(chains_array) + '.pdb') now the question would it be possible to do the same but in my bash script? вт, 25 июн. 2019 г. в 16:20, James Starlight <jms...@gm...>: > > 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 in a shell array > chains=('A' 'B') > > # create several pdbs without individual chains > #pymol -cQkd " > pymol -c -d " > # I need to add loop within PYMOL over the elements of external arrays > for chains > # mb for i in chains: > cmd.load('${pdb}') > cmd.alter('(chain $i)', 'chain=\"\"') > cmd.set('pdb_use_ter_records', 1) > cmd.set('retain_order', 1) > # close the loop and save final output as 1 pdb > cmd.save('${output}/output_withoutAB.pdb','all') > " > > вт, 25 июн. 2019 г. в 16:14, James Starlight <jms...@gm...>: > > > > 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 the loop something like this > > > > ################ hop hey lalaley ##### > > from pymol import cmd > > pdb = "Ev_complex_model_final.pdb" > > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > > > # loop over chains to rename it > > for chain in chains_array: > > cmd.load(pdb) > > cmd.alter('chain ' + chain, 'chain=""') > > cmd.delete('*') > > ###################################### > > > > # save output as pdb > > # I need to add something in the name of output indicating how much > > chains have been renamed > > # like output_withoutAB.pdb > > cmd.save('output_' + '.pdb') > > > > thanks in advance for help! > > > > вт, 25 июн. 2019 г. в 16:03, Thomas Holder <tho...@sc...>: > > > > > > > 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 extension) and run that with PyMOL. You could write your multi-chains loop as a Python script: > > > > > > ################ example.py ########## > > > from pymol import cmd > > > pdb = "my.pdb" > > > chains_arrays = ["A", "B", "C", "D", "E", "F", "G"] > > > > > > for chain in chains_array: > > > cmd.load(pdb) > > > cmd.alter('chain ' + chain, 'chain=""') > > > cmd.save('output_' + chain + '.pdb') > > > cmd.delete('*') > > > ###################################### > > > > > > Then run it with PyMOL: > > > pymol -ckqr example.py > > > > > > See also: > > > https://pymolwiki.org/index.php/Launching_From_a_Script > > > https://pymolwiki.org/index.php/Python_Integration > > > > > > Cheers, > > > Thomas > > > > > > > On Jun 25, 2019, at 3:08 PM, James Starlight <jms...@gm...> wrote: > > > > > > > > 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=\"\"') > > > > cmd.alter('(chain B)', 'chain=\"\"') > > > > cmd.alter('(chain C)', 'chain=\"\"') > > > > cmd.save('${output}/output.pdb','all') > > > > " > > > > > > > > or for multi-chain protein I can alternatively create external loop, > > > > thus running pymol 3 times iteratively (which is not good realization) > > > > providin array info from external shell session > > > > > > > > # this example save 7 different pdbs renaming one chain in each of them > > > > #!/bin/bash > > > > pdb="my.pdb" > > > > output=$(pwd) > > > > chains_arrays=( A B C D E F G ) > > > > > > > > for i in "$chains_array[@]}"; do > > > > pymol -c -d " > > > > cmd.load('${pdb}') > > > > cmd.alter('(chain $i)', 'chain=\"\"') > > > > cmd.save('${output}/output_$i.pdb','all') > > > > " > > > > done > > > > > > > > would it be possible rather to make an array and loop inside the pymol > > > > to rename all chains into the blank chain during one execution of > > > > pymol? > > > > > > > > Thanks in advance! > > > > > > > > вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: > > > >> > > > >> I have got the idea! > > > >> thank you so much Thomas! > > > >> One question: generally if I integrate a pymol silent script inside my > > > >> bash script, I do not need to use cmd.* syntax, right? In what cases > > > >> cmd.* sytax might be usefull? > > > >> > > > >> Thank you again! > > > >> > > > >> вт, 25 июн. 2019 г. в 12:05, Thomas Holder <tho...@sc...>: > > > >>> > > > >>> > > > >>>> On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> wrote: > > > >>>> > > > >>>> so what I need is just to update my pymol, keep using the same command? > > > >>> > > > >>> Yes > > > >>> > > > >>>> P.S.would the following integration of the code into bash script be > > > >>>> usefull to remove chains in no gui mode? > > > >>>> > > > >>>> pymol -cQkd " > > > >>>> from pymol import cmd > > > >>>> fetch $pdb, type=pdb, tmp > > > >>>> cmd.alter('(chain A)',chain='') > > > >>>> " > > > >>>> I am not sure whether I used here cmd.alter in correct way .. > > > >>> > > > >>> > > > >>> With fetch, use "async=0" or use Python syntax. And keyword arguments (type=) must be after positional arguments (tmp). > > > >>> > > > >>> It's easier if you don't use Python syntax for alter, otherwise you'll need three levels of nested quotes, which gets ugly: > > > >>> > > > >>> pymol -cQkd " > > > >>> fetch $pdb, tmp, type=pdb, async=0 > > > >>> alter (chain A), chain='' > > > >>> " > > > >>> > > > >>> With Python syntax (note the ugly escaping of quotes): > > > >>> > > > >>> pymol -cQkd " > > > >>> cmd.fetch('$pdb', 'tmp', type='pdb') > > > >>> cmd.alter('(chain A)', 'chain=\"\"') > > > >>> " > > > >>> > > > >>> Cheers, > > > >>> Thomas > > > >>> > > > >>> -- > > > >>> Thomas Holder > > > >>> PyMOL Principal Developer > > > >>> Schrödinger, Inc. > > > >>> > > > > > > -- > > > Thomas Holder > > > PyMOL Principal Developer > > > Schrödinger, Inc. > > > |
From: James S. <jms...@gm...> - 2019-06-25 14:20:50
|
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 in a shell array chains=('A' 'B') # create several pdbs without individual chains #pymol -cQkd " pymol -c -d " # I need to add loop within PYMOL over the elements of external arrays for chains # mb for i in chains: cmd.load('${pdb}') cmd.alter('(chain $i)', 'chain=\"\"') cmd.set('pdb_use_ter_records', 1) cmd.set('retain_order', 1) # close the loop and save final output as 1 pdb cmd.save('${output}/output_withoutAB.pdb','all') " вт, 25 июн. 2019 г. в 16:14, James Starlight <jms...@gm...>: > > 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 the loop something like this > > ################ hop hey lalaley ##### > from pymol import cmd > pdb = "Ev_complex_model_final.pdb" > chains_array = ["A", "B"] # add more chains in case of more complex pdb > > # loop over chains to rename it > for chain in chains_array: > cmd.load(pdb) > cmd.alter('chain ' + chain, 'chain=""') > cmd.delete('*') > ###################################### > > # save output as pdb > # I need to add something in the name of output indicating how much > chains have been renamed > # like output_withoutAB.pdb > cmd.save('output_' + '.pdb') > > thanks in advance for help! > > вт, 25 июн. 2019 г. в 16:03, Thomas Holder <tho...@sc...>: > > > > > 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 extension) and run that with PyMOL. You could write your multi-chains loop as a Python script: > > > > ################ example.py ########## > > from pymol import cmd > > pdb = "my.pdb" > > chains_arrays = ["A", "B", "C", "D", "E", "F", "G"] > > > > for chain in chains_array: > > cmd.load(pdb) > > cmd.alter('chain ' + chain, 'chain=""') > > cmd.save('output_' + chain + '.pdb') > > cmd.delete('*') > > ###################################### > > > > Then run it with PyMOL: > > pymol -ckqr example.py > > > > See also: > > https://pymolwiki.org/index.php/Launching_From_a_Script > > https://pymolwiki.org/index.php/Python_Integration > > > > Cheers, > > Thomas > > > > > On Jun 25, 2019, at 3:08 PM, James Starlight <jms...@gm...> wrote: > > > > > > 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=\"\"') > > > cmd.alter('(chain B)', 'chain=\"\"') > > > cmd.alter('(chain C)', 'chain=\"\"') > > > cmd.save('${output}/output.pdb','all') > > > " > > > > > > or for multi-chain protein I can alternatively create external loop, > > > thus running pymol 3 times iteratively (which is not good realization) > > > providin array info from external shell session > > > > > > # this example save 7 different pdbs renaming one chain in each of them > > > #!/bin/bash > > > pdb="my.pdb" > > > output=$(pwd) > > > chains_arrays=( A B C D E F G ) > > > > > > for i in "$chains_array[@]}"; do > > > pymol -c -d " > > > cmd.load('${pdb}') > > > cmd.alter('(chain $i)', 'chain=\"\"') > > > cmd.save('${output}/output_$i.pdb','all') > > > " > > > done > > > > > > would it be possible rather to make an array and loop inside the pymol > > > to rename all chains into the blank chain during one execution of > > > pymol? > > > > > > Thanks in advance! > > > > > > вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: > > >> > > >> I have got the idea! > > >> thank you so much Thomas! > > >> One question: generally if I integrate a pymol silent script inside my > > >> bash script, I do not need to use cmd.* syntax, right? In what cases > > >> cmd.* sytax might be usefull? > > >> > > >> Thank you again! > > >> > > >> вт, 25 июн. 2019 г. в 12:05, Thomas Holder <tho...@sc...>: > > >>> > > >>> > > >>>> On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> wrote: > > >>>> > > >>>> so what I need is just to update my pymol, keep using the same command? > > >>> > > >>> Yes > > >>> > > >>>> P.S.would the following integration of the code into bash script be > > >>>> usefull to remove chains in no gui mode? > > >>>> > > >>>> pymol -cQkd " > > >>>> from pymol import cmd > > >>>> fetch $pdb, type=pdb, tmp > > >>>> cmd.alter('(chain A)',chain='') > > >>>> " > > >>>> I am not sure whether I used here cmd.alter in correct way .. > > >>> > > >>> > > >>> With fetch, use "async=0" or use Python syntax. And keyword arguments (type=) must be after positional arguments (tmp). > > >>> > > >>> It's easier if you don't use Python syntax for alter, otherwise you'll need three levels of nested quotes, which gets ugly: > > >>> > > >>> pymol -cQkd " > > >>> fetch $pdb, tmp, type=pdb, async=0 > > >>> alter (chain A), chain='' > > >>> " > > >>> > > >>> With Python syntax (note the ugly escaping of quotes): > > >>> > > >>> pymol -cQkd " > > >>> cmd.fetch('$pdb', 'tmp', type='pdb') > > >>> cmd.alter('(chain A)', 'chain=\"\"') > > >>> " > > >>> > > >>> Cheers, > > >>> Thomas > > >>> > > >>> -- > > >>> Thomas Holder > > >>> PyMOL Principal Developer > > >>> Schrödinger, Inc. > > >>> > > > > -- > > Thomas Holder > > PyMOL Principal Developer > > Schrödinger, Inc. > > |
From: James S. <jms...@gm...> - 2019-06-25 14:14:42
|
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 the loop something like this ################ hop hey lalaley ##### from pymol import cmd pdb = "Ev_complex_model_final.pdb" chains_array = ["A", "B"] # add more chains in case of more complex pdb # loop over chains to rename it for chain in chains_array: cmd.load(pdb) cmd.alter('chain ' + chain, 'chain=""') cmd.delete('*') ###################################### # save output as pdb # I need to add something in the name of output indicating how much chains have been renamed # like output_withoutAB.pdb cmd.save('output_' + '.pdb') thanks in advance for help! вт, 25 июн. 2019 г. в 16:03, Thomas Holder <tho...@sc...>: > > > 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 extension) and run that with PyMOL. You could write your multi-chains loop as a Python script: > > ################ example.py ########## > from pymol import cmd > pdb = "my.pdb" > chains_arrays = ["A", "B", "C", "D", "E", "F", "G"] > > for chain in chains_array: > cmd.load(pdb) > cmd.alter('chain ' + chain, 'chain=""') > cmd.save('output_' + chain + '.pdb') > cmd.delete('*') > ###################################### > > Then run it with PyMOL: > pymol -ckqr example.py > > See also: > https://pymolwiki.org/index.php/Launching_From_a_Script > https://pymolwiki.org/index.php/Python_Integration > > Cheers, > Thomas > > > On Jun 25, 2019, at 3:08 PM, James Starlight <jms...@gm...> wrote: > > > > 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=\"\"') > > cmd.alter('(chain B)', 'chain=\"\"') > > cmd.alter('(chain C)', 'chain=\"\"') > > cmd.save('${output}/output.pdb','all') > > " > > > > or for multi-chain protein I can alternatively create external loop, > > thus running pymol 3 times iteratively (which is not good realization) > > providin array info from external shell session > > > > # this example save 7 different pdbs renaming one chain in each of them > > #!/bin/bash > > pdb="my.pdb" > > output=$(pwd) > > chains_arrays=( A B C D E F G ) > > > > for i in "$chains_array[@]}"; do > > pymol -c -d " > > cmd.load('${pdb}') > > cmd.alter('(chain $i)', 'chain=\"\"') > > cmd.save('${output}/output_$i.pdb','all') > > " > > done > > > > would it be possible rather to make an array and loop inside the pymol > > to rename all chains into the blank chain during one execution of > > pymol? > > > > Thanks in advance! > > > > вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: > >> > >> I have got the idea! > >> thank you so much Thomas! > >> One question: generally if I integrate a pymol silent script inside my > >> bash script, I do not need to use cmd.* syntax, right? In what cases > >> cmd.* sytax might be usefull? > >> > >> Thank you again! > >> > >> вт, 25 июн. 2019 г. в 12:05, Thomas Holder <tho...@sc...>: > >>> > >>> > >>>> On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> wrote: > >>>> > >>>> so what I need is just to update my pymol, keep using the same command? > >>> > >>> Yes > >>> > >>>> P.S.would the following integration of the code into bash script be > >>>> usefull to remove chains in no gui mode? > >>>> > >>>> pymol -cQkd " > >>>> from pymol import cmd > >>>> fetch $pdb, type=pdb, tmp > >>>> cmd.alter('(chain A)',chain='') > >>>> " > >>>> I am not sure whether I used here cmd.alter in correct way .. > >>> > >>> > >>> With fetch, use "async=0" or use Python syntax. And keyword arguments (type=) must be after positional arguments (tmp). > >>> > >>> It's easier if you don't use Python syntax for alter, otherwise you'll need three levels of nested quotes, which gets ugly: > >>> > >>> pymol -cQkd " > >>> fetch $pdb, tmp, type=pdb, async=0 > >>> alter (chain A), chain='' > >>> " > >>> > >>> With Python syntax (note the ugly escaping of quotes): > >>> > >>> pymol -cQkd " > >>> cmd.fetch('$pdb', 'tmp', type='pdb') > >>> cmd.alter('(chain A)', 'chain=\"\"') > >>> " > >>> > >>> Cheers, > >>> Thomas > >>> > >>> -- > >>> Thomas Holder > >>> PyMOL Principal Developer > >>> Schrödinger, Inc. > >>> > > -- > Thomas Holder > PyMOL Principal Developer > Schrödinger, Inc. > |
From: Lorenzo G. <br...@gm...> - 2019-06-25 14:10:25
|
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 < tho...@sc...> ha scritto: > > 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 extension) and run that with PyMOL. You could write your > multi-chains loop as a Python script: > > ################ example.py ########## > from pymol import cmd > pdb = "my.pdb" > chains_arrays = ["A", "B", "C", "D", "E", "F", "G"] > > for chain in chains_array: > cmd.load(pdb) > cmd.alter('chain ' + chain, 'chain=""') > cmd.save('output_' + chain + '.pdb') > cmd.delete('*') > ###################################### > > Then run it with PyMOL: > pymol -ckqr example.py > > See also: > https://pymolwiki.org/index.php/Launching_From_a_Script > https://pymolwiki.org/index.php/Python_Integration > > Cheers, > Thomas > > > On Jun 25, 2019, at 3:08 PM, James Starlight <jms...@gm...> > wrote: > > > > 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=\"\"') > > cmd.alter('(chain B)', 'chain=\"\"') > > cmd.alter('(chain C)', 'chain=\"\"') > > cmd.save('${output}/output.pdb','all') > > " > > > > or for multi-chain protein I can alternatively create external loop, > > thus running pymol 3 times iteratively (which is not good realization) > > providin array info from external shell session > > > > # this example save 7 different pdbs renaming one chain in each of them > > #!/bin/bash > > pdb="my.pdb" > > output=$(pwd) > > chains_arrays=( A B C D E F G ) > > > > for i in "$chains_array[@]}"; do > > pymol -c -d " > > cmd.load('${pdb}') > > cmd.alter('(chain $i)', 'chain=\"\"') > > cmd.save('${output}/output_$i.pdb','all') > > " > > done > > > > would it be possible rather to make an array and loop inside the pymol > > to rename all chains into the blank chain during one execution of > > pymol? > > > > Thanks in advance! > > > > вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: > >> > >> I have got the idea! > >> thank you so much Thomas! > >> One question: generally if I integrate a pymol silent script inside my > >> bash script, I do not need to use cmd.* syntax, right? In what cases > >> cmd.* sytax might be usefull? > >> > >> Thank you again! > >> > >> вт, 25 июн. 2019 г. в 12:05, Thomas Holder < > tho...@sc...>: > >>> > >>> > >>>> On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> > wrote: > >>>> > >>>> so what I need is just to update my pymol, keep using the same > command? > >>> > >>> Yes > >>> > >>>> P.S.would the following integration of the code into bash script be > >>>> usefull to remove chains in no gui mode? > >>>> > >>>> pymol -cQkd " > >>>> from pymol import cmd > >>>> fetch $pdb, type=pdb, tmp > >>>> cmd.alter('(chain A)',chain='') > >>>> " > >>>> I am not sure whether I used here cmd.alter in correct way .. > >>> > >>> > >>> With fetch, use "async=0" or use Python syntax. And keyword arguments > (type=) must be after positional arguments (tmp). > >>> > >>> It's easier if you don't use Python syntax for alter, otherwise you'll > need three levels of nested quotes, which gets ugly: > >>> > >>> pymol -cQkd " > >>> fetch $pdb, tmp, type=pdb, async=0 > >>> alter (chain A), chain='' > >>> " > >>> > >>> With Python syntax (note the ugly escaping of quotes): > >>> > >>> pymol -cQkd " > >>> cmd.fetch('$pdb', 'tmp', type='pdb') > >>> cmd.alter('(chain A)', 'chain=\"\"') > >>> " > >>> > >>> Cheers, > >>> Thomas > >>> > >>> -- > >>> Thomas Holder > >>> PyMOL Principal Developer > >>> Schrödinger, Inc. > >>> > > -- > Thomas Holder > PyMOL Principal Developer > Schrödinger, Inc. > > > > _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pym...@li... > Unsubscribe: > https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: Lorenzo G. <br...@gm...> - 2019-06-25 14:05:40
|
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 |
From: Thomas H. <tho...@sc...> - 2019-06-25 14:03:12
|
> 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 extension) and run that with PyMOL. You could write your multi-chains loop as a Python script: ################ example.py ########## from pymol import cmd pdb = "my.pdb" chains_arrays = ["A", "B", "C", "D", "E", "F", "G"] for chain in chains_array: cmd.load(pdb) cmd.alter('chain ' + chain, 'chain=""') cmd.save('output_' + chain + '.pdb') cmd.delete('*') ###################################### Then run it with PyMOL: pymol -ckqr example.py See also: https://pymolwiki.org/index.php/Launching_From_a_Script https://pymolwiki.org/index.php/Python_Integration Cheers, Thomas > On Jun 25, 2019, at 3:08 PM, James Starlight <jms...@gm...> wrote: > > 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=\"\"') > cmd.alter('(chain B)', 'chain=\"\"') > cmd.alter('(chain C)', 'chain=\"\"') > cmd.save('${output}/output.pdb','all') > " > > or for multi-chain protein I can alternatively create external loop, > thus running pymol 3 times iteratively (which is not good realization) > providin array info from external shell session > > # this example save 7 different pdbs renaming one chain in each of them > #!/bin/bash > pdb="my.pdb" > output=$(pwd) > chains_arrays=( A B C D E F G ) > > for i in "$chains_array[@]}"; do > pymol -c -d " > cmd.load('${pdb}') > cmd.alter('(chain $i)', 'chain=\"\"') > cmd.save('${output}/output_$i.pdb','all') > " > done > > would it be possible rather to make an array and loop inside the pymol > to rename all chains into the blank chain during one execution of > pymol? > > Thanks in advance! > > вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: >> >> I have got the idea! >> thank you so much Thomas! >> One question: generally if I integrate a pymol silent script inside my >> bash script, I do not need to use cmd.* syntax, right? In what cases >> cmd.* sytax might be usefull? >> >> Thank you again! >> >> вт, 25 июн. 2019 г. в 12:05, Thomas Holder <tho...@sc...>: >>> >>> >>>> On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> wrote: >>>> >>>> so what I need is just to update my pymol, keep using the same command? >>> >>> Yes >>> >>>> P.S.would the following integration of the code into bash script be >>>> usefull to remove chains in no gui mode? >>>> >>>> pymol -cQkd " >>>> from pymol import cmd >>>> fetch $pdb, type=pdb, tmp >>>> cmd.alter('(chain A)',chain='') >>>> " >>>> I am not sure whether I used here cmd.alter in correct way .. >>> >>> >>> With fetch, use "async=0" or use Python syntax. And keyword arguments (type=) must be after positional arguments (tmp). >>> >>> It's easier if you don't use Python syntax for alter, otherwise you'll need three levels of nested quotes, which gets ugly: >>> >>> pymol -cQkd " >>> fetch $pdb, tmp, type=pdb, async=0 >>> alter (chain A), chain='' >>> " >>> >>> With Python syntax (note the ugly escaping of quotes): >>> >>> pymol -cQkd " >>> cmd.fetch('$pdb', 'tmp', type='pdb') >>> cmd.alter('(chain A)', 'chain=\"\"') >>> " >>> >>> Cheers, >>> Thomas >>> >>> -- >>> Thomas Holder >>> PyMOL Principal Developer >>> Schrödinger, Inc. >>> -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. |
From: James S. <jms...@gm...> - 2019-06-25 13:09:11
|
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=\"\"') cmd.alter('(chain B)', 'chain=\"\"') cmd.alter('(chain C)', 'chain=\"\"') cmd.save('${output}/output.pdb','all') " or for multi-chain protein I can alternatively create external loop, thus running pymol 3 times iteratively (which is not good realization) providin array info from external shell session # this example save 7 different pdbs renaming one chain in each of them #!/bin/bash pdb="my.pdb" output=$(pwd) chains_arrays=( A B C D E F G ) for i in "$chains_array[@]}"; do pymol -c -d " cmd.load('${pdb}') cmd.alter('(chain $i)', 'chain=\"\"') cmd.save('${output}/output_$i.pdb','all') " done would it be possible rather to make an array and loop inside the pymol to rename all chains into the blank chain during one execution of pymol? Thanks in advance! вт, 25 июн. 2019 г. в 14:50, James Starlight <jms...@gm...>: > > I have got the idea! > thank you so much Thomas! > One question: generally if I integrate a pymol silent script inside my > bash script, I do not need to use cmd.* syntax, right? In what cases > cmd.* sytax might be usefull? > > Thank you again! > > вт, 25 июн. 2019 г. в 12:05, Thomas Holder <tho...@sc...>: > > > > > > > On Jun 25, 2019, at 11:48 AM, James Starlight <jms...@gm...> wrote: > > > > > > so what I need is just to update my pymol, keep using the same command? > > > > Yes > > > > > P.S.would the following integration of the code into bash script be > > > usefull to remove chains in no gui mode? > > > > > > pymol -cQkd " > > > from pymol import cmd > > > fetch $pdb, type=pdb, tmp > > > cmd.alter('(chain A)',chain='') > > > " > > > I am not sure whether I used here cmd.alter in correct way .. > > > > > > With fetch, use "async=0" or use Python syntax. And keyword arguments (type=) must be after positional arguments (tmp). > > > > It's easier if you don't use Python syntax for alter, otherwise you'll need three levels of nested quotes, which gets ugly: > > > > pymol -cQkd " > > fetch $pdb, tmp, type=pdb, async=0 > > alter (chain A), chain='' > > " > > > > With Python syntax (note the ugly escaping of quotes): > > > > pymol -cQkd " > > cmd.fetch('$pdb', 'tmp', type='pdb') > > cmd.alter('(chain A)', 'chain=\"\"') > > " > > > > Cheers, > > Thomas > > > > -- > > Thomas Holder > > PyMOL Principal Developer > > Schrödinger, Inc. > > |
From: koji n. <pas...@gm...> - 2019-06-25 10:26:40
|
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 not? I am sorry for bothering you again. Best regards, Koji 2019年6月25日(火) 18:49 Thomas Holder <tho...@sc...>: > 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_probability=0.5, you can do: > > set sphere_scale, 1.53820 > > I calculated this value with the following script: > > problevel = [ \ > 0.4299, 0.5479, 0.6334, 0.7035, 0.7644, \ > 0.8192, 0.8694, 0.9162, 0.9605, 1.0026, \ > 1.0430, 1.0821, 1.1200, 1.1570, 1.1932, \ > 1.2288, 1.2638, 1.2985, 1.3330, 1.3672, \ > 1.4013, 1.4354, 1.4695, 1.5037, 1.5382, \ > 1.5729, 1.6080, 1.6436, 1.6797, 1.7164, \ > 1.7540, 1.7924, 1.8318, 1.8724, 1.9144, \ > 1.9580, 2.0034, 2.0510, 2.1012, 2.1544, \ > 2.2114, 2.2730, 2.3404, 2.4153, 2.5003, \ > 2.5997, 2.7216, 2.8829, 3.1365, 6.0000 ] > > iprob = int((cmd.get_setting_float('ellipsoid_probability') + 0.01) * 50 - > 1) > pradius = problevel[iprob] > > cmd.set('sphere_scale', pradius * cmd.get_setting_float('ellipsoid_scale')) > > Hope this helps. > > Cheers, > Thomas > > > > On Jun 24, 2019, at 7:21 AM, koji naka <pas...@gm...> wrote: > > > > Dear all, > > > > The size of isotropic atoms plotted by using "alter all, vdw = > sqrt(b/8)/pi" and "show sphere" looks small compared with the size of > anisotropic atoms displayed by "show ellipsoid" in PyMOL default setting > with 50% probability. > > > > How can I plot the isotropic atoms with 50% probability? > > > > The data is a pdb file converted from a cif through Mercury software. > > > > Thank you very much for your help. > > > > Best regards, > > Koji > > > > > > _______________________________________________ > > PyMOL-users mailing list > > Archives: http://www.mail-archive.com/pym...@li... > > Unsubscribe: > https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe > > -- > Thomas Holder > PyMOL Principal Developer > Schrödinger, Inc. > > |
From: Thomas H. <tho...@sc...> - 2019-06-25 09:49:19
|
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_probability=0.5, you can do: set sphere_scale, 1.53820 I calculated this value with the following script: problevel = [ \ 0.4299, 0.5479, 0.6334, 0.7035, 0.7644, \ 0.8192, 0.8694, 0.9162, 0.9605, 1.0026, \ 1.0430, 1.0821, 1.1200, 1.1570, 1.1932, \ 1.2288, 1.2638, 1.2985, 1.3330, 1.3672, \ 1.4013, 1.4354, 1.4695, 1.5037, 1.5382, \ 1.5729, 1.6080, 1.6436, 1.6797, 1.7164, \ 1.7540, 1.7924, 1.8318, 1.8724, 1.9144, \ 1.9580, 2.0034, 2.0510, 2.1012, 2.1544, \ 2.2114, 2.2730, 2.3404, 2.4153, 2.5003, \ 2.5997, 2.7216, 2.8829, 3.1365, 6.0000 ] iprob = int((cmd.get_setting_float('ellipsoid_probability') + 0.01) * 50 - 1) pradius = problevel[iprob] cmd.set('sphere_scale', pradius * cmd.get_setting_float('ellipsoid_scale')) Hope this helps. Cheers, Thomas > On Jun 24, 2019, at 7:21 AM, koji naka <pas...@gm...> wrote: > > Dear all, > > The size of isotropic atoms plotted by using "alter all, vdw = sqrt(b/8)/pi" and "show sphere" looks small compared with the size of anisotropic atoms displayed by "show ellipsoid" in PyMOL default setting with 50% probability. > > How can I plot the isotropic atoms with 50% probability? > > The data is a pdb file converted from a cif through Mercury software. > > Thank you very much for your help. > > Best regards, > Koji > > > _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pym...@li... > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. |
From: Thomas H. <tho...@sc...> - 2019-06-25 09:24:17
|
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 <jms...@gm...> wrote: > > 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 are many TER records (e.g. > to separate protein from ligand etc), which should be keeped after > such post-processing in the form of original PDB (with chain A). > > I have tried to do this before saving of the PDB > get pdb_use_ter_records > > however, as the result, all the TER records were removed from the > processed pdb. How I could fix it? > > Many thanks in advance! > > > _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pym...@li... > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. |
From: James S. <jms...@gm...> - 2019-06-25 08:25:52
|
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 are many TER records (e.g. to separate protein from ligand etc), which should be keeped after such post-processing in the form of original PDB (with chain A). I have tried to do this before saving of the PDB get pdb_use_ter_records however, as the result, all the TER records were removed from the processed pdb. How I could fix it? Many thanks in advance! |
From: James S. <jms...@gm...> - 2019-06-25 08:19:59
|
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 it's a problem with the -cQ flag because without it your script gives me the full output, while I echoes the variable: PyMOL(TM) Molecular Graphics System, Version 1.7.2.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, Ph.D. PyMOL is user-supported open-source software. Although some versions are freely available, PyMOL is not in the public domain. If PyMOL is helpful in your work or study, then please volunteer support for our ongoing efforts to create open and affordable scientific software by purchasing a PyMOL Maintenance and/or Support subscription. More information can be found at "http://www.pymol.org". Enter "help" for a list of commands. Enter "help <command-name>" for information on a specific command. Hit ESC anytime to toggle between text and graphics. Command mode. No graphics front end. Detected 20 CPU cores. Enabled multithreaded rendering. PyMOL> PyMOL>from pymol import cmd PyMOL>load ./NpXynWT_apo_340K_MD_multi_0434.pdb, tmp CmdLoad: "./NpXynWT_apo_340K_MD_multi_0434.pdb" loaded as "tmp". PyMOL>sel = 'tmp and polymer' PyMOL>print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) 219 PyMOL: normal program termination. however with -cQ it gives me nothing :-) Hey Blaine, your script is very usefull but it does not work in my case. 1) fetch command gives me an error (which is not the case of "load" probably because I have outdated pymol). 2) I need to load pdbs inside of my shell script, meaning that I am looping a folder by bash routine and use it then with pymol to measure the length of PDB and save it as the variable (in bash!!), which is expected to be used on the next step... james пн, 24 июн. 2019 г. в 18:53, Jared Sampson <jar...@co...>: > > Hi James - > > Try this, assigning to new variable LENGTH by using -Q flag to suppress other output, and running in a subshell (untested, and assuming 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]))) > ") > ``` > > Hopefully that works, or at least gives you an idea of how it might be done. > > Best, > Jared > > > On June 24, 2019 at 12:08:07 PM, James Starlight (jms...@gm...) wrote: > > pdb="./NpXynWT_apo_340K_MD_multi_0434.pdb" > pymol -c -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]))) > " |
From: Mooers, B. H.M. (HSC) <Bla...@ou...> - 2019-06-24 16:38:13
|
Hi James, You can put Jared's commands (below the load command is replaced with the fetch command) in a bash script called cntRei.sh and pass the PDB-ID from the command line. The $1 is a place holder for the first argument on the command line, the PDB-ID in this case. This will enable easy reuse of the code with other PDB files. #!/bin/bash pymol -cQkd " from pymol import cmd fetch $1, type=pdb, tmp sel = 'tmp and chain A and polymer.protein' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) " e.g., chmod +x cntResi.sh # must do only once ./cntResi.sh 1lw9 164 Best regards, Blaine ________________________________________ From: James Starlight [jms...@gm...] Sent: Monday, June 24, 2019 10:58 AM To: Jared Sampson; pymol-users Subject: [EXTERNAL] Re: [PyMOL] counting number of standard amino acids in PDB hi Jared, I have tried to use your script putting it into my https://urldefense.proofpoint.com/v2/url?u=http-3A__test.sh&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=oiLydhz78vYkVUOODOTN_nOJGam-H3IZM5CdrNYZLP0&e= 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" pymol -c -d " from pymol import cmd load ${pdb}, tmp sel = 'tmp and polymer.protein' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) " execution of that sh script gave me the following error PyMOL(TM) Molecular Graphics System, Version https://urldefense.proofpoint.com/v2/url?u=http-3A__1.7.2.1&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=OYqhYixQ0ZYt700enMnc7UcnEeNlBNoQh1WLCOg2d2k&e= . Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, Ph.D. PyMOL is user-supported open-source software. Although some versions are freely available, PyMOL is not in the public domain. If PyMOL is helpful in your work or study, then please volunteer support for our ongoing efforts to create open and affordable scientific software by purchasing a PyMOL Maintenance and/or Support subscription. More information can be found at "https://urldefense.proofpoint.com/v2/url?u=http-3A__www.pymol.org&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=bx6O9IruCWuQD_P48i0VkZXzj_zRzHF7kE7jzIgHMEs&e= ". Enter "help" for a list of commands. Enter "help <command-name>" for information on a specific command. Hit ESC anytime to toggle between text and graphics. Command mode. No graphics front end. Detected 20 CPU cores. Enabled multithreaded rendering. PyMOL>from pymol import cmd PyMOL>load ./NpXynWT_apo_340K_MD_multi_0434.pdb, tmp CmdLoad: "./NpXynWT_apo_340K_MD_multi_0434.pdb" loaded as "tmp". PyMOL>sel = 'tmp and polymer.protein' PyMOL>print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) Selector-Error: Invalid selection name "polymer.protein". ( tmp and polymer.protein )<-- PyMOL: normal program termination. пн, 24 июн. 2019 г. в 17:44, Jared Sampson <jar...@co...>: > > 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 (also unless you are using Python 2!). I would suggest performing the print operation on a single line. You'll also need to load your model and specify the selection using PyMOL selection syntax such that it includes only protein residues (e.g. polymer.protein). For example, for my PyMOL running Python 3.7 (which requires using the `print()` function, i.e. with parentheses), the following command works: > > ``` > pymol -cQkd " > from pymol import cmd > load my_structure.pdb, tmp > sel = 'tmp and chain A and polymer.protein' > print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) > " > ``` > > Here I put in the -Q option which suppresses all of PyMOL's normal output, as well as -k, which prevents it from loading the .pymolrc file (for speed, mostly). Also note the quotes in the `sel` variable assignment must be single quotes to avoid closing the shell string. > > Hope that helps. > > Cheers, > Jared > > > > > On June 24, 2019 at 10:25:22 AM, James Starlight (jms...@gm...) wrote: > > 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 <jar...@co...>: > > > > Hi James - > > > > Do any of the options from this previous BB discussion help? > > > > https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_pymol_mailman_message_28466955_&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=6BbgPaZIB1a1vBmisO8u-F55457MjYKaXeQYpaEoyRI&e= > > > > Cheers, > > Jared > > > > > > On June 24, 2019 at 8:13:47 AM, James Starlight (jms...@gm...) wrote: > > > > Dear Pymol Users, > > > > that is not very related to pymol question but however probably it can > > be solved via pymol as well ;-) > > > > I am looking for some script (e.g. via running in pymol no-gui), which > > will count the number of standard amino acid residues in the given > > PDB. E.g. for particular pdb consisted of 9 residues complexed with > > part of the ligand I need to print the value of 9 (the end value of > > 6th column before TER) > > > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > > TER > > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > > > Thanks in advance! > > > > > > _______________________________________________ > > PyMOL-users mailing list > > Archives: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mail-2Darchive.com_pymol-2Dusers-40lists.sourceforge.net&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=SuXKvz3fbyNlH5I-uOa5JlW2Wz4tKjiRiwjBVjRlnW8&e= > > Unsubscribe: https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_projects_pymol_lists_pymol-2Dusers_unsubscribe&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=dNlAyYELmzzML6T0AOaHXC2H3071uuwHMvy3xKTLSIY&e= _______________________________________________ PyMOL-users mailing list Archives: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mail-2Darchive.com_pymol-2Dusers-40lists.sourceforge.net&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=SuXKvz3fbyNlH5I-uOa5JlW2Wz4tKjiRiwjBVjRlnW8&e= Unsubscribe: https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_projects_pymol_lists_pymol-2Dusers_unsubscribe&d=DwIGaQ&c=VjzId-SM5S6aVB_cCGQ0d3uo9UfKByQ3sI6Audoy6dY&r=k0gMbcsdOcdbPUNV5tW66KQSZfXL0ewVDPVBp7tqbks&m=irGpLBGjJRRHhL2OEINOt-E-XHmSJzgTxLiXFPPM7yE&s=dNlAyYELmzzML6T0AOaHXC2H3071uuwHMvy3xKTLSIY&e= |
From: Jared S. <jar...@co...> - 2019-06-24 16:02:28
|
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 (jms...@gm...) wrote: 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" pymol -c -d " from pymol import cmd load ${pdb}, tmp sel = 'tmp and polymer.protein' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) " execution of that sh script gave me the following error PyMOL(TM) Molecular Graphics System, Version 1.7.2.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, Ph.D. PyMOL is user-supported open-source software. Although some versions are freely available, PyMOL is not in the public domain. If PyMOL is helpful in your work or study, then please volunteer support for our ongoing efforts to create open and affordable scientific software by purchasing a PyMOL Maintenance and/or Support subscription. More information can be found at "http://www.pymol.org". Enter "help" for a list of commands. Enter "help <command-name>" for information on a specific command. Hit ESC anytime to toggle between text and graphics. Command mode. No graphics front end. Detected 20 CPU cores. Enabled multithreaded rendering. PyMOL>from pymol import cmd PyMOL>load ./NpXynWT_apo_340K_MD_multi_0434.pdb, tmp CmdLoad: "./NpXynWT_apo_340K_MD_multi_0434.pdb" loaded as "tmp". PyMOL>sel = 'tmp and polymer.protein' PyMOL>print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) Selector-Error: Invalid selection name "polymer.protein". ( tmp and polymer.protein )<-- PyMOL: normal program termination. пн, 24 июн. 2019 г. в 17:44, Jared Sampson <jar...@co...>: > > 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 (also unless you are using Python 2!). I would suggest performing the print operation on a single line. You'll also need to load your model and specify the selection using PyMOL selection syntax such that it includes only protein residues (e.g. polymer.protein). For example, for my PyMOL running Python 3.7 (which requires using the `print()` function, i.e. with parentheses), the following command works: > > ``` > pymol -cQkd " > from pymol import cmd > load my_structure.pdb, tmp > sel = 'tmp and chain A and polymer.protein' > print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) > " > ``` > > Here I put in the -Q option which suppresses all of PyMOL's normal output, as well as -k, which prevents it from loading the .pymolrc file (for speed, mostly). Also note the quotes in the `sel` variable assignment must be single quotes to avoid closing the shell string. > > Hope that helps. > > Cheers, > Jared > > > > > On June 24, 2019 at 10:25:22 AM, James Starlight (jms...@gm...) wrote: > > 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 <jar...@co...>: > > > > 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 (jms...@gm...) wrote: > > > > Dear Pymol Users, > > > > that is not very related to pymol question but however probably it can > > be solved via pymol as well ;-) > > > > I am looking for some script (e.g. via running in pymol no-gui), which > > will count the number of standard amino acid residues in the given > > PDB. E.g. for particular pdb consisted of 9 residues complexed with > > part of the ligand I need to print the value of 9 (the end value of > > 6th column before TER) > > > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > > TER > > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > > > Thanks in advance! > > > > > > _______________________________________________ > > PyMOL-users mailing list > > Archives: http://www.mail-archive.com/pym...@li... > > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: James S. <jms...@gm...> - 2019-06-24 15:58:46
|
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" pymol -c -d " from pymol import cmd load ${pdb}, tmp sel = 'tmp and polymer.protein' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) " execution of that sh script gave me the following error PyMOL(TM) Molecular Graphics System, Version 1.7.2.1. Copyright (c) Schrodinger, LLC. All Rights Reserved. Created by Warren L. DeLano, Ph.D. PyMOL is user-supported open-source software. Although some versions are freely available, PyMOL is not in the public domain. If PyMOL is helpful in your work or study, then please volunteer support for our ongoing efforts to create open and affordable scientific software by purchasing a PyMOL Maintenance and/or Support subscription. More information can be found at "http://www.pymol.org". Enter "help" for a list of commands. Enter "help <command-name>" for information on a specific command. Hit ESC anytime to toggle between text and graphics. Command mode. No graphics front end. Detected 20 CPU cores. Enabled multithreaded rendering. PyMOL>from pymol import cmd PyMOL>load ./NpXynWT_apo_340K_MD_multi_0434.pdb, tmp CmdLoad: "./NpXynWT_apo_340K_MD_multi_0434.pdb" loaded as "tmp". PyMOL>sel = 'tmp and polymer.protein' PyMOL>print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) Selector-Error: Invalid selection name "polymer.protein". ( tmp and polymer.protein )<-- PyMOL: normal program termination. пн, 24 июн. 2019 г. в 17:44, Jared Sampson <jar...@co...>: > > 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 (also unless you are using Python 2!). I would suggest performing the print operation on a single line. You'll also need to load your model and specify the selection using PyMOL selection syntax such that it includes only protein residues (e.g. polymer.protein). For example, for my PyMOL running Python 3.7 (which requires using the `print()` function, i.e. with parentheses), the following command works: > > ``` > pymol -cQkd " > from pymol import cmd > load my_structure.pdb, tmp > sel = 'tmp and chain A and polymer.protein' > print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) > " > ``` > > Here I put in the -Q option which suppresses all of PyMOL's normal output, as well as -k, which prevents it from loading the .pymolrc file (for speed, mostly). Also note the quotes in the `sel` variable assignment must be single quotes to avoid closing the shell string. > > Hope that helps. > > Cheers, > Jared > > > > > On June 24, 2019 at 10:25:22 AM, James Starlight (jms...@gm...) wrote: > > 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 <jar...@co...>: > > > > 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 (jms...@gm...) wrote: > > > > Dear Pymol Users, > > > > that is not very related to pymol question but however probably it can > > be solved via pymol as well ;-) > > > > I am looking for some script (e.g. via running in pymol no-gui), which > > will count the number of standard amino acid residues in the given > > PDB. E.g. for particular pdb consisted of 9 residues complexed with > > part of the ligand I need to print the value of 9 (the end value of > > 6th column before TER) > > > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > > TER > > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > > > Thanks in advance! > > > > > > _______________________________________________ > > PyMOL-users mailing list > > Archives: http://www.mail-archive.com/pym...@li... > > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: Jared S. <jar...@co...> - 2019-06-24 15:44:19
|
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 (also unless you are using Python 2!). I would suggest performing the print operation on a single line. You'll also need to load your model and specify the selection using PyMOL selection syntax such that it includes only protein residues (e.g. polymer.protein). For example, for my PyMOL running Python 3.7 (which requires using the `print()` function, i.e. with parentheses), the following command works: ``` pymol -cQkd " from pymol import cmd load my_structure.pdb, tmp sel = 'tmp and chain A and polymer.protein' print(len(set([(i.chain, i.resi, i.resn) for i in cmd.get_model(sel).atom]))) " ``` Here I put in the -Q option which suppresses all of PyMOL's normal output, as well as -k, which prevents it from loading the .pymolrc file (for speed, mostly). Also note the quotes in the `sel` variable assignment must be single quotes to avoid closing the shell string. Hope that helps. Cheers, Jared On June 24, 2019 at 10:25:22 AM, James Starlight (jms...@gm...) wrote: 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 <jar...@co...>: > > 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 (jms...@gm...) wrote: > > Dear Pymol Users, > > that is not very related to pymol question but however probably it can > be solved via pymol as well ;-) > > I am looking for some script (e.g. via running in pymol no-gui), which > will count the number of standard amino acid residues in the given > PDB. E.g. for particular pdb consisted of 9 residues complexed with > part of the ligand I need to print the value of 9 (the end value of > 6th column before TER) > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > TER > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > Thanks in advance! > > > _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pym...@li... > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: James S. <jms...@gm...> - 2019-06-24 15:23:05
|
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 июн. 2019 г. в 16:25, James Starlight <jms...@gm...>: > > 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 <jar...@co...>: > > > > 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 (jms...@gm...) wrote: > > > > Dear Pymol Users, > > > > that is not very related to pymol question but however probably it can > > be solved via pymol as well ;-) > > > > I am looking for some script (e.g. via running in pymol no-gui), which > > will count the number of standard amino acid residues in the given > > PDB. E.g. for particular pdb consisted of 9 residues complexed with > > part of the ligand I need to print the value of 9 (the end value of > > 6th column before TER) > > > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > > TER > > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > > > Thanks in advance! > > > > > > _______________________________________________ > > PyMOL-users mailing list > > Archives: http://www.mail-archive.com/pym...@li... > > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: James S. <jms...@gm...> - 2019-06-24 14:25:25
|
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 <jar...@co...>: > > 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 (jms...@gm...) wrote: > > Dear Pymol Users, > > that is not very related to pymol question but however probably it can > be solved via pymol as well ;-) > > I am looking for some script (e.g. via running in pymol no-gui), which > will count the number of standard amino acid residues in the given > PDB. E.g. for particular pdb consisted of 9 residues complexed with > part of the ligand I need to print the value of 9 (the end value of > 6th column before TER) > > ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N > ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C > ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C > ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O > ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C > ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C > ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S > ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C > ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N > ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C > ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C > ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O > ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C > ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C > ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C > ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C > ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ > ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N > ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C > ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C > ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O > ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C > ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C > ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C > ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C > ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C > ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C > ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C > ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N > ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C > ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C > ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O > ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C > ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C > ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O > ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N > ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C > ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C > ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O > ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C > ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C > ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C > ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N > ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C > ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C > ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O > ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N > ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C > ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C > ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O > ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C > ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C > ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N > ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O > ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N > ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C > ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C > ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O > ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N > ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C > ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C > ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O > ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C > ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C > ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C > ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N > ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O > TER > ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C > ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C > ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O > ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C > ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O > ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C > ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O > ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C > ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O > > Thanks in advance! > > > _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pym...@li... > Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |
From: Jared S. <jar...@co...> - 2019-06-24 14:17:42
|
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 (jms...@gm...) wrote: Dear Pymol Users, that is not very related to pymol question but however probably it can be solved via pymol as well ;-) I am looking for some script (e.g. via running in pymol no-gui), which will count the number of standard amino acid residues in the given PDB. E.g. for particular pdb consisted of 9 residues complexed with part of the ligand I need to print the value of 9 (the end value of 6th column before TER) ATOM 1 N MET A 1 24.950 5.224 -5.601 1.00 30.01 N ATOM 2 CA MET A 1 24.822 3.740 -5.655 1.00 30.25 C ATOM 3 C MET A 1 23.719 3.091 -4.771 1.00 28.98 C ATOM 4 O MET A 1 23.417 1.937 -4.989 1.00 28.27 O ATOM 5 CB MET A 1 26.187 3.043 -5.448 1.00 31.03 C ATOM 6 CG MET A 1 26.869 3.182 -4.084 1.00 32.21 C ATOM 7 SD MET A 1 28.713 3.095 -4.227 1.00 34.63 S ATOM 8 CE MET A 1 29.205 3.597 -2.564 1.00 33.32 C ATOM 9 N LYS A 2 23.111 3.804 -3.818 1.00 27.78 N ATOM 10 CA LYS A 2 21.869 3.310 -3.188 1.00 27.21 C ATOM 11 C LYS A 2 20.671 4.237 -3.440 1.00 26.27 C ATOM 12 O LYS A 2 20.787 5.445 -3.300 1.00 25.96 O ATOM 13 CB LYS A 2 22.027 3.091 -1.684 1.00 27.32 C ATOM 14 CG LYS A 2 20.820 2.362 -1.065 1.00 27.75 C ATOM 15 CD LYS A 2 20.953 2.147 0.439 1.00 28.18 C ATOM 16 CE LYS A 2 19.928 1.130 0.938 1.00 29.30 C ATOM 17 NZ LYS A 2 20.083 0.809 2.386 1.00 30.36 N1+ ATOM 18 N PHE A 3 19.528 3.658 -3.808 1.00 24.92 N ATOM 19 CA PHE A 3 18.306 4.421 -4.054 1.00 24.39 C ATOM 20 C PHE A 3 17.161 3.823 -3.246 1.00 24.12 C ATOM 21 O PHE A 3 16.991 2.597 -3.202 1.00 23.77 O ATOM 22 CB PHE A 3 17.940 4.222 -5.535 1.00 23.83 C ATOM 23 CG PHE A 3 19.003 4.968 -6.434 1.00 23.81 C ATOM 24 CD1 PHE A 3 19.132 6.337 -6.585 1.00 23.27 C ATOM 25 CD2 PHE A 3 19.876 4.135 -7.129 1.00 23.46 C ATOM 26 CE1 PHE A 3 20.110 6.868 -7.412 1.00 23.22 C ATOM 27 CE2 PHE A 3 20.862 4.660 -7.952 1.00 23.19 C ATOM 28 CZ PHE A 3 20.975 6.027 -8.102 1.00 23.07 C ATOM 29 N THR A 4 16.374 4.691 -2.624 1.00 23.47 N ATOM 30 CA THR A 4 15.326 4.278 -1.704 1.00 23.33 C ATOM 31 C THR A 4 13.946 4.720 -2.188 1.00 22.67 C ATOM 32 O THR A 4 13.779 5.810 -2.726 1.00 22.24 O ATOM 33 CB THR A 4 15.584 4.875 -0.295 1.00 23.52 C ATOM 34 CG2 THR A 4 14.441 4.560 0.650 1.00 23.80 C ATOM 35 OG1 THR A 4 16.798 4.328 0.245 1.00 23.98 O ATOM 36 N VAL A 5 12.955 3.866 -1.980 1.00 22.25 N ATOM 37 CA VAL A 5 11.577 4.216 -2.276 1.00 22.46 C ATOM 38 C VAL A 5 10.685 4.011 -1.038 1.00 22.44 C ATOM 39 O VAL A 5 10.951 3.145 -0.201 1.00 21.37 O ATOM 40 CB VAL A 5 11.033 3.456 -3.533 1.00 21.81 C ATOM 41 CG1 VAL A 5 11.786 3.902 -4.782 1.00 20.47 C ATOM 42 CG2 VAL A 5 11.127 1.940 -3.368 1.00 21.55 C ATOM 43 N GLY A 6 9.660 4.845 -0.908 1.00 23.27 N ATOM 44 CA GLY A 6 8.676 4.684 0.154 1.00 24.59 C ATOM 45 C GLY A 6 8.727 5.731 1.249 1.00 25.69 C ATOM 46 O GLY A 6 7.834 5.767 2.101 1.00 26.30 O ATOM 47 N ASN A 7 9.764 6.568 1.261 1.00 26.66 N ATOM 48 CA ASN A 7 9.775 7.728 2.155 1.00 27.39 C ATOM 49 C ASN A 7 10.165 9.028 1.436 1.00 27.80 C ATOM 50 O ASN A 7 11.263 9.569 1.622 1.00 28.37 O ATOM 51 CB ASN A 7 10.619 7.470 3.421 1.00 28.21 C ATOM 52 CG ASN A 7 12.089 7.278 3.127 1.00 29.85 C ATOM 53 ND2 ASN A 7 12.938 7.964 3.897 1.00 32.41 N ATOM 54 OD1 ASN A 7 12.466 6.525 2.229 1.00 32.61 O ATOM 55 N GLY A 8 9.232 9.521 0.622 1.00 27.41 N ATOM 56 CA GLY A 8 9.422 10.752 -0.139 1.00 27.40 C ATOM 57 C GLY A 8 9.309 10.498 -1.629 1.00 27.35 C ATOM 58 O GLY A 8 8.449 11.071 -2.303 1.00 27.93 O ATOM 59 N GLN A 9 10.178 9.630 -2.136 1.00 26.80 N ATOM 60 CA GLN A 9 10.215 9.294 -3.552 1.00 26.37 C ATOM 61 C GLN A 9 9.834 7.833 -3.736 1.00 25.75 C ATOM 62 O GLN A 9 10.308 6.970 -2.997 1.00 25.25 O ATOM 63 CB GLN A 9 11.622 9.522 -4.115 1.00 26.74 C ATOM 64 CG GLN A 9 12.197 10.924 -3.899 1.00 27.40 C ATOM 65 CD GLN A 9 11.327 12.028 -4.475 1.00 29.17 C ATOM 66 NE2 GLN A 9 10.896 11.863 -5.726 1.00 29.46 N ATOM 67 OE1 GLN A 9 11.048 13.025 -3.800 1.00 31.02 O TER ATOM 1719 C1 0XB B 220 6.613 3.931 -16.928 1.00 11.35 C ATOM 1720 C2 0XB B 220 7.042 5.128 -16.070 1.00 14.60 C ATOM 1721 O2 0XB B 220 6.347 5.144 -14.862 1.00 15.67 O ATOM 1722 C3 0XB B 220 6.767 6.445 -16.786 1.00 17.91 C ATOM 1723 O3 0XB B 220 7.304 7.499 -15.962 1.00 20.75 O ATOM 1724 C4 0XB B 220 7.275 6.470 -18.142 1.00 17.97 C ATOM 1725 O4 0XB B 220 6.793 7.605 -18.882 1.00 21.45 O ATOM 1726 C5 0XB B 220 6.856 5.264 -18.860 1.00 15.05 C ATOM 1727 O5 0XB B 220 7.286 4.049 -18.182 1.00 12.43 O Thanks in advance! _______________________________________________ PyMOL-users mailing list Archives: http://www.mail-archive.com/pym...@li... Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe |