The current version of DendroPy has an issue where the following happens:
Suppose m is a DnaCharacterMatrix with some sequences:
m.write('phylip')
5 4
t1 actg
t2 ctga
t3 cccc
t4 ctag
t5 ggtg
m.discard_taxa([t1, t3])
m.write('phylip')
3 4
t1
t2 ctga
t3
t4 ctag
t5 ggtg
m.write('phylip')
5 4
t1
t2 ctga
t3
t4 ctag
t5 ggtg
because blank entries get added by the PhylipWriter to the character matrix.
This patch fixes this issue. It also adds an option to PhylipWriter to suppress printing taxa that have no sequences, which is needed when interfacing with programs like FastTree.
Thanks for this. It is a useful addition. Only thing is that it needs a test. I will be happy to work up a test for this, but may not get around to it till this weekend.
The current version of DendroPy has an issue where the following happens:
Suppose m is a DnaCharacterMatrix with some sequences:
5 4 t1 actg t2 ctga t3 cccc t4 ctag t5 ggtg
3 4 t1 t2 ctga t3 t4 ctag t5 ggtg
5 4 t1 t2 ctga t3 t4 ctag t5 ggtg
because blank entries get added by the PhylipWriter to the character matrix.
This patch fixes this issue. It also adds an option to PhylipWriter to suppress printing taxa that have no sequences, which is needed when interfacing with programs like FastTree.