Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Licence: GPL3
Author: Richard Neher, Fabio Zanini
Date: 2012/09/12

Description:
------------
The sources for FFPopSim are online at:

http://code.google.com/p/ffpopsim/

Documentation and examples are online at:

http://webdav.tuebingen.mpg.de/ffpopsim/

To install the library, read the INSTALL file.
The two configuration files are:

- Makefile
- setup.py (for the Python extension)

Enjoy.
27 changes: 24 additions & 3 deletions src/rootedTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@
*/

#include "ffpopsim_highd.h"


namespace{
/*
* Function to name the tree node as well as the alignment entry
*/
ostream& operator<< (ostream& out, map <tree_key_t,node_t>::iterator &c){

//std::ostream &clone_name(std::ostream &out, const Clone &c){
out << c->first.index << "_"
<< c->first.age << "_"
<< c->second.clone_size << "_"
<< c->second.fitness;

return out;
}

}


/*
* this overloads the ostream operator to output keys of nodes and edges
*/
Expand Down Expand Up @@ -460,9 +480,10 @@ string rooted_tree::print_sequences() {
for (vector<tree_key_t>::iterator sampled_leaf = sampled_leafs.begin();
sampled_leaf!=sampled_leafs.end(); sampled_leaf++){
node= nodes.find(*sampled_leaf);

for (size_t si=0; si<node->second.sampled; si++){
seq_str <<">"<<sampled_leaf->index<<"_"<<sampled_leaf->age<<"_"<<node->second.clone_size<<'-'<<si<<"_"<<node->second.fitness
<<"\n"<<node->second.genotype<<"\n";
seq_str << ">" << node << "\n"
<< node->second.genotype << "\n";
}
}
return seq_str.str();
Expand Down Expand Up @@ -498,7 +519,7 @@ string rooted_tree::subtree_newick(tree_key_t root){
}
tree_str<<")";
}
tree_str<<root.index<<'_'<<root.age<<'_'<<root_node->second.clone_size<<'_'<<root_node->second.sampled<<"_"<<root_node->second.fitness<< '_'<< root.location;
tree_str << root_node;
tree_str << ":" << edge->second.length;
//tree_str<<root.index<<'_'<<root.age<<":"<<edge->second.length;
return tree_str.str();
Expand Down