Hi Tsjerk,
the interesting option for coloring which I found to set sensitivity of the visualization in my case: spectrum b, red_orange_white, minimum=-1, maximum=0.1 are there any same commands to set transparency level according to the B-factor value? Here the issue is with the proper selection E.g PyMOL>select not-relevent, b > 0 results only in small atoms selected and PyMOL>select ss, b = 0 Selector-Error: Invalid selection. b<-- Regards, James 2015-04-10 21:12 GMT+02:00 Tsjerk Wassenaar <tsje...@gmail.com>: > Hi James, > > The selection keyword 'b' exists for just that purpose: to make selections > based on the b-factor value. > > color red, b > 0 > > Cheers, > > Tsjerk > > On Fri, Apr 10, 2015 at 5:19 PM, James Starlight <jmsstarli...@gmail.com> > wrote: >> >> some specification regarding B-factors visualization for my task: >> >> is it possible within the open pymol session >> >> 1) to select only residues with non-zero B-factors as specified >> selection (here I would like to present it as the stics and display it >> names as the label) >> >> 2) to define residues with zero B-factors as another specified >> selection (for those one I'd like to apply specified color filter for >> instance and transparency as for not relevant in my case) >> >> Thanks! >> >> J >> >> 2015-04-10 15:27 GMT+02:00 James Starlight <jmsstarli...@gmail.com>: >> > Hi Osvaldo and thank you very much- it works perfect! >> > >> > The only question which I have- is it possible to modify existing >> > color-pattern of the B-factor colouring (from the spectrum >> > visualization)? for instance I need to colour by white all residues >> > with 0.0 B-factors and as the rainbow from cold to hot gradient >> > residues with non-zero B-factors: where residues with most negative >> > values should correspond to the hot colours, and with positive - to >> > cold (because here this valus in fact correspond to the binding free >> > energy so more negative- better contribution to dG). >> > >> > >> > Thanks again, >> > >> > James >> > >> > 2015-04-10 14:44 GMT+02:00 Osvaldo Martin <aloctavo...@gmail.com>: >> >> Hi James, >> >> >> >> cmd.alter() is not working because you forget the to add the "". >> >> >> >> You can use PyMol as a regular Python library, write an script and then >> >> run >> >> it, from the command line, as: >> >> >> >> python my_script.py >> >> >> >> Your script should looks like the following: >> >> >> >> import __main__ >> >> __main__.pymol_argv = ['pymol','-qc'] # Pymol: quiet and no GUI >> >> import pymol >> >> from pymol import cmd, stored >> >> pymol.finish_launching() >> >> import other_useful_library >> >> >> >> cmd.load("OR5P3_androstenone.pdb") >> >> >> >> # open the file of new values (just 1 column of numbers, one for each >> >> alpha carbon) >> >> inFile = open("OR5P3_androstenone.dat", 'r') >> >> >> >> # create the global, stored array >> >> newB = [] >> >> >> >> # read the new B factors from file >> >> for line in inFile.readlines(): newB.append( float(line) ) >> >> >> >> # close the input file >> >> inFile.close() >> >> >> >> # clear out the old B Factors >> >> cmd.alter("OR5P3_androstenone", "b=0.0") >> >> >> >> # update the B Factors with new properties >> >> cmd.alter("OR5P3_androstenone and n. CA", "b=newB.pop(0)") >> >> >> >> # color the protein based on the new B Factors of the alpha carbons >> >> cmd.spectrum("b", "OR5P3_androstenone and n. CA") >> >> >> >> # save new pdb >> >> cmd.save("OR5P3_androstenone_newBFactors.pdb", "OR5P3_androstenone") >> >> >> >> Cheers, >> >> Osvaldo. >> >> >> >> >> >> On Fri, Apr 10, 2015 at 9:03 AM, James Starlight >> >> <jmsstarli...@gmail.com> >> >> wrote: >> >>> >> >>> so to be more precise the issue is how to adapt the following script >> >>> (which used python interpetator directly from pymol to change >> >>> B-factors within loaded pdb) to use it as the external script loaded >> >>> from command line e.g pymol -r script.py >> >>> >> >>> # here the code what should I to adapt: >> >>> >> >>> cmd.load("OR5P3_androstenone.pdb") >> >>> >> >>> # open the file of new values (just 1 column of numbers, one for each >> >>> alpha carbon) >> >>> inFile = open("OR5P3_androstenone.dat", 'r') >> >>> >> >>> # create the global, stored array >> >>> newB = [] >> >>> >> >>> # read the new B factors from file >> >>> for line in inFile.readlines(): newB.append( float(line) ) >> >>> >> >>> # close the input file >> >>> inFile.close() >> >>> >> >>> # clear out the old B Factors >> >>> cmd.alter(OR5P3_androstenone, b=0.0) >> >>> >> >>> # update the B Factors with new properties >> >>> cmd.alter(OR5P3_androstenone and n. CA, b=newB.pop(0)) >> >>> >> >>> # color the protein based on the new B Factors of the alpha carbons >> >>> cmd.spectrum("b", "OR5P3_androstenone and n. CA") >> >>> >> >>> # save new pdb >> >>> cmd.save("OR5P3_androstenone_newBFactors.pdb", "OR5P3_androstenone") >> >>> >> >>> >> >>> >> >>> # so as you can see here I tried to move some pynol command like alter >> >>> to the cmd.alter with its options but the script didn't worked. >> >>> >> >>> J. >> >>> >> >>> 2015-04-09 16:52 GMT+02:00 James Starlight <jmsstarli...@gmail.com>: >> >>> > also to specify: >> >>> > >> >>> > I've already done this for one pdb and one dat file using just >> >>> > sequence command from the pymol with loaded protA.pdb >> >>> > >> >>> > inFile = open("./test.dat", 'r') >> >>> > >> >>> > # create the global, stored array >> >>> > stored.newB = [] >> >>> > >> >>> > # read the new B factors from file >> >>> > for line in inFile.readlines(): stored.newB.append( float(line) ) >> >>> > >> >>> > # close the input file >> >>> > inFile.close() >> >>> > >> >>> > # clear out the old B Factors >> >>> > alter protA, b=0.0 >> >>> > >> >>> > # update the B Factors with new properties >> >>> > alter protA and n. CA, b=stored.newB.pop(0) >> >>> > >> >>> > # color the protein based on the new B Factors of the alpha carbons >> >>> > cmd.spectrum("b", "protA and n. CA") >> >>> > >> >>> > >> >>> > now the idea using below bash script which superimpose each pdb with >> >>> > each log to call pymol from the terminal each time for each pdb and >> >>> > load to it corresponded dat file producing as the result new pdb >> >>> > with >> >>> > new B-factors (taken from the dat log) >> >>> > >> >>> > >> >>> > #!/bin/bash >> >>> > >> >>> > workdir=/data2/Gleb/script/Simulations/activation/5p3_decomposition_visu >> >>> > pdb_all=${workdir}/complexes >> >>> > logs_all=${workdir}/logs >> >>> > >> >>> > # where final pdb will be saved >> >>> > output=${workdir}/outputs >> >>> > >> >>> > >> >>> > #looping of pdbs >> >>> > for pdb in ${pdb_all}/*.pdb; do # ???? >> >>> > pdb_n_full=$(basename "${pdb}") >> >>> > pdb_n="${pdb_n_full%.*}" >> >>> > Complexes=("${Complexes[@]}" "${pdb_n}"); >> >>> > echo ${pdb_n} "has been added to the list!" >> >>> > done >> >>> > #sort elements within ${Complexes[@]} lists!! >> >>> > #echo "The pdb list consist of:" ${Complexes[@]} >> >>> > #echo "Total number of pdbs:" ${#Complexes[@]} >> >>> > >> >>> > #looping of tops >> >>> > for log in ${logs_all}/*.dat; do # ???? >> >>> > log_n_full=$(basename "${log}") >> >>> > log_n="${log_n_full%.*}" >> >>> > Logs=("${Logs[@]}" "${log_n}"); >> >>> > echo ${log_n} "has been added to the list!" >> >>> > done >> >>> > #sort elements within ${Logs[@] lists!! >> >>> > #echo "The DAT list consist of:" ${Logs[@]} >> >>> > #echo "Total number of logs:" ${#Logs[@]} >> >>> > >> >>> > >> >>> > # So I need only to define how I will use pymol with each pair of >> >>> > log >> >>> > and pdb >> >>> > #proceed each pdb in pymol using elements from both lists >> >>> > for i in $(seq 1 ${#Logs[@]}); do >> >>> > # print what pdb and what DAT will be used within this loop >> >>> > echo ${Logs[i]} >> >>> > echo ${Complexes[i]} >> >>> > # here run pymol using i pdb with corresponded i dat !! >> >>> > #done >> >>> > >> >>> > >> >>> > I will be thankful for any ideas in the last part of that script! >> >>> > >> >>> > >> >>> > James >> >>> > >> >>> > 2015-04-09 16:15 GMT+02:00 James Starlight <jmsstarli...@gmail.com>: >> >>> >> thanks for the information! Here I ask to provide me with some more >> >>> >> help because I'm not a big expert in the python . >> >>> >> >> >>> >> For instance I have 2 folders- one with 10 pdb's corresponded to >> >>> >> the >> >>> >> 10 complexes of one receptor (289 residues) docked with 10 >> >>> >> different >> >>> >> ligands; the second one is the 10 the_same_name.dat files >> >>> >> corresponded >> >>> >> to the 10 logs having 1 column with the values per each residue >> >>> >> (totally 289 values) of the receptor. I need to associate each pdb >> >>> >> with each dat to exchange existing B-factors within each pdb onto >> >>> >> the >> >>> >> values taken from the corresponded.dat files and associate it's >> >>> >> directly to the C-alpha atoms of each complex for instance. Will it >> >>> >> be >> >>> >> better to rewrite here the script from the PyMol Wiki or to use >> >>> >> data2bfactor.py (here as I found I need to modify my dat logs >> >>> >> including to them number of receptor residues and chainID). >> >>> >> >> >>> >> James >> >>> >> >> >>> >> 2015-04-08 19:00 GMT+02:00 Osvaldo Martin <aloctavo...@gmail.com>: >> >>> >>> Hi James, >> >>> >>> >> >>> >>> I think what you want to do is to load your data to the b-factor >> >>> >>> column of >> >>> >>> the pdb file and then ask PyMol to color the protein according to >> >>> >>> the >> >>> >>> b-factor values. Try with this example from the PyMol wiki and let >> >>> >>> us >> >>> >>> know >> >>> >>> if you find some trouble. >> >>> >>> >> >>> >>> Regards, >> >>> >>> Osvaldo. >> >>> >>> >> >>> >>> On Wed, Apr 8, 2015 at 1:47 PM, James Starlight >> >>> >>> <jmsstarli...@gmail.com> >> >>> >>> wrote: >> >>> >>>> >> >>> >>>> Dear Pymol users! >> >>> >>>> >> >>> >>>> For better visualization of the MMGBSA outputs from MD performed >> >>> >>>> for >> >>> >>>> 10 >> >>> >>>> ligands >> >>> >>>> agains 1 receptor-target I wonder to map per-residue >> >>> >>>> decomposition >> >>> >>>> data from each of the systems onto the receptor's 3D structure. >> >>> >>>> Eventually I'd like to produce 10 cartoon diagrams which would >> >>> >>>> differs >> >>> >>>> in the coloring according to the difference in the contribution >> >>> >>>> of >> >>> >>>> residues from the receptor's cavity to binding for different >> >>> >>>> ligands. >> >>> >>>> I will be very thankful if someone provide me with ideas of how >> >>> >>>> such >> >>> >>>> visualization could be done using receptors structure, >> >>> >>>> decomposition >> >>> >>>> logs as the inputs and/or pymol. Here some general idea whig >> >>> >>>> came in >> >>> >>>> mind- import column from the mmgbsa.log directly (with number of >> >>> >>>> rows= number of receptors residues) to the receptor.pdb B-factors >> >>> >>>> column (for instance making meaningful value for C-alpha atom and >> >>> >>>> 0 >> >>> >>>> for the rest). Will be very thankful for some examples of how it >> >>> >>>> could >> >>> >>>> be achieved e.g using combination of awk_sed if more trivial way >> >>> >>>> is >> >>> >>>> not exist. >> >>> >>>> >> >>> >>>> >> >>> >>>> Thanks for help!! >> >>> >>>> >> >>> >>>> James >> >>> >>>> >> >>> >>>> >> >>> >>>> >> >>> >>>> >> >>> >>>> ------------------------------------------------------------------------------ >> >>> >>>> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT >> >>> >>>> Develop your own process in accordance with the BPMN 2 standard >> >>> >>>> Learn Process modeling best practices with Bonita BPM through >> >>> >>>> live >> >>> >>>> exercises >> >>> >>>> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- >> >>> >>>> event?utm_ >> >>> >>>> >> >>> >>>> >> >>> >>>> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF >> >>> >>>> _______________________________________________ >> >>> >>>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) >> >>> >>>> Info Page: >> >>> >>>> https://lists.sourceforge.net/lists/listinfo/pymol-users >> >>> >>>> Archives: >> >>> >>>> http://www.mail-archive.com/pymol-users@lists.sourceforge.net >> >>> >> >>> >> >>> >> >>> ------------------------------------------------------------------------------ >> >>> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT >> >>> Develop your own process in accordance with the BPMN 2 standard >> >>> Learn Process modeling best practices with Bonita BPM through live >> >>> exercises >> >>> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- >> >>> event?utm_ >> >>> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF >> >>> _______________________________________________ >> >>> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) >> >>> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> >>> Archives: >> >>> http://www.mail-archive.com/pymol-users@lists.sourceforge.net >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT >> Develop your own process in accordance with the BPMN 2 standard >> Learn Process modeling best practices with Bonita BPM through live >> exercises >> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- >> event?utm_ >> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF >> _______________________________________________ >> PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net > > > > > -- > Tsjerk A. Wassenaar, Ph.D. > ------------------------------------------------------------------------------ BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT Develop your own process in accordance with the BPMN 2 standard Learn Process modeling best practices with Bonita BPM through live exercises http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_ source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net