Skip to content

Commit

Permalink
change version to v0.2-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Feb 23, 2016
1 parent 74d2f55 commit 1bef83b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ Development Version | dev | [![Build Status](https://api.travis-ci.org/hybri
##DOCUMENTATION
[Download](https://github.com/hybridLambda/hybrid-coal/raw/doc/doc/manual.pdf)

##INSTALLATION
##BEFORE INSTALLATION

### For developers
To install _hybrid-coal_, first install the following packages and libraries

on Debian/Ubuntu based systems:
Expand All @@ -33,6 +32,8 @@ on Mac OS:
port install git cppunit automake autoconf autoconf-archive graphviz
```

## DOWNLOAD AND COMPILE

then type the following commands:
```bash
./bootstrap
Expand Down Expand Up @@ -64,7 +65,6 @@ Options | Useage |
```bash
hybrid-coal -sp '((((B:1,C:1)s1:1)h1#.5:1,A:3)s2:1,(h1#.5:1,D:3)s3:1)r;'
hybrid-coal -sp trees/4_tax_sp_nt1_para -gt '(((A,D),C),B);'
hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre -latex
hybrid-coal -sp trees/4_tax_sp_nt1_para -plot
hybrid-coal -sp trees/4_tax_sp_nt1_para -plot -branch
hybrid-coal -sp trees/4_tax_sp_nt1_para -plot -label
Expand Down
69 changes: 35 additions & 34 deletions src/hybridcoal.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
/*
* hybrid-coal is used to compute gene tree probabilities given species network under coalescent process.
*
*
* Copyright (C) 2010 -- 2015 Sha (Joe) Zhu
*
*
* This file is part of hybrid-coal
*
*
* hybrid-coal is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
Expand All @@ -14,7 +14,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Expand All @@ -25,12 +25,12 @@
#include "tree_topo/all_gene_topo.hpp"

void HybridCoal::init(){
this->prefix = "OUT";
this->prefix = "OUT";
this->argc_i = 1;
this->helpBool = false;
//this->symb_bool = false;
this->print_tree_bool = false;
this->print_gene_topo_bool = false;
this->print_gene_topo_bool = false;
this->plot_bool = false;
//this->latex_bool = false;
//this->maple_bool = false;
Expand All @@ -50,7 +50,7 @@ void HybridCoal::read_input_lines(const char inchar[], vector <string> & out_vec
string out_str;
if ( in_file.good() ){
getline ( in_file, out_str );
while ( out_str.size() > 0 ){
while ( out_str.size() > 0 ){
out_vec.push_back( out_str );
getline ( in_file, out_str );
}
Expand All @@ -70,14 +70,14 @@ void HybridCoal::read_input_lines(const char inchar[], vector <string> & out_vec
void HybridCoal::check_gt_str_and_sign( string &gt_str ){
if ( gt_str.find('&') != string::npos ){
throw std::invalid_argument ( "Error: gene tree " + gt_str + " can not be a gene tree string" );
}
}
}


void HybridCoal::parse(){
if ( argc_ == 1 )
helpBool = true;
while (argc_i < argc_){
while (argc_i < argc_){
std::string argv_i(argv_[argc_i]);
if ( argv_i == "-h" || argv_i == "-help" ){ helpBool = true; }
else if ( argv_i == "-gt" ){ readNextStringto( this->gt_file_name , this->argc_i, this->argc_, this->argv_ ); this->enumerate_gt_bool = false; }
Expand All @@ -87,7 +87,7 @@ void HybridCoal::parse(){
//else if ( argv_i == "-maple" ){ this->maple_bool=true; }
//else if ( argv_i == "-symb" ){ this->symb_bool=true; }
else if ( argv_i == "-plot" || argv_i == "-dot" ){ this->plot_bool = true; }
else if ( argv_i == "-label" || argv_i == "-branch" ){ argc_i++; continue; }
else if ( argv_i == "-label" || argv_i == "-branch" ){ argc_i++; continue; }
else if ( argv_i == "-print" ){ this->print_tree_bool = true; }
else if ( argv_i == "-gtopo" ){ this->print_gene_topo_bool = true; }
//else if (argv_i=="-sub"){ list_sub_network_bool=true;}
Expand All @@ -102,7 +102,7 @@ void HybridCoal::parse(){
//maple_F_name=Fname_ext(argv[argc_i+1],".mw");
//}
//else { cout <<" need to change this !!!" << argv_i<<endl; argc_i++;continue; } // need to change this !!!
argc_i++;
argc_i++;
}
this->finalize();
}
Expand All @@ -111,13 +111,13 @@ void HybridCoal::parse(){
string HybridCoal::read_input_line(const char *inchar){
string out_str;
ifstream in_file( inchar );
if (in_file.good()) getline ( in_file, out_str);
if (in_file.good()) getline ( in_file, out_str);
else{
string dummy_str(inchar);
if (dummy_str.find('(')!=string::npos && dummy_str.find(')')!=string::npos) out_str=dummy_str;
else throw std::invalid_argument("Invalid input file. " + string (inchar) );
}
in_file.close();
in_file.close();
return out_str;
}

Expand All @@ -128,9 +128,9 @@ void HybridCoal::finalize(){
if ( this->gt_file_name.size() > 0 ) {
this->read_input_lines( this->gt_file_name.c_str(), this->gt_tree_str_s);
}

if ( this->print_tree_bool || this->plot_bool ) return;

if ( this->enumerate_gt_bool ){
Net net( this->sp_str );
GeneTopoList topologies( net.tip_name );
Expand All @@ -143,20 +143,20 @@ void HybridCoal::HybridCoal_core(){
this->print_help();
return;
}

if ( this->print_tree_bool ) {
this->print();
return;
}

if ( this->plot_bool ){
Figure figure_para ( this->argc_, this->argv_ );
figure_para.figure_file_prefix = this->prefix;
figure_para.finalize();
figure_para.plot( this->sp_str );
return;
}

if ( this->print_gene_topo_bool ){
string gt_out = this->prefix+".topo";

Expand Down Expand Up @@ -212,32 +212,33 @@ void HybridCoal::print(){


void HybridCoal::print_example(){
cout << "Examples:"
<< endl
cout << "Examples:"
<< endl
<< endl;
cout << "hybrid-coal -sp '((((B:1,C:1)s1:1)h1#.5:1,A:3)s2:1,(h1#.5:1,D:3)s3:1)r;'"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt '(((A,D),C),B);'"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre -maple"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre -latex"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -maple -latex"<<endl;
cout << "hybrid-coal -sp '((((B:1,C:1)s1:1)h1#.5:1,A:3)s2:1,(h1#.5:1,D:3)s3:1)r;'"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt '(((A,D),C),B);'"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre"<<endl;
//cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre -maple"<<endl;
//cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gt trees/4_tax_gt4.tre -latex"<<endl;
//cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -maple -latex"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -plot"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -plot -branch"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -plot -label"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -dot"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -print"<<endl;
//cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -print"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -gtopo"<<endl;
cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -sub"<<endl;
//cout << "hybrid-coal -sp trees/4_tax_sp_nt1_para -sub"<<endl;
//cout << "./hybrid-coal_dbg -sp trees/7_tax_sp_james02.tre -gt trees/7_tax_gt_james"<<endl;
cout << endl;
cout << endl;
}


void HybridCoal::print_option(){
cout << endl
<< "hybrid-coal " << VERSION
<< endl
cout << endl
<< "hybrid-coal " << VERSION
<< endl
<< endl;
cout << "Usage:"
cout << "Usage:"
<< endl;
cout << setw(20) << "-h or -help" << " -- " << "Help. List the following content."<<endl;
cout << setw(20) << "-gt STR" << " -- " << "Input the gene tree string string through command line or a file."<<endl;
Expand All @@ -248,7 +249,7 @@ void HybridCoal::print_option(){
cout << setw(20) << "-gtopo" << " -- " << "To generate the gene tree topologies of a given set of taxa."<<endl;
//cout<<"-sub -- Produce file sub_networks, which contanis all sub trees of a species network"<<endl;

cout << setw(20) << "-plot/-dot [option]" << " -- " << "Use LaTEX(-plot) or Dot (-dot) to draw the input (defined by -spcu) network(tree)."<<endl;
cout << setw(20) << "-plot/-dot [option]" << " -- " << "Use LaTEX(-plot) or Dot (-dot) to draw the input (defined by -sp) network(tree)."<<endl;
cout << setw(20) << " [-branch]" << " -- " << "Branch lengths will be labelled in the figure."<<endl;
cout << setw(20) << "-o STR " << " -- " << "Specify the file name prefix of the output."<<endl;
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1-beta
v0.2-beta

0 comments on commit 1bef83b

Please sign in to comment.