<div style="white-space:pre-wrap">Hi Lucy,<br><br>This might help, there&#39;s a argument with merge_events named &#39;replace_events&#39; that allows you to retain the original values when set to False. In your example, you could combine 11 and 12 and assign to a value like 99. In your event_id dict, you could then assign CondE to 99. <br><br>HTH,</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 18, 2016 at 09:52 Lucy MacGregor &lt;<a href="mailto:Lucy.MacGregor@mrc-cbu.cam.ac.uk">Lucy.MacGregor@mrc-cbu.cam.ac.uk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Dear Natalie,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you for the suggestion. My understanding of mne.epochs.combine_event_ids is that it replaces the original events with new ones whereas I would like to
 retain the original events which is why I initially tried mne.event.merge_events.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">I can now do what I want to do using Mainak’s suggestion to use the hierarchical feature of epoch selection. I created multiple evoked files corresponding to
 my various event combinations then saved the combinations into one file using mne.write_evokeds.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Thank you both!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Best,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Lucy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> [mailto:<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>]
<b>On Behalf Of </b>Natalie Klein<br>
<b>Sent:</b> 18 February 2016 13:02</span></p></div></div><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"><br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] merge/combine events MNE Python<u></u><u></u></span></p></div></div><div lang="EN-GB" link="blue" vlink="purple"><div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Dear Lucy,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Maybe I misunderstand what you are trying to do, but it seems like mne.epochs.combine_event_ids might be helpful. I&#39;m not sure what you mean about saving them all into one file but you could define new event ids to combine epochs across
 conditions then create evoked files from those. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, Feb 18, 2016 at 7:45 AM, Lucy MacGregor &lt;<a href="mailto:Lucy.MacGregor@mrc-cbu.cam.ac.uk" target="_blank">Lucy.MacGregor@mrc-cbu.cam.ac.uk</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Dear Mainak,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Many thanks for the reply and the pointer. This seems helpful to access different combinations of
 the events, but is it then possible to create multiple new epoch objects (condE and condF) which can be then saved together in a single evoked file along with the originals? Ideally I would have the event/condition averages for all conditions (new and old)
 in one file.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Best,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d">Lucy</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> [mailto:<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>]
<b>On Behalf Of </b>Mainak Jas<br>
<b>Sent:</b> 18 February 2016 10:22<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] merge/combine events MNE Python</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Dear Lucy,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">It seems what you want to do is to use the hierarchical epochs selection. If you have an epochs object which contains condA, condB, condC and condD, you can get epochs of condE by simply
 using epochs[&#39;condA&#39;, &#39;condB&#39;]. Please take a look at the MNE reference API for the epochs object:
<a href="http://martinos.org/mne/stable/generated/mne.Epochs.html#mne.Epochs" target="_blank">
http://martinos.org/mne/stable/generated/mne.Epochs.html#mne.Epochs</a> (look at the Notes section). Does this solve your problem?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mainak<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">On Thu, Feb 18, 2016 at 10:27 AM, Lucy MacGregor &lt;<a href="mailto:Lucy.MacGregor@mrc-cbu.cam.ac.uk" target="_blank">Lucy.MacGregor@mrc-cbu.cam.ac.uk</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">Dear MNE Python users,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">I would like to combine event codes to create a number of new events whilst retaining the originals. E.g.,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondA = 11</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondB = 12</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondC = 13</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondD = 14</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondE = 11,12</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">CondF = 13,14</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">Is there a straightforward way to do this? I have seen this thread</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"><a href="https://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/2013-April/001498.html" target="_blank">https://mail.nmr.mgh.harvard.edu/pipermail//mne_analysis/2013-April/001498.html</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">Using mne.event.merge_events works fine when I was just creating one new event (as does the alternative method of
 combining events at the evoked stage) but I’m unsure of the most sensible way to proceed given I want to create multiple new events. I originally did this:</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">events=mne.event.merge_events(events, [11,12], 1112, replace_events=False)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">events=mne.event.merge_events(events, [13,14], 1314 replace_events=False)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">but then, because I’m not replacing events, I end up with multiple copies of all events (even those not included
 in the merge_events function)  at a given sample point, which isn’t ideal.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">As a new MNE Python user (I previously used MNE) I would be grateful for any advice as the best way to do this.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">Thank you,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;">Lucy MacGregor</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">******************************************************************</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">Lucy MacGregor</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">MRC Cognition and Brain Sciences Unit</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">15 Chaucer Road</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">Cambridge CB2 7EF</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">Tel: 01223 355294 Ext 860</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6"><a href="http://www.mrc-cbu.cam.ac.uk/people/lucy.macgregor/" target="_blank">http://www.mrc-cbu.cam.ac.uk/people/lucy.macgregor/</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6">This e-mail may have a protective marking.  For an explanation please see</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#a6a6a6"><a href="http://www.mrc.ac.uk/About/Informationandstandards/Documentmarking/index.htm" target="_blank">http://www.mrc.ac.uk/About/Informationandstandards/Documentmarking/index.htm</a></span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div>

_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
</blockquote></div><div dir="ltr">-- <br></div>teon<br>--<br>Envoyé de mon iPhone