Skip to content
Snippets Groups Projects
Commit 426f0590 authored by tjc's avatar tjc
Browse files

use getNumberofIndels()

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@15571 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 159b5d18
No related branches found
No related tags found
No related merge requests found
......@@ -390,7 +390,7 @@ class IOUtils
if(vcfRecord.getAlt().isDeletion(vcf_v4))
{
int ndel = vcfRecord.getAlt().getNumberOfDeletions(vcf_v4);
int ndel = vcfRecord.getAlt().getNumberOfIndels(vcf_v4);
if(!vcfRecord.getAlt().toString().equals(".") && isFwd)
{
buff.append(getBase(vcfRecord.getAlt().toString(), isFwd));
......
......@@ -79,16 +79,18 @@ public class VariantBase
return alt.split(",").length + 1;
}
protected int getNumberOfDeletions(boolean vcf_v4)
protected int getNumberOfIndels(boolean vcf_v4)
{
if (vcf_v4)
{
if (alt.equals("."))
return record.getRef().length();
return record.getRef().length() - alt.length();
return Math.abs(record.getRef().length() - alt.length());
}
int index = alt.indexOf("D");
if(index < 0)
index = alt.indexOf("I");
int ndel = 0;
try
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment