private void ExecuteClusteringTest(List <VeadGroup> groups, List <List <VeadGroup> > expectedClusters, List <string> consensusSites, int?minNumAgreements = null, int?maxNumDisagreements = null, int ploidyConstraint = -1) { var options = new ClusteringParameters(); if (minNumAgreements != null) { options.MinNumberAgreements = (int)minNumAgreements; } if (maxNumDisagreements != null) { options.MaxNumberDisagreements = (int)maxNumDisagreements; } options.ClusterConstraint = ploidyConstraint; var clusterer = new NeighborhoodClusterer(options); var clusterSet = clusterer.ClusterVeadGroups(groups, "ndbdID"); Assert.Equal(expectedClusters.Count, clusterSet.NumClusters); foreach (var cluster in clusterSet.Clusters) { var clusterConsensus = string.Join(",", cluster.GetConsensusSites().ToList()); Assert.Equal(1, consensusSites.Count(c => c == clusterConsensus)); } }
public NeighborhoodClusterer CreateNeighborhoodClusterer() { var processor = new NeighborhoodClusterer(_options.ClusteringParams); return(processor); }