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

PrunedAlignment checks whether taxonSet is null, but it never is. #3

Open
Anaphory opened this issue Feb 1, 2016 · 1 comment
Open

Comments

@Anaphory
Copy link

Anaphory commented Feb 1, 2016

PrunedAlignment uses a given TaxonSet based on whether taxonSet is null or not. However, the corresponding input is optional with a default value of TaxonSet(). This means that PA's initAndValidate should instead check whether taxonSet is empty.

@Anaphory
Copy link
Author

Anaphory commented Feb 1, 2016

example diff:

diff --git a/src/beast/evolution/alignment/PrunedAlignment.java b/src/beast/evolution/alignment/PrunedAlignment.java
index 7be8dfc..645ce8c 100644
--- a/src/beast/evolution/alignment/PrunedAlignment.java
+++ b/src/beast/evolution/alignment/PrunedAlignment.java
@@ -46,7 +46,7 @@ public class PrunedAlignment extends Alignment {

           final List<String> srcTaxa = source.taxaNames;
           final List<List<Integer>> srcCounts = source.counts;
-          if( taxonSet != null ) {
+          if( taxonSet.getTaxonCount() > 0 ) {
              for(int i = 0; i < source.taxaNames.size(); ++i) {

                  if( taxonSet.getTaxonIndex(srcTaxa.get(i)) < 0  ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant