public final class SVUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SVUtils.IteratorFilter<T> |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GATKSV_CONTIG_ALIGNMENTS_READ_GROUP_ID |
Constructor and Description |
---|
SVUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.stream.Collector<T,?,java.util.ArrayList<T>> |
arrayListCollector(int size)
Provides a stream collector that will collect items into an array list with a given initial capacity.
|
static <T> java.util.List<T> |
concatenateLists(java.util.List<T> list1,
java.util.List<T> list2)
Concatenate two lists.
|
static long |
fnvByteArray64(byte[] toHash)
64-bit FNV-1a hash for byte arrays
|
static long |
fnvByteArray64(long start,
byte[] toHash) |
static long |
fnvLong64(long toHash)
64-bit FNV-1a hash for long's
|
static long |
fnvLong64(long start,
long toHash) |
static java.util.List<java.lang.String> |
getAttributeAsStringList(htsjdk.variant.variantcontext.VariantContext vc,
java.lang.String attributeKey)
todo: this should be fixed in a new major version of htsjdk
this exist because for whatever reason,
VC.getAttributeAsStringList() sometimes returns a giant single string, while using
VC.getAttributeAsString() gives back an array.....
|
static java.util.stream.Stream<java.lang.String> |
getAttributeAsStringStream(htsjdk.variant.variantcontext.VariantContext vc,
java.lang.String attributeKey) |
static java.util.Set<java.lang.String> |
getCanonicalChromosomes(java.lang.String nonCanonicalContigNamesFile,
htsjdk.samtools.SAMSequenceDictionary dictionary)
Canonical chromosomes are defined, for homo sapiens, as chromosomes 1-22, chromosome X and Y.
|
static java.lang.String |
getSampleId(htsjdk.samtools.SAMFileHeader header) |
static htsjdk.samtools.SAMRecordComparator |
getSamRecordComparator(htsjdk.samtools.SAMFileHeader.SortOrder sortOrder)
Given
sortOrder , provide appropriate comparator. |
static <T extends java.lang.Enum<T>> |
getZeroInitializedEnumMap(java.lang.Class<T> clazz) |
static int |
hashMapCapacity(int nElements)
return a good initialCapacity for a HashMap that will hold a given number of elements
|
static <T> int |
iteratorSize(java.util.Iterator<T> itr)
count the number of items available from an iterator
|
static int |
iteratorSize(LongIterator itr) |
static SimpleInterval |
makeOneBpInterval(java.lang.String chr,
int pos)
Given chromosome name and requested position (1-based coordinate system),
return a 1 bp long interval that spans only the requested base.
|
static <T> java.util.Iterator<T> |
singletonIterator(T t) |
static java.util.Collection<SVKmer> |
uniquify(java.util.Collection<SVKmer> coll1,
java.util.Collection<SVKmer> coll2) |
public static final java.lang.String GATKSV_CONTIG_ALIGNMENTS_READ_GROUP_ID
public static java.lang.String getSampleId(htsjdk.samtools.SAMFileHeader header)
public static htsjdk.samtools.SAMRecordComparator getSamRecordComparator(htsjdk.samtools.SAMFileHeader.SortOrder sortOrder)
sortOrder
, provide appropriate comparator.
Currently only support coordinate or query-name order,
and throws UserException if other values are specified.public static java.util.List<java.lang.String> getAttributeAsStringList(htsjdk.variant.variantcontext.VariantContext vc, java.lang.String attributeKey)
public static java.util.stream.Stream<java.lang.String> getAttributeAsStringStream(htsjdk.variant.variantcontext.VariantContext vc, java.lang.String attributeKey)
public static SimpleInterval makeOneBpInterval(java.lang.String chr, int pos)
public static java.util.Set<java.lang.String> getCanonicalChromosomes(java.lang.String nonCanonicalContigNamesFile, @Nonnull htsjdk.samtools.SAMSequenceDictionary dictionary)
public static int hashMapCapacity(int nElements)
public static <T> int iteratorSize(java.util.Iterator<T> itr)
public static int iteratorSize(LongIterator itr)
public static <T> java.util.Iterator<T> singletonIterator(T t)
public static java.util.Collection<SVKmer> uniquify(java.util.Collection<SVKmer> coll1, java.util.Collection<SVKmer> coll2)
public static <T> java.util.List<T> concatenateLists(java.util.List<T> list1, java.util.List<T> list2)
public static <T> java.util.stream.Collector<T,?,java.util.ArrayList<T>> arrayListCollector(int size)
public static <T extends java.lang.Enum<T>> java.util.EnumMap<T,java.lang.Long> getZeroInitializedEnumMap(java.lang.Class<T> clazz)
public static long fnvLong64(long toHash)
public static long fnvLong64(long start, long toHash)
public static long fnvByteArray64(byte[] toHash)
public static long fnvByteArray64(long start, byte[] toHash)