<div dir="ltr">Hi Guillermo,<div><br></div><div>Thanks for this.</div><div><br></div><div>I'd suggest</div><div><br></div><div>1) make this new functionality optional. It should be enabled if the user specifies a parameter, something like</div><div><br></div><div>--plugin ExAC,exac.vcf.gz,AC,AN</div><div><br></div><div>You can access these parameters using $self->params() in the new() method - see the current code for how it used to get the file name</div><div><br></div><div>2) put in a pull request against the original plugin on our repo and we can merge it in if it looks good.</div><div><br></div><div>Cheers</div><div><br></div><div>Will McLaren</div><div>Ensembl Variation</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 November 2015 at 11:32, Guillermo Marco Puche <span dir="ltr"><<a 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">
    OK got it, updated version can be found on my Github mentioned on
    previous mail.<br>
    <br>
    The point is that "AN" was being used to get total AN, however all
    the population frequencies in ExAC are adjusted. AN_adj should be
    used to provide consistent information to the one shown in ExAC
    website.<br>
    In my last commit I've added this logic, It will use AN_adj if
    exists and not zero. This shouldn't modify population allele
    frequencies but the total AN count only.<br>
    <br>
    Don't know if it will be useful for you too guys.<br>
    <br>
    Regards,<br>
    Guillermo.<div><div class="h5"><br>
    <br>
    <div>On 02/11/15 10:43, Guillermo Marco
      Puche wrote:<br>
    </div>
    <blockquote type="cite">
      
      Hello Will,<br>
      <br>
      I've come up with a modified version of your ExAC plugin that
      writes AC/AN counts per pop to the output you can check the code
      here: <a href="https://github.com/guillermomarco/vep_plugins/blob/master/ExAC.pm" target="_blank">https://github.com/guillermomarco/vep_plugins/blob/master/ExAC.pm</a><br>
      <br>
      However debugging this for the new columns I've found a bug. I'm
      testing the script with the following mutation that has ExAC
      information (<a href="http://exac.broadinstitute.org/variant/22-46615880-T-C" target="_blank">http://exac.broadinstitute.org/variant/22-46615880-T-C</a>):<br>
      <br>
      22      46615880        rs1800234       T       C       .      
      .       AA=T<br>
       <br>
      All the counts per population and frequencies are identical to
      those in ExAC website, however for the totals I'm getting:<br>
      <ul>
        <li>Allele count: 1163 (OK)</li>
        <li>Allele number: 121412 (this differs from ExAC website that
          shows<b> 120986</b><b style="font-weight:bold;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:11.4286px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"> and its the correct sum total of all the pops)</b></li>
      </ul>
      <p>Maybe there's something else being added up, but I can't find
        where's the problem since all individual allele pop counts are
        OK. Gonna check ExAC VCF for this position to see if I can any
        clue.<br>
      </p>
      <p>Regards,<br>
        Guillermo.<br>
      </p>
      <div>On 02/11/15 09:23, Guillermo Marco
        Puche wrote:<br>
      </div>
      <blockquote type="cite">
        
        Hello Will,<br>
        <br>
        I'm interested to print AC and AN count for each population in
        ExAC VEP plugin output. I've modified the following lines to
        store the data:<br>
        <br>
        
        
        <pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'Source Code Pro';font-size:13.5pt">  <span style="color:#cc7832">foreach my </span>$a(@vcf_alleles) {
    <span style="color:#cc7832">my </span>$ac = <span style="color:#ab51ba">shift </span>@ac;
    $total_ac += $ac;
    $data->{$a}->{<span style="color:#6a8759">'ExAC_'</span>.$afh.<span style="color:#6a8759">'_AC'</span>} = $ac;
    $data->{$a}->{<span style="color:#6a8759">'ExAC_'</span>.$afh.<span style="color:#6a8759">'_AN'</span>} = $an;
    $data->{$a}->{<span style="color:#6a8759">'ExAC_'</span>.$afh} = sprintf(<span style="color:#6a8759">"%.3g"</span>, $ac / $an);
  }

  <span style="color:#808080;font-style:italic"># use total to get ref allele freq
</span><span style="color:#808080;font-style:italic">  </span>$data->{$ref_allele}->{<span style="color:#6a8759">'ExAC_'</span>.$afh.<span style="color:#6a8759">'_AC'</span>} = $total_ac;
  $data->{$ref_allele}->{<span style="color:#6a8759">'ExAC_'</span>.$afh.<span style="color:#6a8759">'_AN'</span>} = $an;
  $data->{$ref_allele}->{<span style="color:#6a8759">'ExAC_'</span>.$afh} = sprintf(<span style="color:#6a8759">"%.3g"</span>, <span style="color:#6897bb">1 </span>- ($total_ac / $an));
}</pre>
        However I'm getting a bit messy when it comes to header
        function. It loops over ExAC header, but I don't know how to
        modify get_header_info() to output the desired columns.<br>
        <br>
        <br>
        Regards,<br>
        Guillermo.<br>
        <br>
        <fieldset></fieldset>
        <br>
        <pre>_______________________________________________
Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a>
</pre>
      </blockquote>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a>
Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a>
Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a>
</pre>
    </blockquote>
  </div></div></div>

<br>_______________________________________________<br>
Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><br>
Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" rel="noreferrer" target="_blank">http://www.ensembl.info/</a><br>
<br></blockquote></div><br></div>