public class CreateGraphUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
INNER_ANCHOR_METHOD |
static String |
NO_CONSENSUS_METHOD |
| Modifier and Type | Method and Description |
|---|---|
static int |
addInnerAnchorNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> result,
Connection database,
Map<Integer,ReferenceRange> referenceRangeMap,
Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap,
boolean includeVariantContext,
int hapMethodId) |
static HaplotypeGraph |
addMissingSequenceNodes(HaplotypeGraph graph) |
static int |
addMissingSequenceNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> result) |
static void |
addUnconsolidatedNodes(Connection database,
Map<ReferenceRange,List<HaplotypeNode>> consensusNodes,
Map<Integer,ReferenceRange> referenceRangeMap,
Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap,
boolean onlyAnchors)
Adds HaplotypeNodes to the given map for sequences that wasn't consolidated into a consensus sequence.
|
static Connection |
connection(String propertiesFile)
Creates a database connection given a properties file
|
static Connection |
connection(String host,
String user,
String password,
String dbName)
Creates a Postgres database connection.
|
static List<HaplotypeEdge> |
createEdges(Collection<HaplotypeNode> haplotypeNodes)
Generates Edges based on HaplotypeNodes.
|
static List<HaplotypeEdge> |
createEdges(TreeMap<ReferenceRange,List<HaplotypeNode>> rangeToNode)
Generates Edges based on HaplotypeNodes.
|
static TreeMap<ReferenceRange,List<HaplotypeNode>> |
createHaplotypeNodes(Connection database,
Map<Integer,ReferenceRange> referenceRangeMap,
Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap,
String method,
boolean onlyAnchors,
boolean includeVariantContext,
SortedSet<Integer> includeHapids)
Creates lists of HaplotypeNodes organized by reference Range
based on the given method.
|
static TreeMap<ReferenceRange,List<HaplotypeNode>> |
createHaplotypeNodes(Connection database,
String method,
boolean onlyAnchors,
boolean includeVariantContext,
SortedSet<Integer> includeHapids)
Creates HaplotypeNode Lists with keys as ReferenceRanges.
|
static HaplotypeGraph |
createHaplotypeNodesWithVariants(Connection database,
HaplotypeGraph graph)
Creates HaplotypeGraph with variant contexts corresponding to the given HaplotypeGraph.
|
static TreeMap<ReferenceRange,List<HaplotypeNode>> |
createHaplotypeNodesWithVariants(Connection database,
Set<HaplotypeNode> includeHapNodes)
Creates lists of HaplotypeNodes with variant contexts corresponding to the specified nodes
organized by reference Range.
|
static String |
getRefLineName(Connection database)
Returns the line name of the reference genotype
|
static HaplotypeGraph |
keepRefRanges(HaplotypeGraph graph,
List<ReferenceRange> ranges)
Creates graph that includes specified reference ranges.
|
static int |
methodId(Connection database,
String method_name)
Returns method id (methods.method_id) for given method name.
|
static HaplotypeGraph |
nodesSplitByIndividualTaxa(HaplotypeGraph graph,
double sameTaxonPercent) |
static Map<Integer,ReferenceRange> |
referenceRangeMap(Connection database)
Retrieves all ReferenceRange instances
|
static SortedSet<ReferenceRange> |
referenceRanges(Connection database)
Retrieves all ReferenceRange instances with specified genome interval version name.
|
static HaplotypeGraph |
removeRefRanges(HaplotypeGraph graph,
double minPercentTaxa)
Removes reference ranges from given graph that represent less than given minimum percent of total taxa.
|
static HaplotypeGraph |
removeRefRanges(HaplotypeGraph graph,
int minCountTaxa)
Removes reference ranges from given graph that represent less than given minimum number of taxa.
|
static HaplotypeGraph |
removeRefRanges(HaplotypeGraph graph,
List<ReferenceRange> ranges)
Removes specified reference ranges from graph.
|
static HaplotypeGraph |
subsetGraph(HaplotypeGraph graph,
net.maizegenetics.taxa.TaxaList taxa)
Create graph that's a subset of the given graph which contains only nodes from the taxa list.
|
static net.maizegenetics.taxa.TaxaList |
taxaInNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> nodes) |
static Map<Integer,net.maizegenetics.taxa.TaxaList> |
taxaListMap(Connection database)
Retrieves all groups of taxa.
|
static TreeMap<ReferenceRange,List<HaplotypeNode>> |
tree(HaplotypeGraph graph) |
public static final String NO_CONSENSUS_METHOD
public static final String INNER_ANCHOR_METHOD
public static Connection connection(String propertiesFile)
propertiesFile - properties filepublic static Connection connection(String host, String user, String password, String dbName)
host - hostnameuser - user idpassword - passworddbName - database namepublic static Map<Integer,ReferenceRange> referenceRangeMap(Connection database)
database - database connectionpublic static SortedSet<ReferenceRange> referenceRanges(Connection database)
database - database connectionpublic static Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap(Connection database)
database - database connectionpublic static TreeMap<ReferenceRange,List<HaplotypeNode>> createHaplotypeNodes(Connection database, Map<Integer,ReferenceRange> referenceRangeMap, Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap, String method, boolean onlyAnchors, boolean includeVariantContext, SortedSet<Integer> includeHapids)
#createHaplotypeNodes(Connection, String, boolean, boolean, SortedSet) .database - database connectionreferenceRangeMap - ReferenceRange map (referenceRangeMap(Connection)taxaListMap - TaxaList map taxaListMap(Connection)method - method nameonlyAnchors - whether to include only anchors (i.e. no regions between anchors)includeVariantContext - whether to include variant contexts in haplotype nodesincludeHapids - includes specified hapids. include everything if nullpublic static TreeMap<ReferenceRange,List<HaplotypeNode>> createHaplotypeNodesWithVariants(Connection database, Set<HaplotypeNode> includeHapNodes)
database - database connectionincludeHapNodes - includes specified hapidspublic static HaplotypeGraph createHaplotypeNodesWithVariants(Connection database, HaplotypeGraph graph)
database - database connectiongraph - graph without variant contextspublic static int addInnerAnchorNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> result, Connection database, Map<Integer,ReferenceRange> referenceRangeMap, Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap, boolean includeVariantContext, int hapMethodId)
public static void addUnconsolidatedNodes(Connection database, Map<ReferenceRange,List<HaplotypeNode>> consensusNodes, Map<Integer,ReferenceRange> referenceRangeMap, Map<Integer,net.maizegenetics.taxa.TaxaList> taxaListMap, boolean onlyAnchors)
database - database connectionconsensusNodes - nodes created from consensus sequences #createHaplotypeNodes(Connection, Map, Map,
String, boolean, boolean, SortedSet) referenceRangeMap - ReferenceRange map (referenceRangeMap(Connection)taxaListMap - TaxaList map taxaListMap(Connection)onlyAnchors - whether to include only anchors (i.e. no regions between anchors)public static HaplotypeGraph addMissingSequenceNodes(HaplotypeGraph graph)
public static int addMissingSequenceNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> result)
public static net.maizegenetics.taxa.TaxaList taxaInNodes(TreeMap<ReferenceRange,List<HaplotypeNode>> nodes)
public static TreeMap<ReferenceRange,List<HaplotypeNode>> tree(HaplotypeGraph graph)
public static HaplotypeGraph nodesSplitByIndividualTaxa(HaplotypeGraph graph, double sameTaxonPercent)
public static TreeMap<ReferenceRange,List<HaplotypeNode>> createHaplotypeNodes(Connection database, String method, boolean onlyAnchors, boolean includeVariantContext, SortedSet<Integer> includeHapids)
database - database connectionmethod - method nameonlyAnchors - whether to include only anchors (i.e. no regions between anchors)includeVariantContext - whether to include variant contexts in haplotype nodesincludeHapids - includes specified hapids. include everything if nullpublic static List<HaplotypeEdge> createEdges(Collection<HaplotypeNode> haplotypeNodes)
haplotypeNodes - HaplotypeNodespublic static List<HaplotypeEdge> createEdges(TreeMap<ReferenceRange,List<HaplotypeNode>> rangeToNode)
rangeToNode - map of RefereneceRanges to List of HaplotypeNodespublic static String getRefLineName(Connection database)
database - public static int methodId(Connection database, String method_name)
database - database connectionmethod_name - method namepublic static HaplotypeGraph subsetGraph(HaplotypeGraph graph, net.maizegenetics.taxa.TaxaList taxa)
taxa - taxa listgraph - original graphpublic static HaplotypeGraph removeRefRanges(HaplotypeGraph graph, double minPercentTaxa)
graph - graphminPercentTaxa - minimum percent taxapublic static HaplotypeGraph removeRefRanges(HaplotypeGraph graph, int minCountTaxa)
graph - graphminCountTaxa - minimum number of taxapublic static HaplotypeGraph removeRefRanges(HaplotypeGraph graph, List<ReferenceRange> ranges)
graph - graphranges - reference ranges to removepublic static HaplotypeGraph keepRefRanges(HaplotypeGraph graph, List<ReferenceRange> ranges)
graph - graphranges - ranges to keepCopyright © 2018. All rights reserved.