Search in sources :

Example 1 with MaximumCliqueIntervalGraph

use of au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph in project gridss by PapenfussLab.

the class Models method maximalInterval.

private static Node maximalInterval(LinearGenomicCoordinate lgc, BreakendDirection dir, List<BreakendSummary> breaks, List<Long> weights) {
    MaximumCliqueIntervalGraph calc = new MaximumCliqueIntervalGraph();
    List<Node> nodes = new ArrayList<Node>(breaks.size());
    for (int i = 0; i < breaks.size(); i++) {
        BreakendSummary bs = breaks.get(i);
        long weight = weights.get(i);
        if (bs == null)
            continue;
        if (bs.direction != dir)
            continue;
        if (weight > 0) {
            nodes.add(new Node(lgc.getLinearCoordinate(bs.referenceIndex, bs.start), lgc.getLinearCoordinate(bs.referenceIndex, bs.end), weight));
        }
    }
    if (nodes.size() == 0)
        return null;
    return calc.calculateMaximumClique(nodes);
}
Also used : MaximumCliqueIntervalGraph(au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph) Node(au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph.Node) ArrayList(java.util.ArrayList) BreakendSummary(au.edu.wehi.idsv.BreakendSummary)

Aggregations

BreakendSummary (au.edu.wehi.idsv.BreakendSummary)1 MaximumCliqueIntervalGraph (au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph)1 Node (au.edu.wehi.idsv.graph.MaximumCliqueIntervalGraph.Node)1 ArrayList (java.util.ArrayList)1