Package htsjdk.samtools.liftover
Class LiftOver
- java.lang.Object
-
- htsjdk.samtools.liftover.LiftOver
-
public class LiftOver extends Object
Java port of UCSC liftOver. Only the most basic liftOver functionality is implemented. Internally coordinates are 0-based, half-open. The API is standard Picard 1-based, inclusive.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LiftOver.PartialLiftover
Represents a portion of a liftover operation, for use in diagnosing liftover failures.
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_LIFTOVER_MINMATCH
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LiftOver.PartialLiftover>
diagnosticLiftover(Interval interval)
Map<String,Set<String>>
getContigMap()
long
getFailedIntervalsBelowThreshold()
double
getLiftOverMinMatch()
Get minimum fraction of bases that must remap.Interval
liftOver(Interval interval)
Lift over the given interval to the new genome build using the liftOverMinMatch set for this LiftOver object.Interval
liftOver(Interval interval, double liftOverMinMatch)
Lift over the given interval to the new genome build.void
resetFailedIntervalsBelowThresholdCounter()
Resets the internal counter that tracks intervals that failed liftover due to insufficient intersection lengthvoid
setLiftOverMinMatch(double liftOverMinMatch)
Set minimum fraction of bases that must remap.void
setShouldLogFailedIntervalsBelowThreshold(boolean logFailedIntervals)
By default any lifted interval that falls below liftOverMinMatch will be logged.void
validateToSequences(SAMSequenceDictionary sequenceDictionary)
Throw an exception if all the "to" sequence names in the chains are not found in the given sequence dictionary.
-
-
-
Field Detail
-
DEFAULT_LIFTOVER_MINMATCH
public static final double DEFAULT_LIFTOVER_MINMATCH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LiftOver
public LiftOver(File chainFile)
Load UCSC chain file in order to lift over Intervals.
-
-
Method Detail
-
setShouldLogFailedIntervalsBelowThreshold
public void setShouldLogFailedIntervalsBelowThreshold(boolean logFailedIntervals)
By default any lifted interval that falls below liftOverMinMatch will be logged. Set this to false to prevent logging.- Parameters:
logFailedIntervals
-
-
resetFailedIntervalsBelowThresholdCounter
public void resetFailedIntervalsBelowThresholdCounter()
Resets the internal counter that tracks intervals that failed liftover due to insufficient intersection length
-
getFailedIntervalsBelowThreshold
public long getFailedIntervalsBelowThreshold()
- Returns:
- The total number of intervals that have failed liftover due to insufficient intersection length
-
validateToSequences
public void validateToSequences(SAMSequenceDictionary sequenceDictionary)
Throw an exception if all the "to" sequence names in the chains are not found in the given sequence dictionary.
-
liftOver
public Interval liftOver(Interval interval)
Lift over the given interval to the new genome build using the liftOverMinMatch set for this LiftOver object.- Parameters:
interval
- Interval to be lifted over.- Returns:
- Interval in the output build coordinates, or null if it cannot be lifted over.
-
liftOver
public Interval liftOver(Interval interval, double liftOverMinMatch)
Lift over the given interval to the new genome build.- Parameters:
interval
- Interval to be lifted over.liftOverMinMatch
- Minimum fraction of bases that must remap.- Returns:
- Interval in the output build coordinates, or null if it cannot be lifted over.
-
diagnosticLiftover
public List<LiftOver.PartialLiftover> diagnosticLiftover(Interval interval)
-
getContigMap
public Map<String,Set<String>> getContigMap()
- Returns:
- the set of destination contigs for each source contig in the chains file.
-
getLiftOverMinMatch
public double getLiftOverMinMatch()
Get minimum fraction of bases that must remap.
-
setLiftOverMinMatch
public void setLiftOverMinMatch(double liftOverMinMatch)
Set minimum fraction of bases that must remap.
-
-