Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Robert Campbell
Hi Jordan et al., Yes one can use the alter command with a whole selection at once and it is much faster. I hadn't realized that until Thomas Holder helped fix my script that appears to do what you were wanting to do: http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/data2bfactor.py The B-fa

Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Thomas Holder
Hi all, this is what I would do: cmd.alter('all', 'b = mapping.get(resv, b)', space={'mapping': dict((r['resnum'], r['value']) for r in data)}) Cheers, Thomas On 16 Jun 2015, at 05:10, Tsjerk Wassenaar wrote: > Hi Jordan, > > The answer is something like (assuming reading from a file):

Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Sampson, Jared
Hi Jordan - I think you're doing it exactly the way I would, given an existing dict containing the values. Note, however, that if you have multiple loaded, or multiple chains with the same residue numbers, you may wish to be more specific with your selection string; your current script will al

Re: [PyMOL] How to forbid merging of files?

2015-06-16 Thread Folmer Fredslund
Hi Alsa, In the line where you save the file, you need to specify a selection, otherwise, everything will be saved Look at http://www.pymolwiki.org/index.php/Save#PYMOL_API So instead of cmd.save(filenameN + '.mol') you want something like cmd.save(filenameN + '.mol', filename) I

Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Tsjerk Wassenaar
Hi Jordan, The answer is something like (assuming reading from a file): newb=[float(i) for i in open("stuff.dat").read().split()] alter n. ca, b=newb.pop() spectrum b Hope it helps, Tsjerk On Tue, Jun 16, 2015 at 10:25 AM, Jordan Willis wrote: > Hi Tsjerk, > > It seems everyone is pointing t

Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Jordan Willis
Hi Tsjerk, It seems everyone is pointing to this (http://www.pymolwiki.org/index.php/Color#Reassigning_B-Factors_and_Coloring ) which I somehow missed. However, they seem to be altering one residue at a time like I’m

Re: [PyMOL] efficiency assigning b-factors

2015-06-16 Thread Tsjerk Wassenaar
Hi Jordan, Yes, although I don't have the answer at hand, it has been given on the user list several times. You can find it in the archives. Cheers, Tsjerk On Jun 16, 2015 08:16, "Jordan Willis" wrote: > Hi, > > I have a dictionary that has a bunch of values I want to assign to > b-factors in