Skip to content

Commit db375b7

Browse files
Mai To UyenMai To Uyen
Mai To Uyen
authored and
Mai To Uyen
committed
remove redundant comments
1 parent 90789fc commit db375b7

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

Software/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
* Vertion 1.4.0:
2-
* Major release. Allow calibration for internal nodes. Requires unique labeling for all nodes and sampling times / calibration points are identified by node labels.
2+
* Major release. Allow calibrations for internal nodes and allow missing sampling times for leaves; hard constraints only. Requires unique labeling for all nodes and sampling times / calibration points are identified by node labels.
33
* Version 1.3.1:
44
* Added zero-length and verbose options. Remove options for LSD and LF. Remove options for scaling. Remove cvxpy requirement.
55
* Version 1.3.0:

Software/launch_LogDate.py

-52
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
parser.add_argument("-r","--rootAge",required=False,help="Root age. Can be used with either -f or -t, but not both. Default: None if -t is specified else 0")
2424
parser.add_argument("-f","--leafAge",required=False,help="Leaf age. To be used with root age to infer relative time. Will be overried by -t if -t is specified. Default: None if -t is specified else 1.")
2525
parser.add_argument("-o","--output",required=True,help="The output trees with branch lengths in time unit.")
26-
#parser.add_argument("-d","--tempdir",required=False,help="The output from lsd will be kept in the specified directory")
27-
#parser.add_argument("-e","--pseudo",action='store_true',help="Can only be used with wLogDate. Control pseudo-count branches. Default: NO")
2826
parser.add_argument("-v","--verbose",action='store_true',help="Show verbose message. Default: NO")
2927
parser.add_argument("-p","--rep",required=False,help="The number of random replicates for initialization. Default: use 1 initial point")
3028
parser.add_argument("-s","--rseed",required=False,help="Random seed to generate starting tree initial points")
3129
parser.add_argument("-l","--seqLen",required=False,help="The length of the sequences. Default: 1000")
3230
parser.add_argument("-m","--maxIter",required=False,help="The maximum number of iterations for optimization. Default: 50000")
33-
#parser.add_argument("-q","--scale",required=False,help="Scaling strategy. Either None, sqrt, or linear. Default: None")
3431
parser.add_argument("-u","--addpseudo",required=False,help="Add pseudo counting for per-branch weighting.Default: 0.01")
3532
parser.add_argument("-z","--zero",required=False,help="Set zero-length branches (if any) to this number. LogDate cannot process zero-length branches. Default: 1e-10")
3633

@@ -50,7 +47,6 @@
5047
pseudo = 0.01 if args["addpseudo"] is None else float(args["addpseudo"])
5148
maxIter = int(args["maxIter"]) if args["maxIter"] else 50000
5249
randseed = int(args["rseed"]) if args["rseed"] else None
53-
#scale = args["scale"] if args["scale"] else None
5450
zero_len = float(args["zero"]) if args["zero"] else 1e-10
5551

5652
brScale = None
@@ -62,56 +58,8 @@
6258
if node is not tree.seed_node and node.edge_length == 0:
6359
node.edge_length = zero_len
6460

65-
'''
66-
if objective == "LF":
67-
f_obj = f_LF
68-
elif objective == "LSD":
69-
f_obj = f_lsd
70-
elif objective == "PL":
71-
f_obj = f_PL
72-
elif objective == "LogDate":
73-
if scale == 'sqrt':
74-
f_obj = f_logDate_sqrt_scale
75-
elif scale == 'linear':
76-
f_obj = f_logDate_linear_scale
77-
else:
78-
f_obj = f_logDate
79-
elif objective == "wLogDate":
80-
if scale == 'sqrt':
81-
f_obj = f_wlogDate_sqrt_scale
82-
elif scale=='linear':
83-
f_obj = f_wlogDate_linear_scale
84-
else:
85-
f_obj = f_logDate_sqrt_b
86-
87-
#brScale = "sqrt"
88-
89-
90-
if args["pseudo"]:
91-
smpl_time = {}
92-
with open(sampling_time,'r') as fin:
93-
fin.readline()
94-
for line in fin:
95-
taxon,time = line.split()
96-
smpl_time[taxon] = float(time)
97-
x,f = log_from_random_init(tree,smpl_time,root_age=rootAge,leaf_age=leafAge,brScale=brScale,nrep=nrep,min_nleaf=3,maxIter=maxIter,seed=randseed)
98-
write_time_tree(tree,outfile=args["output"])
99-
print("Best log-scored solution: ")
100-
print("Log score: " + str(f))
101-
print("Clock rate: " + str(x[1]))
102-
print("Root age: " + str(x[0]/x[1]))
103-
else:
104-
if objective == "LF":
105-
mu,f,x,s_tree,t_tree = run_LF_cvxpy(tree,sampling_time=sampling_time,root_age=rootAge,leaf_age=leafAge)
106-
elif objective == "PL":
107-
mu,f,x,s_tree,t_tree = logDate_with_penalize_llh(tree,sampling_time=sampling_time,root_age=rootAge,leaf_age=leafAge,maxIter=maxIter)
108-
else:
109-
mu,f,x,s_tree,t_tree = logDate_with_random_init(tree,f_obj,sampling_time=sampling_time,root_age=rootAge,leaf_age=leafAge,nrep=nrep,min_nleaf=10,maxIter=maxIter,seed=randseed,scale=scale,pseudo=pseudo,seqLen=seqLen)'''
110-
11161
mu,f,x,s_tree,t_tree = logDate_with_random_init(tree,f_obj,sampling_time=sampling_time,root_age=rootAge,leaf_age=leafAge,nrep=nrep,min_nleaf=10,maxIter=maxIter,seed=randseed,pseudo=pseudo,seqLen=seqLen,verbose=verbose)
11262
tree_as_newick(t_tree,outfile=args["output"],append=False)
11363

114-
#t_tree_swift = treeswift.read_tree_dendropy(t_tree)
115-
#t_tree_swift.write_tree_newick(args["output"])
11664
print("Clock rate: " + str(mu))
11765
print("Log score: " + str(f))

0 commit comments

Comments
 (0)