<span>On 05/03/11, <b class="name">jonathan </b> &lt;jkhao@ifr88.cnrs-mrs.fr&gt; wrote:</span><blockquote cite="mid:1299249297.5473.50.camel@rubrum" class="iwcQuote" style="border-left: 1px solid rgb(0, 0, 255); padding-left: 13px; margin-left: 0pt;" type="cite"><div class="mimepart text plain">I previously supposed that the number of lipids selected was constant to<br />simplify the problem. <br /><br />The distance criteria gives a different number of lipids for each frame.<br />To end up with  a constant number of atoms in the output trajectory,<br />each lipid selected in a frame is written in a separate output frame.<br />I then end up with an output trajectory of a single lipid, with a number<br />of frames equal to the number of lipids selected over the whole<br />trajectory. </div></blockquote>You seem to want a dynamic selection for each frame. Then, to split that selection into individual molecules, and then concentate a pseudo-trajectory from the set of all molecules found in that frame. Then concatenate a further pseudo-trajectory from the trajectory created from each frame.<br /><br />In the fullness of time you'll be able to do the first part in one hit, but for the moment I think you need to run g_select -on, split the trajectory into frames (so you don't have to read the whole file for the frame of interest), and then apply trjconv (mode 2) with the matching index group for each frame. Then somehow split each resulting frame into molecules (e.g. a further trjconv mode 2), and re-concatenate. All of that is best done with a shell/Perl/python script calling the existing GROMACS tools. The result will be only slightly slower than a C solution, and much faster to develop.<br /><br />Mark<br /><br /><blockquote cite="mid:1299249297.5473.50.camel@rubrum" class="iwcQuote" style="border-left: 1px solid rgb(0, 0, 255); padding-left: 13px; margin-left: 0pt;" type="cite"><div class="mimepart text plain">As my analysis does not depend on time, loosing the correspondence<br />between the input trajectory frame and the output trajectory frame is<br />not important.<br /><br />It becomes obvious that using the index from g_select is not appropriate<br />for this on large trajectories ...<br /><br />I'm trying to avoid modifying the trjconv or g_select source to get this<br />working, so any suggestions are welcomed !<br />If there's no other way, I'll switch to gmx-dev list.<br /><br /><br />Jonathan  <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />-- <br />gmx-users mailing list    gmx-users@gromacs.org<br /><a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="l">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br />Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/Search" target="l">http://www.gromacs.org/Support/Mailing_Lists/Search</a> before posting!<br />Please don't post (un)subscribe requests to the list. Use the <br />www interface or send it to gmx-users-request@gromacs.org.<br />Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" target="l">http://www.gromacs.org/Support/Mailing_Lists</a><br /></div></blockquote>