public class DBLoadingUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DBLoadingUtils.AnchorType |
static class |
DBLoadingUtils.MethodType |
| Constructor and Description |
|---|
DBLoadingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Connection |
connection(String propertiesFile,
boolean createNew)
Creates a database connection given a properties file
It is expected that only initial db loading methods will
call this with "createNew" = true.
|
static Connection |
connection(String host,
String user,
String password,
String dbName,
String type,
boolean createNew)
Creates a new database connection or returns connection to existing db
If createNew is FALSE then try to connect, and if db doesn't exist, return NULL
NOTE: from postgres, User should never create a db that matches
all lower case to an existing db.
|
static List<htsjdk.variant.variantcontext.VariantContext> |
decodeByteArrayToListOfVariantContext(byte[] encodedByteArray) |
static int[][] |
decodeHapCountsArray(byte[] dataAsByteArray) |
static int[] |
decodePathsArray(byte[] dataAsByteArray) |
static byte[] |
encodeHapCountsArrayFromFile(String fileName) |
static byte[] |
encodeHapCountsArrayFromMultiset(com.google.common.collect.Multiset<HaplotypeNode> perfectHitSet,
com.google.common.collect.Multiset<HaplotypeNode> exclusionHitSet)
THis method takes 2 multisets of HaplotypeNode objects: one indicating inclusion counts
for a haplotype, the other indicating exclusion counts.
|
static byte[] |
encodePathArrayFromSet(Set<HaplotypeNode> paths) |
static byte[] |
encodeSelectedVCFRegionsToByteArray(String fileName,
boolean onlyVariants,
boolean mergeRefRanges,
com.google.common.collect.Range<net.maizegenetics.dna.map.Position> interval) |
static byte[] |
encodeVariantContextListToByteArray(List<htsjdk.variant.variantcontext.VariantContext> listOfVariants,
boolean mergeRefRanges) |
static byte[] |
encodeVariantContextStreamToByteArray(Stream<htsjdk.variant.variantcontext.VariantContext> variantStream,
boolean onlyVariants,
boolean mergeRefRanges) |
static byte[] |
encodeVCFFileToByteArray(String fileName,
boolean onlyVariants,
boolean mergeRefRanges) |
static List<String> |
splitCigar(String cigarString) |
static Set<String> |
verifyIntervalRanges(String anchorFile) |
public static Connection connection(String propertiesFile, boolean createNew)
propertiesFile - properties filecreateNew - Indicates if the request is to connect to an existing db
or to create a new one with the specified name.public static Connection connection(String host, String user, String password, String dbName, String type, boolean createNew)
host - hostnameuser - user idpassword - passworddbName - database namedbType - database type (sqlite or postgres)createNew - if true, delete old db if it exists; create new db from PHG schemapublic static byte[] encodeSelectedVCFRegionsToByteArray(String fileName, boolean onlyVariants, boolean mergeRefRanges, com.google.common.collect.Range<net.maizegenetics.dna.map.Position> interval)
public static byte[] encodeVCFFileToByteArray(String fileName, boolean onlyVariants, boolean mergeRefRanges)
public static byte[] encodeVariantContextStreamToByteArray(Stream<htsjdk.variant.variantcontext.VariantContext> variantStream, boolean onlyVariants, boolean mergeRefRanges) throws IOException
IOExceptionpublic static byte[] encodeVariantContextListToByteArray(List<htsjdk.variant.variantcontext.VariantContext> listOfVariants, boolean mergeRefRanges) throws IOException
IOExceptionpublic static List<htsjdk.variant.variantcontext.VariantContext> decodeByteArrayToListOfVariantContext(byte[] encodedByteArray)
public static byte[] encodeHapCountsArrayFromMultiset(com.google.common.collect.Multiset<HaplotypeNode> perfectHitSet, com.google.common.collect.Multiset<HaplotypeNode> exclusionHitSet)
public static byte[] encodeHapCountsArrayFromFile(String fileName)
public static int[][] decodeHapCountsArray(byte[] dataAsByteArray)
public static byte[] encodePathArrayFromSet(Set<HaplotypeNode> paths)
public static int[] decodePathsArray(byte[] dataAsByteArray)
Copyright © 2018. All rights reserved.