if species in adjacencyProbs: adjacencyProbs[species][adj] = weight else: adjacencyProbs[species]={adj:weight} line=f.readline() f.close() #dictionary for all scj distances dict_SCJ={} #compute CCs in global adjacency graph ccs = globalAdjacencyGraph.createGraph(extantAdjacencies,nodesPerAdjacency) if (not args.skip_first): conflicts = globalAdjacencyGraph.analyseConnectedComponents(ccs) globalAdjacencyGraph.outputConflicts(conflicts,args.output+"/conflicts") jointLabels, first = SR.enumJointLabelings(ccs) validLabels, validAtNode = SR.validLabels(jointLabels,first) topDown = SR.computeLabelings(tree, ccs, validAtNode, extantAdjacencies, adjacencyProbs, args.alpha) reconstructedAdj = SR.reconstructedAdjacencies(topDown) SR.outputReconstructedAdjacencies(reconstructedAdj,args.output+"/reconstructed_adjacencies") for node in reconstructedAdj: print node print "Number of reconstructed adjacencies: "+str(len(reconstructedAdj[node])) scaffolds = scaffolding.scaffoldAdjacencies(reconstructedAdj) undoubled = scaffolding.undoubleScaffolds(scaffolds)
def test_analyseConnectedComponents(self): globalAdjacencyGraph.analyseConnectedComponents(self.graphs)