Bug fix: when extracting reference sequence for the event from the reference genome, the tool was treating Deletions and MNPs of length N in exactly the same way: ref_bases[current_pos+1,...,current_pos+N]. This is correct for Deletions but not for MNPs
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5258 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
497e9ab83b
commit
0e04e95245
|
|
@ -120,10 +120,14 @@ public class ValidateVariants extends RodWalker<Integer, Integer> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deletions are associated with the (position of) the last (preceding) non-deleted base;
|
||||||
|
// hence to get actually deleted bases we need offset = 1
|
||||||
|
int offset = 1 ;
|
||||||
|
if ( vc.getType() == VariantContext.Type.MNP ) offset = 0; // if it's an MNP, the reported position IS the first modified base
|
||||||
byte[] refBytes = ref.getBases();
|
byte[] refBytes = ref.getBases();
|
||||||
byte[] trueRef = new byte[reportedRefAllele.length()];
|
byte[] trueRef = new byte[reportedRefAllele.length()];
|
||||||
for (int i = 0; i < reportedRefAllele.length(); i++)
|
for (int i = 0; i < reportedRefAllele.length(); i++)
|
||||||
trueRef[i] = refBytes[i+1];
|
trueRef[i] = refBytes[i+offset];
|
||||||
observedRefAllele = Allele.create(trueRef, true);
|
observedRefAllele = Allele.create(trueRef, true);
|
||||||
}
|
}
|
||||||
// SNPs, etc.
|
// SNPs, etc.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue