<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000066">
    Dear Will,<br>
    <br>
    Your explanation is very helpful. I'll try to fix my problems
    changing variant order as you mentioned.<br>
    Anyways I think for the most part of users, the order should be
    chr1-22,X,Y,M (almost all the human references are already sorted
    into that order).<br>
    <br>
    Thank you very much.<br>
    <br>
    Best regards,<br>
    Guillermo.<br>
    <br>
    <div class="moz-cite-prefix">On 04/30/2014 10:18 AM, Will McLaren
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAMVEDX2pkwcwbDjXrdPOz9xMuZLJcWV4g5LdTvMrLe_iFY7ADQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Guillermo,
        <div><br>
        </div>
        <div>Currently the VEP internally sorts each buffer of 5000
          variants that it reads in before writing the output. The sort
          is done alphanumerically, so it will order e.g. 1-22,M,X,Y.</div>
        <div><br>
        </div>
        <div>It looks like the buffer partially overlaps your input
          groups, such that, in your example, the first buffer read
          would be</div>
        <div><br>
        </div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant1</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant2</span><br>
        </div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">These
            are parsed, sorted and written out. Then the buffer reads in
            the next batch:</span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant3</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant4</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrM
            variant1</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrM
            variant2</span><span
            style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><font face="arial, sans-serif">which then get sorted to</font></div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div>
          <span style="font-family:arial,sans-serif;font-size:13px">chrM
            variant1</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrM
            variant2</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant3</span><br
            style="font-family:arial,sans-serif;font-size:13px">
          <span style="font-family:arial,sans-serif;font-size:13px">chrX
            variant4</span><font face="arial, sans-serif"><br>
          </font></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">since
            M is before X alphabetically. So, I'm afraid this explains
            but doesn't fix your problem! You could ensure that your
            chrM variants appear before your chrX and chrY variants in
            the file, and this problem shouldn't appear.</span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><font face="arial, sans-serif">For the next VEP release
            I'll look into retaining the input sorting when using VCF as
            the output format as I think this would be preferable for
            most users.</font></div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div><font face="arial, sans-serif">Regards</font></div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div><font face="arial, sans-serif">Will McLaren</font></div>
        <div><font face="arial, sans-serif">Ensembl Variation</font></div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On 30 April 2014 07:47, Guillermo Marco
          Puche <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:guillermo.marco@sistemasgenomicos.com"
              target="_blank">guillermo.marco@sistemasgenomicos.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000066"> Dear developers,<br>
              <br>
              I'm experiencing a strange behavior when annotating a full
              sorted VCF file.<br>
              My chr order is the following: chr1 to chr22, chrX, chrY,
              chrM.<br>
              <br>
              I've noticed when I've variants in chrX then in chrM the
              vep scripts annotates the full vcf file but it changes the
              order of some of the lines. See example below:<br>
              <br>
              Imagine I've the following variants in my vcf:<br>
              <br>
              chrX variant1<br>
              chrX variant2<br>
              chrX variant3<br>
              chrX variant4<br>
              chrM variant1<br>
              chrM variant2<br>
              <br>
              After annotating the VCF the order remains like this:<br>
              <br>
              chrX variant1<br>
              chrX variant2<br>
              chrM variant1<br>
              chrM variant2<br>
              chrX variant3<br>
              chrX variant4<br>
              <br>
              This is just a graphical example. I would like to fix
              this, because it's a bit tricky to get a non sorted VCF
              annotated file. I've not experienced this issue with other
              chrX and chrM. Already tried to debug this disabling all
              the plugins and the issue reproduces itself.<br>
              <br>
              Thank very much.<br>
              <br>
              Best regards,<br>
              Guillermo.<br>
            </div>
            <br>
            _______________________________________________<br>
            Dev mailing list    <a moz-do-not-send="true"
              href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
            Posting guidelines and subscribe/unsubscribe info: <a
              moz-do-not-send="true"
              href="http://lists.ensembl.org/mailman/listinfo/dev"
              target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
            Ensembl Blog: <a moz-do-not-send="true"
              href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Dev mailing list    <a class="moz-txt-link-abbreviated" href="mailto:Dev@ensembl.org">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a class="moz-txt-link-freetext" href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a class="moz-txt-link-freetext" href="http://www.ensembl.info/">http://www.ensembl.info/</a>
</pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>