Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary support #14

Open
wants to merge 1 commit into
base: mpboot
Choose a base branch
from
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
18 changes: 16 additions & 2 deletions alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,22 @@ SeqType Alignment::detectSequenceType(StrVector &sequences) {
}
if (((double)num_nuc) / num_ungap > 0.9)
return SEQ_DNA;
if (((double)num_bin) / num_ungap > 0.9)
return SEQ_BINARY;
if (((double)num_bin) / num_ungap > 0.9) {
cout << "[BINARY-SEQUENCE-WARNING]" << endl;
cout << "Since the PLL library we are using only supports sequence of type DNA, the following process will treat the input as DNA (mapping 0 to A and 1 to G) and not break the property of resulting trees." << endl;
cout << "[BINARY-SEQUENCE-WARNING]" << endl;
cout << endl;

for (StrVector::iterator it = sequences.begin(); it != sequences.end(); it++) {
for (string::iterator i = it->begin(); i != it->end(); i++) {
if ((*i) == '0') *i = 'A';
if ((*i) == '1') *i = 'G';
if ((*i) == '-') *i = 'R';
}
}

return SEQ_DNA;
}
if (((double)num_alpha) / num_ungap > 0.9)
return SEQ_PROTEIN;
if (((double)(num_alpha+num_digit)) / num_ungap > 0.9)
Expand Down
6 changes: 4 additions & 2 deletions phyloanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,10 @@ void runPhyloAnalysis(Params &params) {
IQTree *tree;

/****************** read in alignment **********************/
if (strcmp(params.sequence_type, "BIN") == 0) {
params.sequence_type = "DNA";
}

if (params.partition_file) {
// Partition model analysis
if(params.partition_type){
Expand Down Expand Up @@ -2159,8 +2163,6 @@ void runPhyloAnalysis(Params &params) {
alignment = aln;
}
tree = new IQTree(alignment);


}

// if(params.maximum_parsimony && (params.gbo_replicates || params.sankoff_cost_file)){
Expand Down