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