## Re: [PyMOL] Make sure zoom is viewed from surface

 Re: [PyMOL] Make sure zoom is viewed from surface From: Thomas Holder - 2012-10-09 16:59:44 Attachments: zoomoutside.py ```Hi Troels, Jason, Edward, nice little problem and nice layouts by Jason and Edward. Let me contribute some code, it follows Edwards approach. See attachment. Requires psico. Cheers, Thomas Edward A. Berry wrote, On 10/08/12 20:57: > Jason Vertrees wrote: >> Hi Troels, >> >> I've run into this problem a few times, too, but never took the time >> to solve it correctly. >> >> A quick plan might look like: >> * cmd.orient on the selection >> * store the view vector (http://www.pymolwiki.org/index.php/Get_View) >> * let C1 = count the number of atoms behind the view vector, using >> something like (http://www.pymolwiki.org/index.php/SelInside) >> * invert the view vector >> * let C2 = count the number of atoms behind the view vector, using >> something like (http://www.pymolwiki.org/index.php/SelInside) >> * compare C1 to C2, choosing the >> * if C2< C1 then flip the view >> >> You could use other tricks. I'm sure the community has other ideas. > > Calculate center of mass or average of all coordinates > calculate vector from that to point of interest > rotate view so that vector points toward front/camera > translate so point of interest is centerd > > maybe reverse the last two steps? > >> Cheers, >> >> -- Jason >> >> >> On Sun, Oct 7, 2012 at 10:04 AM, Troels Emtekær Linnet >> wrote: >>> Hi pymolers. >>> >>> I am generating a list of residue ID's from some calculations. >>> Now I want to make a little script that select the residue and sticks it >>> and then zoom and make .png file. >>> >>> How do I make sure that the zoom, is viewed from "outside" the protein for >>> each residue/.png file? >>> >>> Best >>> >>> Troels Emtekær Linnet >>> Ved kløvermarken 9, 1.th >>> 2300 København S >>> Mobil: +45 60210234 -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen ```

 [PyMOL] Make sure zoom is viewed from surface From: Troels Emtekær Linnet - 2012-10-07 15:05:13 Attachments: Message as HTML ```Hi pymolers. I am generating a list of residue ID's from some calculations. Now I want to make a little script that select the residue and sticks it and then zoom and make .png file. How do I make sure that the zoom, is viewed from "outside" the protein for each residue/.png file? Best Troels Emtekær Linnet Ved kløvermarken 9, 1.th 2300 København S Mobil: +45 60210234 ```
 Re: [PyMOL] Make sure zoom is viewed from surface From: Jason Vertrees - 2012-10-08 17:22:56 ```Hi Troels, I've run into this problem a few times, too, but never took the time to solve it correctly. A quick plan might look like: * cmd.orient on the selection * store the view vector (http://www.pymolwiki.org/index.php/Get_View) * let C1 = count the number of atoms behind the view vector, using something like (http://www.pymolwiki.org/index.php/SelInside) * invert the view vector * let C2 = count the number of atoms behind the view vector, using something like (http://www.pymolwiki.org/index.php/SelInside) * compare C1 to C2, choosing the * if C2 < C1 then flip the view You could use other tricks. I'm sure the community has other ideas. Cheers, -- Jason On Sun, Oct 7, 2012 at 10:04 AM, Troels Emtekær Linnet wrote: > Hi pymolers. > > I am generating a list of residue ID's from some calculations. > Now I want to make a little script that select the residue and sticks it > and then zoom and make .png file. > > How do I make sure that the zoom, is viewed from "outside" the protein for > each residue/.png file? > > Best > > Troels Emtekær Linnet > Ved kløvermarken 9, 1.th > 2300 København S > Mobil: +45 60210234 > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > _______________________________________________ > PyMOL-users mailing list (PyMOL-users@...) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pymol-users@... -- Jason Vertrees, PhD PyMOL Product Manager Schrödinger, Inc. (e) Jason.Vertrees@... (o) +1 (603) 374-7120 ```
 Re: [PyMOL] Make sure zoom is viewed from surface From: Edward A. Berry - 2012-10-08 19:31:33 ```Jason Vertrees wrote: > Hi Troels, > > I've run into this problem a few times, too, but never took the time > to solve it correctly. > > A quick plan might look like: > * cmd.orient on the selection > * store the view vector (http://www.pymolwiki.org/index.php/Get_View) > * let C1 = count the number of atoms behind the view vector, using > something like (http://www.pymolwiki.org/index.php/SelInside) > * invert the view vector > * let C2 = count the number of atoms behind the view vector, using > something like (http://www.pymolwiki.org/index.php/SelInside) > * compare C1 to C2, choosing the > * if C2< C1 then flip the view > > You could use other tricks. I'm sure the community has other ideas. > Calculate center of mass or average of all coordinates calculate vector from that to point of interest rotate view so that vector points toward front/camera translate so point of interest is centerd maybe reverse the last two steps? > Cheers, > > -- Jason > > > On Sun, Oct 7, 2012 at 10:04 AM, Troels Emtekær Linnet > wrote: >> Hi pymolers. >> >> I am generating a list of residue ID's from some calculations. >> Now I want to make a little script that select the residue and sticks it >> and then zoom and make .png file. >> >> How do I make sure that the zoom, is viewed from "outside" the protein for >> each residue/.png file? >> >> Best >> >> Troels Emtekær Linnet >> Ved kløvermarken 9, 1.th >> 2300 København S >> Mobil: +45 60210234 >> >> >> ------------------------------------------------------------------------------ >> Don't let slow site performance ruin your business. Deploy New Relic APM >> Deploy New Relic app performance management and know exactly >> what is happening inside your Ruby, Python, PHP, Java, and .NET app >> Try New Relic at no cost today and get our sweet Data Nerd shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> _______________________________________________ >> PyMOL-users mailing list (PyMOL-users@...) >> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users >> Archives: http://www.mail-archive.com/pymol-users@... > > > ```
 Re: [PyMOL] Make sure zoom is viewed from surface From: Thomas Holder - 2012-10-09 16:59:44 Attachments: zoomoutside.py ```Hi Troels, Jason, Edward, nice little problem and nice layouts by Jason and Edward. Let me contribute some code, it follows Edwards approach. See attachment. Requires psico. Cheers, Thomas Edward A. Berry wrote, On 10/08/12 20:57: > Jason Vertrees wrote: >> Hi Troels, >> >> I've run into this problem a few times, too, but never took the time >> to solve it correctly. >> >> A quick plan might look like: >> * cmd.orient on the selection >> * store the view vector (http://www.pymolwiki.org/index.php/Get_View) >> * let C1 = count the number of atoms behind the view vector, using >> something like (http://www.pymolwiki.org/index.php/SelInside) >> * invert the view vector >> * let C2 = count the number of atoms behind the view vector, using >> something like (http://www.pymolwiki.org/index.php/SelInside) >> * compare C1 to C2, choosing the >> * if C2< C1 then flip the view >> >> You could use other tricks. I'm sure the community has other ideas. > > Calculate center of mass or average of all coordinates > calculate vector from that to point of interest > rotate view so that vector points toward front/camera > translate so point of interest is centerd > > maybe reverse the last two steps? > >> Cheers, >> >> -- Jason >> >> >> On Sun, Oct 7, 2012 at 10:04 AM, Troels Emtekær Linnet >> wrote: >>> Hi pymolers. >>> >>> I am generating a list of residue ID's from some calculations. >>> Now I want to make a little script that select the residue and sticks it >>> and then zoom and make .png file. >>> >>> How do I make sure that the zoom, is viewed from "outside" the protein for >>> each residue/.png file? >>> >>> Best >>> >>> Troels Emtekær Linnet >>> Ved kløvermarken 9, 1.th >>> 2300 København S >>> Mobil: +45 60210234 -- Thomas Holder MPI for Developmental Biology Spemannstr. 35 D-72076 Tübingen ```