Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'latest'
Browse files Browse the repository at this point in the history
  • Loading branch information
bqminh committed Aug 14, 2019
2 parents b7b4338 + a0fba8b commit 8ec5613
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,11 @@ if (NOT IQTREE_FLAGS MATCHES "single")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread")
elseif (CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
if (APPLE)
if (APPLE OR WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xpreprocessor -fopenmp -pthread")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xpreprocessor -fopenmp -lomp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lomp")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
endif()
endif()
else()
Expand Down
15 changes: 11 additions & 4 deletions main/phyloanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4165,10 +4165,14 @@ void assignBootstrapSupport(const char *input_trees, int burnin, int max_count,
const char *target_tree, bool rooted, const char *output_tree,
const char *out_prefix, MExtTree &mytree, const char* tree_weight_file,
Params *params) {
//bool rooted = false;
bool myrooted = rooted;
// read the tree file
cout << "Reading tree " << target_tree << " ..." << endl;
mytree.init(target_tree, rooted);
mytree.init(target_tree, myrooted);
if (mytree.rooted)
cout << "rooted tree detected" << endl;
else
cout << "unrooted tree detected" << endl;
// reindex the taxa in the tree to aphabetical names
NodeVector taxa;
mytree.getTaxa(taxa);
Expand Down Expand Up @@ -4213,8 +4217,11 @@ void assignBootstrapSupport(const char *input_trees, int burnin, int max_count,
}
scale /= sg.maxWeight();
} else {
boot_trees.init(input_trees, rooted, burnin, max_count,
tree_weight_file);
myrooted = rooted;
boot_trees.init(input_trees, myrooted, burnin, max_count,
tree_weight_file);
if (mytree.rooted != boot_trees.isRooted())
outError("Target tree and tree set have different rooting");
if (boot_trees.equal_taxon_set) {
boot_trees.convertSplits(taxname, sg, hash_ss, SW_COUNT, -1, params->support_tag);
scale /= boot_trees.sumTreeWeights();
Expand Down
2 changes: 1 addition & 1 deletion tree/iqtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3733,7 +3733,7 @@ void IQTree::writeUFBootTrees(Params &params) {
NodeVector taxa;
// change the taxa name from ID to real name
trees[i]->getOrderedTaxa(taxa);
for (j = 0; j < taxa.size(); j++)
for (j = 0; j < taxa.size() - (int)rooted; j++)
taxa[j]->name = aln->getSeqName(taxa[j]->id);
if (removed_seqs.size() > 0) {
// reinsert removed seqs into each tree
Expand Down
2 changes: 1 addition & 1 deletion tree/mtree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void MTree::readTree(istream &in, bool &is_rooted)
if (branch_len[0] == -1.0) branch_len[0] = 0.0;
if (branch_len[0] < 0.0)
throw ERR_NEG_BRANCH;
is_rooted = true;
rooted = is_rooted = true;
root = newNode(leafNum, ROOT_NAME);
root->addNeighbor(node, branch_len);
node->addNeighbor(root, branch_len);
Expand Down

0 comments on commit 8ec5613

Please sign in to comment.