<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:#000066;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:#000066;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:#000066;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dear Guillermo<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>How did you create the VCF file that produced the 2 lines that gave you the problem?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Correct me if I am wrong DEVS, but I believe the file you indicated is not following the VCF specifications… Was this 2 individuals you were trying to merge? If so the 2 variations should be merged into 1 line like so:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal>#CHROM    POS    ID    REF    ALT    QUAL    FILTER    INFO    FORMAT    Sample1          Sample2<br>chr11    123502514    .    G    A,C    1000    .        GT:GK:VS:GF:PA:F3    0/1:0:2:0:2:0     0/2:0:2:0:2:0<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Use something like vcf-merge (from vcf tools to correctly merge VCF files.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If this was 1 individual then it would have become<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#CHROM    POS    ID    REF    ALT    QUAL    FILTER    INFO    FORMAT    Sample1<o:p></o:p></p><p class=MsoNormal>chr11    123502514    .    G    A,C    1000    .        GT:GK:VS:GF:PA:F3    1/2:0:2:0:2:0<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>just concatenating and sorting 2 vcf files will not be correct.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Just to make sure your file is valid you could probably use the vcf-validator (also in vcf-tools)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best regards<o:p></o:p></p><p class=MsoNormal><br>Duarte<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> dev-bounces@ensembl.org [mailto:dev-bounces@ensembl.org] <b>On Behalf Of </b>Guillermo Marco Puche<br><b>Sent:</b> 06 June 2013 10:50<br><b>To:</b> dev@ensembl.org<br><b>Subject:</b> Re: [ensembl-dev] Input information plugin for a variation on same chromosome and position<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Thanks to Duarte's code I've fixed my plugin to parse VCF input.<br><br>It's a shame all this information isn't on a devs guide for VEP. At least some information about all the available objects whould be nice.<br><br>Regards,<br>Guillermo.<br><br><br>On 06/05/2013 06:20 PM, Guillermo Marco Puche wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hello,<br><br>I've noticed that the plugin I'm using to parse my VCF is being wrong in one case.<br><br>In the case there's 2 variants in the same chromosome and the same position:<br><br>Here's the example:<br><br>Input VCF:<br><br>#CHROM    POS    ID    REF    ALT    QUAL    FILTER    INFO    FORMAT    DATA<br>chr11    123502514    .    G    A    1000    .        GT:GK:VS:GF:PA:F3    0/1:0:2:0:2:0<br>chr11    123502514    .    G    C    1000    .        GT:GK:VS:GF:PA:F3    0/1:0:2:0:2:0<br><br><br>The output is correct it reports all variants but the column refering to VAR ALLELE (which is parsed by my plugin) "C" allele is being reported in both cases. This is wrong. "A" and "C" alleles should be reported.<br><br>I suppose this is due because my plugin access the VCF input to parse information with Tabix.  And tabix access VCF input file with chr, start and end position. The chromosome and position being the same for both changes then the output from parse is incorrect.<br><br>I had to do this due to this because the VCF input used by my workmates is a bit weird.<br><br>The code for my vcf_input.pm parser is located here: <a href="https://github.com/guillermomarco/vep_plugins_71/blob/master/vcf_input.pm">https://github.com/guillermomarco/vep_plugins_71/blob/master/vcf_input.pm</a><br><br>Important lines for this problem are from line 102 to 126 (tabix related).<br><br>If accessing VCF file with tabix it's impossible to distinguish between two variations in same position, is there any other way I can access the VCF for the the current variation consequence without having to parse the whole input file?<br><br>I know Duarte Molha had a script to get VCF input information for the input line of consequence being calculated.<br><br>This must be the important line to access the input VCF line object:     <o:p></o:p></p><pre><b>my $line = $vf->{base_variation_feature_overlap}->{base_variation_feature}->{_line};</b><o:p></o:p></pre><p class=MsoNormal style='margin-bottom:12.0pt'><br>This is par of Duarte's code:<o:p></o:p></p><pre>sub run {<o:p></o:p></pre><pre>    my $self = shift;<o:p></o:p></pre><pre>    my $vf = shift;<o:p></o:p></pre><pre>    my $line_hash = shift;<o:p></o:p></pre><pre>    my $config = $self->{config};<o:p></o:p></pre><pre>    my $ind_cols = $config->{ind_cols};<o:p></o:p></pre><pre>    my $line = $vf->{base_variation_feature_overlap}->{base_variation_feature}->{_line};<o:p></o:p></pre><pre>    my $individual = $vf->{base_variation_feature_overlap}->{base_variation_feature}->{individual};<o:p></o:p></pre><pre>    my @split_line = split /[\s\t]+/, $line;<o:p></o:p></pre><pre>    my $qual_score = $split_line[5];<o:p></o:p></pre><pre>    my @gt_format  = split /:/, $split_line[8];<o:p></o:p></pre><pre>    my @gt_data    = split /:/, $split_line[$ind_cols->{$individual}];<o:p></o:p></pre><pre>    my $results = {map { shift @gt_format => $_ } @gt_data};<o:p></o:p></pre><pre>    $results->{"quality_score"} = $qual_score;<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>    return $results;<o:p></o:p></pre><pre>}<o:p></o:p></pre><p class=MsoNormal>Thank you.<br><br>Best regards,<br>Guillermo.<br><br><br><br><o:p></o:p></p><pre>_______________________________________________<o:p></o:p></pre><pre>Dev mailing list    <a href="mailto:Dev@ensembl.org">Dev@ensembl.org</a><o:p></o:p></pre><pre>Posting guidelines and subscribe/unsubscribe info: <a href="http://lists.ensembl.org/mailman/listinfo/dev">http://lists.ensembl.org/mailman/listinfo/dev</a><o:p></o:p></pre><pre>Ensembl Blog: <a href="http://www.ensembl.info/">http://www.ensembl.info/</a><o:p></o:p></pre></blockquote><p class=MsoNormal><o:p> </o:p></p></div></body></html>