Bug fix for Chris: added method createPotentiallyInvalidGenomeLoc() to the GenomeLocParser that doesn't check that the contig exists in the sequence dictionary. This is crucial for lifting over from one reference to another, as sometimes contigs names change in the liftover (e.g. chrM to MT).
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3948 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
f247cbf68e
commit
84ca2f27bb
|
|
@ -26,7 +26,6 @@ package org.broadinstitute.sting.gatk.walkers.variantutils;
|
|||
|
||||
import org.broadinstitute.sting.commandline.Argument;
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFWriter;
|
||||
import org.broadinstitute.sting.utils.genotype.vcf.VCFUtils;
|
||||
import org.broadinstitute.sting.utils.GenomeLocParser;
|
||||
import org.broadinstitute.sting.utils.SampleUtils;
|
||||
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
|
||||
|
|
@ -85,7 +84,7 @@ public class LiftoverVariants extends RodWalker<Integer, Integer> {
|
|||
final Interval toInterval = liftOver.liftOver(fromInterval);
|
||||
|
||||
if ( toInterval != null ) {
|
||||
vc = VariantContextUtils.modifyLocation(vc, GenomeLocParser.createGenomeLoc(toInterval.getSequence(), toInterval.getStart(), toInterval.getEnd()));
|
||||
vc = VariantContextUtils.modifyLocation(vc, GenomeLocParser.createPotentiallyInvalidGenomeLoc(toInterval.getSequence(), toInterval.getStart(), toInterval.getEnd()));
|
||||
writer.add(vc, ref.getBase());
|
||||
successfulIntervals++;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -407,6 +407,20 @@ public class GenomeLocParser {
|
|||
return exceptionOnInvalidGenomeLoc(new GenomeLoc(contig, GenomeLocParser.getContigIndex(contig,true), start, stop));
|
||||
}
|
||||
|
||||
/**
|
||||
* create a genome loc, given the contig name, start, and stop
|
||||
*
|
||||
* @param contig the contig name
|
||||
* @param start the starting position
|
||||
* @param stop the stop position
|
||||
*
|
||||
* @return a new genome loc - but don't exception out if it is invalid
|
||||
*/
|
||||
public static GenomeLoc createPotentiallyInvalidGenomeLoc(String contig, final long start, final long stop) {
|
||||
checkSetup();
|
||||
return new GenomeLoc(contig, GenomeLocParser.getContigIndex(contig,false), start, stop);
|
||||
}
|
||||
|
||||
/**
|
||||
* create a genome loc, given the contig index, start, and stop
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue