Skip to content

Commit f141589

Browse files
committed
variance_min > 0 => indiscernibles are used, otherwise max_degree is very large
1 parent 6dcb463 commit f141589

File tree

8 files changed

+71
-46
lines changed

8 files changed

+71
-46
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
SAMN02844477
2+
SAMN03475395
3+
SAMN05605405
4+
SAMN02844313
5+
SAMN03002022
6+
SAMN03478846
7+
SAMN04485948
8+
SAMN04535377
9+
SAMN02368790
10+
SAMN04308849
11+
SAMN03474009
12+
SAMN02699690
13+
SAMN05201703
14+
SAMN02640780
15+
SAMN02843948
16+
SAMN03838256.r2
17+
SAMN04102293.r2
18+
SAMN04363882
19+
SAMN03892264
20+
SAMN03154403
21+
SAMN02645767
22+
SAMN04507552

phylogeny/data/Salmonella-var_min.distTree

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,66 @@ Neighbor joining ...
1010

1111
INPUT:
1212
# Leaves: 291
13-
# Discernible leaves: 291
13+
# Discernible leaves: 285
1414
# Nodes: 580
1515
# Dissimilarities: 42195 (100.00 %)
16-
Dissimilarities factor: 25.56
17-
Ave. dissimilarity = 0.191845
18-
Abs. criterion = 1.8111e+01 Rel. criterion = 2.951 %
16+
Dissimilarities factor: 26.19
17+
Ave. dissimilarity = 0.197058
18+
Abs. criterion = 1.8217e+01 Rel. criterion = 2.959 %
1919

2020
Optimizing arc lengths for the whole tree ...
2121
Optimizing arc lengths at each arc ...
2222
# Nodes deleted = 17
2323
Optimizing arc lengths at each node ...
24-
# Nodes deleted = 4
25-
Abs. criterion = 7.2358e+00 Rel. criterion = 1.865 %
24+
# Nodes deleted = 2
25+
Abs. criterion = 7.2835e+00 Rel. criterion = 1.871 %
2626

2727
Optimizing topology: subgraphs ...
2828
# Hybrids: 0
29-
Abs. criterion = 6.5163e+00 Rel. criterion = 1.763 %
29+
Abs. criterion = 6.5364e+00 Rel. criterion = 1.766 %
3030

3131
# Hybrids: 0
32-
Abs. criterion = 6.3905e+00 Rel. criterion = 1.746 %
32+
Abs. criterion = 6.5128e+00 Rel. criterion = 1.763 %
3333

3434
# Hybrids: 0
35-
Abs. criterion = 6.2287e+00 Rel. criterion = 1.724 %
35+
Abs. criterion = 6.5049e+00 Rel. criterion = 1.762 %
3636

3737
# Hybrids: 0
38-
Abs. criterion = 6.2112e+00 Rel. criterion = 1.722 %
38+
Abs. criterion = 6.5035e+00 Rel. criterion = 1.761 %
3939

4040
# Hybrids: 0
41-
Abs. criterion = 6.2088e+00 Rel. criterion = 1.721 %
41+
Abs. criterion = 6.5029e+00 Rel. criterion = 1.761 %
4242

4343
# Hybrids: 0
44-
Abs. criterion = 6.2084e+00 Rel. criterion = 1.721 %
44+
Abs. criterion = 6.5025e+00 Rel. criterion = 1.761 %
4545

4646
# Hybrids: 0
47-
Abs. criterion = 6.2082e+00 Rel. criterion = 1.721 %
47+
Abs. criterion = 6.5023e+00 Rel. criterion = 1.761 %
4848

4949
# Hybrids: 0
50-
Abs. criterion = 6.2081e+00 Rel. criterion = 1.721 %
50+
Abs. criterion = 6.5021e+00 Rel. criterion = 1.761 %
5151

5252
# Hybrids: 0
53-
Abs. criterion = 6.2081e+00 Rel. criterion = 1.721 %
53+
Abs. criterion = 6.5020e+00 Rel. criterion = 1.761 %
5454

55-
# Iterations of subgraph optimization: 9
56-
Abs. criterion = 6.2081e+00 Rel. criterion = 1.721 %
55+
# Hybrids: 0
56+
Abs. criterion = 6.5020e+00 Rel. criterion = 1.761 %
57+
58+
# Iterations of subgraph optimization: 10
59+
Abs. criterion = 6.5019e+00 Rel. criterion = 1.761 %
5760

5861
Ave. radius: 0.456
5962

6063
# Criterion outliers: 4
61-
Abs. criterion = 4.8597e+00 Rel. criterion = 1.542 %
64+
Abs. criterion = 4.8721e+00 Rel. criterion = 1.543 %
6265

63-
# Deformation outliers: 0
66+
# Deformation outliers: 22
67+
Abs. criterion = 3.6261e+00 Rel. criterion = 1.447 %
6468

6569
OUTPUT:
66-
Abs. criterion = 4.8597e+00 Rel. criterion = 1.542 %
70+
Abs. criterion = 3.6261e+00 Rel. criterion = 1.447 %
6771

6872
Relative epsilon2_0 = 0.00 %
6973
Mean residual = 0.00
70-
Correlation between residual^2 and dissimilarity = 0.09
74+
Correlation between residual^2 and dissimilarity = 0.12
7175

phylogeny/data/tree4.stat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Tree length = 15.000
66
Min. discernible leaf length = 1.000000e+00
77
Ave. arc length = 2.500
8-
Interior height = 1
8+
Height ignoring indiscernibles = 1
99
Bifurcating interior branching = 2.000
1010
Max. degree = 3
1111
# Frequent children interior nodes = 3

phylogeny/distTree.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ void DTNode::qc () const
610610
QC_ASSERT ((bool) getParent () == ! isNan (len));
611611
if (! childrenDiscernible ())
612612
{
613-
QC_ASSERT (! DistTree_sp::variance_min);
613+
//QC_ASSERT (! DistTree_sp::variance_min);
614614
QC_ASSERT (! inDiscernible ());
615615
for (const DiGraph::Arc* arc : arcs [false])
616616
QC_ASSERT (static_cast <const DTNode*> (arc->node [false]) -> inDiscernible ());
@@ -665,7 +665,7 @@ const Leaf* DTNode::inDiscernible () const
665665
return nullptr;
666666
else
667667
{
668-
ASSERT (! DistTree_sp::variance_min);
668+
//ASSERT (! DistTree_sp::variance_min);
669669
return g;
670670
}
671671
else
@@ -1313,7 +1313,7 @@ void Leaf::qc () const
13131313

13141314
QC_ASSERT (! name. empty());
13151315
QC_ASSERT (! isLeft (name, "0x"));
1316-
QC_IMPLY (DistTree_sp::variance_min, discernible);
1316+
//QC_IMPLY (DistTree_sp::variance_min, discernible);
13171317
if (! isNan (len) && ! discernible && len)
13181318
{
13191319
cout << getName () << " " << len << endl;
@@ -1375,7 +1375,7 @@ void Leaf::collapse (Leaf* other)
13751375
{
13761376
ASSERT (! getDistTree (). subDepth);
13771377
ASSERT (this != other);
1378-
ASSERT (! DistTree_sp::variance_min);
1378+
//ASSERT (! DistTree_sp::variance_min);
13791379
//ASSERT (len == 0.0);
13801380
//ASSERT (discernible);
13811381

@@ -1608,8 +1608,8 @@ void Subgraph::removeIndiscernibles ()
16081608
{
16091609
ASSERT (! area. empty ());
16101610

1611-
if (DistTree_sp::variance_min)
1612-
return;
1611+
//if (DistTree_sp::variance_min)
1612+
//return;
16131613

16141614
for (Iter<VectorPtr<Tree::TreeNode>> iter (area); iter. next (); )
16151615
if (static_cast <const DTNode*> (*iter) -> inDiscernible ())
@@ -2888,8 +2888,8 @@ struct DissimLine
28882888
return;
28892889
if (! leaf2)
28902890
return;
2891-
if ( ! DistTree_sp::variance_min
2892-
&& ! dissim
2891+
if ( /*! DistTree_sp::variance_min
2892+
&&*/ ! dissim
28932893
&& ! leaf1->getCollapsed (leaf2) // Only for new Leaf's
28942894
)
28952895
leaf1->collapse (leaf2);
@@ -3882,7 +3882,7 @@ bool DistTree::loadLines (const StringVector &lines,
38823882
{
38833883
ASSERT (parent);
38843884
auto leaf = new Leaf (*this, parent, len, idS);
3885-
leaf->discernible = DistTree_sp::variance_min || ! indiscernible;
3885+
leaf->discernible = /*DistTree_sp::variance_min ||*/ ! indiscernible;
38863886
leaf->normCriterion = normCriterion;
38873887
dtNode = leaf;
38883888
}
@@ -4191,8 +4191,8 @@ LeafCluster DistTree::getIndiscernibles ()
41914191
ASSERT (! subDepth);
41924192
ASSERT (optimizable ());
41934193

4194-
if (DistTree_sp::variance_min)
4195-
return LeafCluster ();
4194+
//if (DistTree_sp::variance_min)
4195+
//return LeafCluster ();
41964196

41974197
// Leaf::DisjointCluster
41984198
for (DiGraph::Node* node : nodes)
@@ -4245,7 +4245,7 @@ size_t DistTree::leafCluster2discernibles (const LeafCluster &leafCluster)
42454245
if (clusterNodes. size () == 1)
42464246
continue;
42474247

4248-
ASSERT (! DistTree_sp::variance_min);
4248+
//ASSERT (! DistTree_sp::variance_min);
42494249
const Leaf* first = clusterNodes [0];
42504250
ASSERT (first);
42514251
Steiner* parent = var_cast (static_cast <const DTNode*> (first->getParent ()) -> asSteiner ());
@@ -4321,8 +4321,8 @@ size_t DistTree::setDiscernibles_ds ()
43214321
}
43224322
}
43234323

4324-
if (DistTree_sp::variance_min)
4325-
return 0;
4324+
//if (DistTree_sp::variance_min)
4325+
//return 0;
43264326

43274327
FFOR (size_t, row, dissimDs->objs. size ())
43284328
if (const Leaf* leaf1 = findPtr (name2leaf, dissimDs->objs [row] -> name))
@@ -4359,8 +4359,8 @@ size_t DistTree::setDiscernibles ()
43594359
leaf->discernible = true;
43604360
}
43614361

4362-
if (DistTree_sp::variance_min)
4363-
return 0;
4362+
//if (DistTree_sp::variance_min)
4363+
//return 0;
43644364

43654365
const LeafCluster leafCluster (getIndiscernibles ());
43664366
const size_t n = leafCluster2discernibles (leafCluster);
@@ -4873,7 +4873,7 @@ bool DistTree::addDissim (Leaf* leaf1,
48734873
ASSERT (leaf1);
48744874
ASSERT (leaf2);
48754875
IMPLY (! multFixed, mult == 1.0); // mult will be set later
4876-
IMPLY (! DistTree_sp::variance_min && ! target && dissimTypes. empty (), leaf1->getCollapsed (leaf2));
4876+
IMPLY (/*! DistTree_sp::variance_min &&*/ ! target && dissimTypes. empty (), leaf1->getCollapsed (leaf2));
48774877

48784878

48794879
if ( isNan (target) // prediction must be large ??
@@ -5158,7 +5158,7 @@ void DistTree::qc () const
51585158
{
51595159
dissim. qc ();
51605160
QC_IMPLY (! subDepth, dissim. target >= 0.0);
5161-
QC_IMPLY (! DistTree_sp::variance_min && ! subDepth && ! dissim. target, dissim. indiscernible ());
5161+
QC_IMPLY (/*! DistTree_sp::variance_min &&*/ ! subDepth && ! dissim. target, dissim. indiscernible ());
51625162
leafSet. addUnique (Pair<const Leaf*> (dissim. leaf1, dissim. leaf2));
51635163
if (subDepth)
51645164
{ QC_ASSERT (dissim. mult < INF); }
@@ -5220,7 +5220,7 @@ void DistTree::qc () const
52205220
{
52215221
const VectorPtr<Leaf>& leaves = it. second;
52225222
QC_ASSERT (leaves. size () >= 2);
5223-
QC_ASSERT (! DistTree_sp::variance_min);
5223+
//QC_ASSERT (! DistTree_sp::variance_min);
52245224
for (const Leaf* leaf : leaves)
52255225
{
52265226
QC_ASSERT (leaf->graph == this);
@@ -5560,7 +5560,7 @@ void DistTree::setDissimMult (bool usePrediction)
55605560

55615561

55625562
// To keep absCriterion < INF
5563-
if (! multFixed && ! variance_min && usePrediction)
5563+
if (! multFixed /*&& ! variance_min*/ && usePrediction)
55645564
{
55655565
unordered_map<const Leaf*,Real/*dissim.target*/> leaf2target_min;
55665566
leaf2target_min. rehash (name2leaf. size () / 100 + 1); // PAR

phylogeny/distTree.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,6 @@ struct Leaf : DTNode
652652
friend DissimLine;
653653
void collapse (Leaf* other);
654654
// Output: discernible = false
655-
// Requires: !DistTree_sp::variance_min
656655
// Invokes: setParent()
657656
// To be followed by: DistTree::cleanTopology()
658657
public:

phylogeny/distTree_new.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct ThisApplication : Application
6363
addKey ("variance", "Dissimilarity variance function: " + varianceTypeNames. toString (" | "), varianceTypeNames [varianceType]);
6464
addKey ("variance_power", "Power for -variance pow; >= 0", "NaN");
6565
addFlag ("variance_dissim", "Variance is computed off dissimilarities");
66-
addKey ("variance_min", "Min. dissimilarity variance; to be added to the computed variance. If > 0 then all objects are discernible", "0");
66+
addKey ("variance_min", "Min. dissimilarity variance; to be added to the computed variance", "0");
6767

6868
addKey ("name", "Name of the object");
6969
addKey ("dissim", "File of the format: <obj1> <obj2> <dissimilarity>");

phylogeny/makeDistTree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct ThisApplication : Application
7676
addKey ("variance_power", "Power for -variance pow; >= 0", "NaN");
7777
addFlag ("variance_dissim", "Variance is computed off dissimilarities");
7878
addFlag ("reinsert_variance_dist", "Variance is computed off tree distances for the reinsert optimization");
79-
addKey ("variance_min", "Min. dissimilarity variance. If > 0 then all objects are discernible", "0"); // ; to be added to the computed variance
79+
addKey ("variance_min", "Min. dissimilarity variance", "0"); // ; to be added to the computed variance
8080

8181
// Processing
8282
addKey ("delete", "Delete leaves whose names are in the indicated file");

version.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define VERSION "1.1.7"
1+
#define VERSION "1.1.8"

0 commit comments

Comments
 (0)