Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-28 Thread Thomas Holder
Hi Tsjerk, Spencer, Osvaldo, cmd.get_raw_alignment() might be what you are looking for. http://pymolwiki.org/index.php/Get_raw_alignment Cheers, Thomas On 27 Oct 2015, at 12:49, Spencer Bliven wrote: > Tsjerk– > > You might be able to extract the ids of the aligned residues from an > alig

Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-27 Thread Spencer Bliven
Tsjerk– You might be able to extract the ids of the aligned residues from an alignment object: cmd.align(sele1,sele2copy,object="aln") [a.id for a in cmd.get_model('aln').atom] Since the alignment is sequential, I think this should contain all the aligned atoms from sele1 concatenated with the a

Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-27 Thread Tsjerk Wassenaar
Hi Osvaldo, Probably that's the trick, although I'd need the indices, but that's simple enough. The 'equivalence' one is still standing though :) Thanks, Tsjerk On Tue, Oct 27, 2015 at 11:44 AM, Osvaldo Martin wrote: > So, you want to know the best way to do this? > > Z = [at_x for at_x in X

Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-27 Thread Osvaldo Martin
So, you want to know the best way to do this? Z = [at_x for at_x in X for at_y in Y if at_x.id == at_y.id] Or am I still not getting it right? Cheers, Osvaldo. On Tue, Oct 27, 2015 at 10:56 AM, Tsjerk Wassenaar wrote: Hi Osvaldo, > > I could have been more clear I guess. First of all, let's s

Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-27 Thread Tsjerk Wassenaar
Hi Osvaldo, I could have been more clear I guess. First of all, let's say I have obtained the atom list of a selection: X = cmd.get_model(selection1).atom I'm doing stuff with that (PCA, to be exact), but now I want to display the result only for a subselection. Probably getting the intersection

Re: [PyMOL] Common atoms in two selections (and their indices)

2015-10-27 Thread Osvaldo Martin
Hi Tsjerk, Do you mean something like this? cmd.index("sel_1 and sel_2") I do not get the differences between your two cases. Whats the difference between “atoms which are both in selection 1 and 2” and “matching atoms in the two selections” Cheers, Osvaldo. On Mon, Oct 26, 2015 at 10:33 AM,

[PyMOL] Common atoms in two selections (and their indices)

2015-10-26 Thread Tsjerk Wassenaar
Hi Thomas e.a., Given two selections, would there be an easy way to 1. find the atoms which are both in selection 1 and 2, and the indices of those in the selections and 2. find the matching atoms in the two selections, like align does, and the indices of those in the selections Thanks, Tsjer