[Chimera-users] Selecting residues with zones when reference is absent
Conrad Huang
conrad at cgl.ucsf.edu
Wed Oct 2 11:23:27 PDT 2019
Sorry to jump in late.
"select ligand & nucleic acid z<10" is slow for the reason you
suspected: it computes the left and right sides independently, and the
right side starts with lots of atoms and then has to find even more.
You can get the same answer more quickly using two commands:
select ligand z<10 & nucleic acid
select sel z<10 & ligand
The first command selects all nucleic acid residues that are near
ligands; the second selects all ligands that are near those residues.
Since "sel z<10" starts with only relevant nucleic acid residues, it is
much quicker to compute than "nucleic acid z<10". I tried this on 6s0x
(140K atoms, 153K bonds) and got the same answer for both methods. The
original method took over 2 minutes on my desktop; the two-stage method
took less than 10 seconds.
Conrad
On 10/2/2019 7:50 AM, Carlos G. Oliver wrote:
> Hi Elaine,
>
> You're right it seems with the current selection implementation we can't avoid scanning the whole molecule.
>
> I will have to resort to biopython :(
>
> Thanks again for all the help!
>
> Best,
> Carlos G. Oliver
>
> Sent with ProtonMail Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Tuesday, October 1, 2019 7:09 PM, Elaine Meng <meng at cgl.ucsf.edu> wrote:
>
>> Hi Carlos,
>> I tried to explain it before but was probably unclear. Your two commands were not comparable because your second command omitted the "nucleic acid z<10” part, and that is the slow part since there may be many nucleic acid residues.
>>
>> I don’t expect the total time to be much different if you do the fair comparison:
>>
>>> select ligand & nucleic acid z<10
>>
>> vs.
>>
>> select #0:ery & nucleic acid z<10
>>
>> NOT
>>
>>> select #0:ery z<10
>>
>> At least in my test structure, ChimeraX took 1 second compared to ??? (infinity? because I had to force quit Chimera).
>>
>> Best,
>> Elaine
>>
>>> On Oct 1, 2019, at 2:03 PM, Carlos G. Oliver cgoliver at protonmail.com wrote:
>>> Hi Elaine,
>>> Sorry for not sending to the user-list and thanks for your quick response!
>>> Yeah the problem is that I don't know the residue ID of the ligands beforehand so I need the `select ligand` call.
>>> One workaround I guess would be to use `writesel`to write a list of ligand residues in a file, and then read the file and insert residue IDs individually, as you suggested, in the distance filter.
>>> What would be ideal is a way of piping selections so that a selection can be based on something that was previously selected and not always on the whole model.
>>> Anyway thank you for the ChimeraX suggestion I'll give it a try but with the amount of time I was waiting I feel it will still be too slow.
>>> Thanks again for all the help!
>>> Best,
>>> Carlos G. Oliver
>>> Sent with ProtonMail Secure Email.
>>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>> On Tuesday, October 1, 2019 4:34 PM, Elaine Meng meng at cgl.ucsf.edu wrote:
>>>
>>>>> On Oct 1, 2019, at 11:39 AM, Carlos G. Oliver cgoliver at protonmail.com wrote:
>>>>> Hi Elaine,
>>>>> I just have a follow-up question on this topic.
>>>>> Specifically the command:
>>>>> select ligand & nucleic acid z<10
>>>>> I'm not sure how the & operator is working here but it seems that it considers the two selections independently and then takes the intersection.
>>>>> However it would be faster to first select the ligands and then within the ligand atoms find the ones that satisfy the second condition.
>>>>> When I tested it on 6s0z knowing beforehand the name of the residue:
>>>>> select #0:ery z<10
>>>>> The computation is much faster.
>>>>> Wondering if there is a way to more efficiently combine the selection conditions similar to this.
>>>>> Thanks again!
>>>>> Best,
>>>>> Carlos G. Oliver
>>>>
>>>> Hi Carlos,
>>>> Sending questions to chimera-users (CC’d here) is recommended unless involving private data. Others may know the answer when I don’t, and messages may fall through the cracks if you them only to my individual address.
>>>> I’m not a programmer and don’t know the code structure, so I don’t know if there is any ingenious way of structuring your specification to make it faster. There might not be a way.
>>>> However, your two commands seem to be doing totally different things. Is ERY the ligand? In that case your second command is lacking the “nucleic acid” part. The documentation says that & has highest priority,
>>>> http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/atom_spec.html#combinations
>>>> … so your second command
>>>>
>>>>> select ligand & nucleic acid z<10
>>>>
>>>> intersects ligand with all residues within 10 angstroms of nucleic acid. is that what you are trying to do, find all ligands within 10 A of nucleic acids? Naturally this is going to take much longer than your first command
>>>>
>>>>> select #0:ery z<10
>>>>
>>>> … which just finds all residues within 10 A of ligand ERY. It’s looking at a zone from one residue instead of a zone from many (hundreds?) of nucleic acid residues.
>>>> The comparison should instead be to
>>>> select #0:ery & nucleic acid z<10
>>>> … which I suspect would be just as slow. There are various ways to split up the selection process but I don’t have any reason to believe that they would be faster.
>>>> In general, ChimeraX is much faster than Chimera for working with large structures (say ribosome), at least in rendering, and allows using parentheses in command-line specifications so it’s clearer what you will get. In ChimeraX, the command could be something like
>>>> select ligand & (nucleic :<10)
>>>> ...which takes 1 second on my laptop with structure 6s0z, whereas Chimera with your first example command is just hanging on that same structure and had to be force-quit. However, maybe ChimeraX doesn’t do all of the other things you are currently trying to do.
>>>> ChimeraX is available under similar licensing conditions as Chimera (free for noncommercial use):
>>>> http://www.rbvi.ucsf.edu/chimerax/index.html
>>>> I hope this helps,
>>>> Elaine
>>>>
>>>> Elaine C. Meng, Ph.D.
>>>> UCSF Chimera(X) team
>>>> Department of Pharmaceutical Chemistry
>>>> University of California, San Francisco
>>>
>>> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
>>> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>
>
>
> _______________________________________________
> Chimera-users mailing list: Chimera-users at cgl.ucsf.edu
> Manage subscription: http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users
>
More information about the Chimera-users
mailing list