<div dir="ltr">Hi Eva,<div><br></div><div>I'm not sure as I can't see more than one example of your input, but it looks like you might have the best luck converting your input to a VCF-like string; this way you can let the VEP take care of the position and allele transformations that you're attempting:</div><div><br></div><div>print "$al[0] $al[1] . $al2[0] $al2[1]\n";</div><br>which should result in:<br><br>8 133984814 . G GTT<div><br>and should be interpreted by the VEP as valid VCF (use --format vcf if it doesn't detect the format automatically).<div><br></div><div><br></div><div>Regards</div><div><br></div><div>Will McLaren</div><div>Ensembl Variation</div><div><br></div><div><br></div><div><br></div><div>A more thorough explanation:</div><div><br></div><div>The reason you are seeing an error is because the start coordinate should never be > end + 1; in most cases start<=end, but in the specific case of an insertion start = end + 1 (see <a href="http://www.ensembl.org/info/docs/tools/vep/vep_formats.html#vcf">http://www.ensembl.org/info/docs/tools/vep/vep_formats.html#vcf</a>). This example is an insertion of TT between bases 133984815 and 133984816, so should be described in Ensembl format as:</div><div><br></div><div>8 133984816 133984815 -/TT</div></div><div><br></div><div>This means checking for and stripping off any leading matching bases. The VEP's VCF parser expects to see these leading bases (any unbalanced substitution in VCF is represented this way), so it does the allele and position conversion for you.</div><div><br></div><div>If your example did not have matching bases in the reference and alternate alleles, then it would not be considered an insertion, rather an unbalanced substitution, e.g.</div><br>8:133984814 c.6056-29 C>GTT<br><br>would become<br><br>8 133984814 133984814 C/GTT<div><br></div><div>in Ensembl format. The key point to note is that the start and end coordinates represent the bases overlapped by the reference allele alone; the alternate allele can be any length or valid string and this won't affect the coordinates, i.e.</div><div><br></div><div>8 133984814 133984814 C/GTTACGGGAT<br></div><div><br></div><div><div>8 133984814 133984816 CTC/GTTACGGGAT</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 March 2015 at 15:23, Eva Goncalves Serra <span dir="ltr"><<a href="mailto:egs@sanger.ac.uk" target="_blank">egs@sanger.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:12px;font-family:Consolas,sans-serif">
<div>
<div>
<div>Hi, </div>
<div><br>
</div>
<div>I am trying to use vep75 (with cache) and had to re-format my input (which was not in vcf/or other compatible formats) to the ensembl input format. Thought I have done this successfully but I get an error in a specific insertion: </div>
<div><br>
</div>
<div>Original file entry:</div>
<div>8:133984814<span style="white-space:pre-wrap"> </span>c.6056-29<span style="white-space:pre-wrap">
</span>G>GTT</div>
</div>
</div>
<div><br>
</div>
<div>Formatted to ensembl format: </div>
<div>8 133984816 133984814 G/GTT +</div>
<div><br>
</div>
<div>Error I get:</div>
<div>WARNING: start > end+1 : (START=133984816, END=133984814) on line 19.</div>
<div><br>
</div>
<div>My code to reformat the input was this: </div>
<div><br>
</div>
<div>      my @split = split(/\t/); # splitting file by tabs</div>
<div>
<div>      my @al = split(':',$split[1]); # getting the chr:pos</div>
<div>      my @al2 = split('>',$split[3]); # getting the ref>alt</div>
<div><br>
</div>
<div>      if ((length $al2[0]==1) && (length $al2[1]==1)) {</div>
<div>        print "$al[0] $al[1] $al[1] $al2[0]/$al2[1] +\n";</div>
<div>      } elsif (length $al2[1] > length $al2[0]) {</div>
<div>            my $sub = (length $al2[1])-(length $al2[0]);</div>
<div>            my $new = $al[1]+$sub;</div>
<div>            print "$al[0] $new $al[1] $al2[0]/$al2[1] +\n";</div>
<div>      } elsif (length $al2[1] < length $al2[0]) {</div>
<div>             my $sub2 = (length $al2[0])-(length $al2[1]);</div>
<div>             my $new2 = $al[1]-$sub2; </div>
<div>             print "$al[0] $new2 $al[1] $al2[0]/$al2[1] +\n";</div>
<div>      }</div>
</div>
<div><br>
</div>
<div>Am I missing something?</div>
<div><br>
</div>
<div>Thanks a lot!</div><span class="HOEnZb"><font color="#888888">
<div><br>
</div>
<div>Eva</div>
</font></span></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" target="_blank">http://lists.ensembl.org/mailman/listinfo/dev</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" target="_blank">http://www.ensembl.info/</a><br>
<br></blockquote></div><br></div>