Fix up liftover to enable lifting over indels
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4148 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
fb177c4fee
commit
9860db64a3
|
|
@ -81,11 +81,12 @@ public class LiftoverVariants extends RodWalker<Integer, Integer> {
|
||||||
|
|
||||||
private void convertAndWrite(VariantContext vc, ReferenceContext ref) {
|
private void convertAndWrite(VariantContext vc, ReferenceContext ref) {
|
||||||
|
|
||||||
final Interval fromInterval = new Interval(vc.getChr(), vc.getStart(), vc.getEnd());
|
final Interval fromInterval = new Interval(vc.getChr(), vc.getStart(), vc.getStart(), false, String.format("%s:%d", vc.getChr(), vc.getStart()));
|
||||||
|
final int length = vc.getEnd() - vc.getStart();
|
||||||
final Interval toInterval = liftOver.liftOver(fromInterval);
|
final Interval toInterval = liftOver.liftOver(fromInterval);
|
||||||
|
|
||||||
if ( toInterval != null ) {
|
if ( toInterval != null ) {
|
||||||
vc = VariantContextUtils.modifyLocation(vc, GenomeLocParser.createPotentiallyInvalidGenomeLoc(toInterval.getSequence(), toInterval.getStart(), toInterval.getEnd()));
|
vc = VariantContextUtils.modifyLocation(vc, GenomeLocParser.createPotentiallyInvalidGenomeLoc(toInterval.getSequence(), toInterval.getStart(), toInterval.getStart() + length));
|
||||||
writer.add(vc, ref.getBase());
|
writer.add(vc, ref.getBase());
|
||||||
successfulIntervals++;
|
successfulIntervals++;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue