public class AssemblyProcessingUtils extends Object
| Constructor and Description |
|---|
AssemblyProcessingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static double |
calculateCoordDistance(net.maizegenetics.util.Tuple<Integer,Integer> prev,
net.maizegenetics.util.Tuple<Integer,Integer> current)
Calculates distance between 2 sets of mummer coords file entries
This is called on coordinates that are both either ascending (start < end)
or both descending (start > end) so "sign" of entries is not checked here.
|
static boolean |
checkSnpEntryInRange(String mline,
com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> coordsRangeMap,
String chrom)
Verifies if the positions from a Mummer4 snp file fall within the range map
of reference and assembly positions created from the Mummer4 coordinates files.
|
static void |
exportMergedRegions(Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> mergedCoords,
String fileName)
Deprecated.
|
static List<htsjdk.variant.variantcontext.VariantContext> |
extractAnchorVariantContextsFromAssemblyAlignments(net.maizegenetics.dna.map.GenomeSequence refSequence,
String assemblyName,
com.google.common.collect.RangeSet<net.maizegenetics.dna.map.Position> anchors,
Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> refMappings,
com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> snps)
Method to build the list of VariantContexts based on the mapped coordinates and the SNPs
|
static int |
findAsmIndelStart(Collection<String> snpEntries) |
static net.maizegenetics.util.Tuple<Integer,Integer> |
findRefIndelStart(int refSnpPos,
Collection<String> snpEntries)
Find the lowest reference start entry from a mummer snp file list of entries.
|
static List<htsjdk.variant.variantcontext.VariantContext> |
findVCListForAnchor(List<htsjdk.variant.variantcontext.VariantContext> variantContextList,
int refStart,
int refEnd)
Find a subset of the VariantContext.
|
static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> |
getCoordsRangeMap(List<String> coordsList,
String chrom)
Create range map from list of entries from a Mummer coordinates file
|
static String |
getEntryFromTabDelimitedLine(String mline,
int entryColumn,
int totalColumns)
Returns the value for a specific column in a tab-delimited string
|
static com.google.common.collect.RangeSet<net.maizegenetics.dna.map.Position> |
getIndelRanges(com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> coordinates) |
static net.maizegenetics.util.Tuple<Integer,Double> |
getRegionCoverage(com.google.common.collect.RangeSet<Integer> rangeSet,
com.google.common.collect.Range<Integer> targetRange)
This method takes a RangeSet of integers, and a single range.
|
static net.maizegenetics.util.Tuple<Integer,Integer> |
getStartEndCoordinates(String entry,
boolean ref)
Find the start/end coordinates from a tab-delmimited Mummer4 coords file entry
|
static boolean |
isRefBlock(htsjdk.variant.variantcontext.VariantContext vc)
Simple method to determine if the current variant context is a reference block or not.
|
static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> |
mergeCoords(String coordFile,
String chromosome)
Deprecated.
|
static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> |
parseCoordinateRegions(String coordFile,
String chromosome)
Method to parse out the reference coordinates into a map which along with the SNP data can then be used to create Variants.
|
static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> |
parseMummerSNPFile(String fileName,
String chromosome)
Method to parse the Mummer SNP file into a rangemap
The first String in the tuple is for the reference call
The second String is for the assembly call
|
static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> |
resizeCoords(String coordFile,
String chromosome)
Test method to resize the coordinate files so they are not overlapping
|
static List<htsjdk.variant.variantcontext.VariantContext> |
resizeRefBlock(htsjdk.variant.variantcontext.VariantContext vc,
net.maizegenetics.dna.map.GenomeSequence refSequence,
net.maizegenetics.dna.map.Position positionToSplit,
boolean isStart)
Method which will take a variant Context which needs to be split and will output 2 new variants while updating ASM_* annotations.
|
static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> |
setupIndelVariants(Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> coordinates,
net.maizegenetics.dna.map.GenomeSequence refSequence,
net.maizegenetics.dna.map.GenomeSequence asmSequence)
Method to fill in the unmapped regions coming from nucmer.
|
static List<htsjdk.variant.variantcontext.VariantContext> |
splitRefRange(List<htsjdk.variant.variantcontext.VariantContext> variantContexts,
Map<Integer,ReferenceRange> anchorMapping,
net.maizegenetics.dna.map.GenomeSequence refSequence)
Method to split up the reference range by anchor mappings.
|
public static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> getCoordsRangeMap(List<String> coordsList, String chrom)
coordsList - List containing tab-delimited strings from a Mummer coordinates filechrom - String with chromosome namepublic static String getEntryFromTabDelimitedLine(String mline, int entryColumn, int totalColumns)
mline - entryColumn - - the column number (1-based) of the entry the caller wantstotalColumns - - total number of tab-delimited columns in the linepublic static net.maizegenetics.util.Tuple<Integer,Integer> getStartEndCoordinates(String entry, boolean ref)
entry: - Line from a mummer coords fileref - Boolean: if true, get ref start end. Otherwise, get assembly start/endpublic static double calculateCoordDistance(net.maizegenetics.util.Tuple<Integer,Integer> prev, net.maizegenetics.util.Tuple<Integer,Integer> current)
prev - current - public static boolean checkSnpEntryInRange(String mline, com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> coordsRangeMap, String chrom)
mline - public static List<htsjdk.variant.variantcontext.VariantContext> findVCListForAnchor(List<htsjdk.variant.variantcontext.VariantContext> variantContextList, int refStart, int refEnd)
variantContextList - refStart - refEnd - public static net.maizegenetics.util.Tuple<Integer,Double> getRegionCoverage(com.google.common.collect.RangeSet<Integer> rangeSet, com.google.common.collect.Range<Integer> targetRange)
rangeSet - targetRange - public static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> parseMummerSNPFile(String fileName, String chromosome)
fileName - chromosome - public static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> parseCoordinateRegions(String coordFile, String chromosome)
coordFile - chromosome - @Deprecated public static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> mergeCoords(String coordFile, String chromosome)
coordFile - chromosome - public static Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> resizeCoords(String coordFile, String chromosome)
coordFile - chromosome - @Deprecated public static void exportMergedRegions(Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> mergedCoords, String fileName)
mergedCoords - fileName - public static com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> setupIndelVariants(Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> coordinates, net.maizegenetics.dna.map.GenomeSequence refSequence, net.maizegenetics.dna.map.GenomeSequence asmSequence)
coordinates - refSequence - asmSequence - public static com.google.common.collect.RangeSet<net.maizegenetics.dna.map.Position> getIndelRanges(com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,List<net.maizegenetics.dna.map.Position>> coordinates)
public static List<htsjdk.variant.variantcontext.VariantContext> extractAnchorVariantContextsFromAssemblyAlignments(net.maizegenetics.dna.map.GenomeSequence refSequence, String assemblyName, com.google.common.collect.RangeSet<net.maizegenetics.dna.map.Position> anchors, Map<com.google.common.collect.Range<net.maizegenetics.dna.map.Position>,List<net.maizegenetics.dna.map.Position>> refMappings, com.google.common.collect.RangeMap<net.maizegenetics.dna.map.Position,net.maizegenetics.util.Tuple<String,String>> snps)
refSequence - assemblyName - anchors - refMappings - snps - public static List<htsjdk.variant.variantcontext.VariantContext> splitRefRange(List<htsjdk.variant.variantcontext.VariantContext> variantContexts, Map<Integer,ReferenceRange> anchorMapping, net.maizegenetics.dna.map.GenomeSequence refSequence)
variantContexts - anchorMapping - refSequence - public static boolean isRefBlock(htsjdk.variant.variantcontext.VariantContext vc)
vc - public static List<htsjdk.variant.variantcontext.VariantContext> resizeRefBlock(htsjdk.variant.variantcontext.VariantContext vc, net.maizegenetics.dna.map.GenomeSequence refSequence, net.maizegenetics.dna.map.Position positionToSplit, boolean isStart)
vc - refSequence - positionToSplit - isStart - public static net.maizegenetics.util.Tuple<Integer,Integer> findRefIndelStart(int refSnpPos, Collection<String> snpEntries)
refSnpPos - snpEntries - public static int findAsmIndelStart(Collection<String> snpEntries)
Copyright © 2018. All rights reserved.