Bug fix for Tim: all point events must be treated equally
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4629 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
0e40321a52
commit
c9dbd8f80a
|
|
@ -66,7 +66,7 @@ public class FilterLiftedVariants extends RodWalker<Integer, Integer> {
|
|||
boolean failed = false;
|
||||
byte[] recordRef = vc.getReference().getBases();
|
||||
for (int i = 0; i < recordRef.length && i < MAX_VARIANT_SIZE; i++) {
|
||||
if ( recordRef[i] != ref[i + (vc.isSNP() ? 0 : 1)] ) {
|
||||
if ( recordRef[i] != ref[i + (vc.isPointEvent() ? 0 : 1)] ) {
|
||||
failed = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,14 +92,14 @@ public class LiftoverVariants extends RodWalker<Integer, Integer> {
|
|||
if ( toInterval != null ) {
|
||||
// check whether the strand flips, and if so reverse complement everything
|
||||
// TODO -- make this work for indels (difficult because the 'previous base' context needed will be changing based on indel type/size)
|
||||
if ( fromInterval.isPositiveStrand() != toInterval.isPositiveStrand() && (vc.isSNP() || !vc.isVariant()) ) {
|
||||
if ( fromInterval.isPositiveStrand() != toInterval.isPositiveStrand() && vc.isPointEvent() ) {
|
||||
vc = VariantContextUtils.reverseComplement(vc);
|
||||
}
|
||||
|
||||
vc = VariantContextUtils.modifyLocation(vc, GenomeLocParser.createPotentiallyInvalidGenomeLoc(toInterval.getSequence(), toInterval.getStart(), toInterval.getStart() + length));
|
||||
VariantContext newVC = VariantContext.createVariantContextWithPaddedAlleles(vc, ref.getBase(), false);
|
||||
|
||||
if ( originalVC.isVariant() && VariantContextUtils.getSNPSubstitutionType(originalVC) != VariantContextUtils.getSNPSubstitutionType(newVC) ) {
|
||||
if ( originalVC.isSNP() && VariantContextUtils.getSNPSubstitutionType(originalVC) != VariantContextUtils.getSNPSubstitutionType(newVC) ) {
|
||||
logger.warn(String.format("VCF at %s / %d => %s / %d is switching substitution type %s/%s to %s/%s",
|
||||
originalVC.getChr(), originalVC.getStart(), newVC.getChr(), newVC.getStart(),
|
||||
originalVC.getReference(), originalVC.getAlternateAllele(0), newVC.getReference(), newVC.getAlternateAllele(0)));
|
||||
|
|
|
|||
Loading…
Reference in New Issue