[Biopython-dev] Bio.AlignIO, Bio.Nexus, MrBayes, polymorphic sites, maximum line length
n.j.loman at bham.ac.uk
Thu Dec 2 12:11:13 EST 2010
> Did you ask Bio.Nexus to write interleaved output?
> I've got MrBayes 3.1.2, and this seems to fix your example:
> diff --git a/Bio/AlignIO/NexusIO.py b/Bio/AlignIO/NexusIO.py
> index 72550b1..c3b1649 100644
> --- a/Bio/AlignIO/NexusIO.py
> +++ b/Bio/AlignIO/NexusIO.py
> @@ -107,7 +107,7 @@ class NexusWriter(AlignmentWriter):
> n.alphabet = alignment._alphabet
> for record in alignment:
> n.add_sequence(record.id, record.seq.tostring())
> - n.write_nexus_data(self.handle)
> + n.write_nexus_data(self.handle, interleave=True)
> def _classify_alphabet_for_nexus(self, alphabet):
> """Returns 'protein', 'dna', 'rna' based on the alphabet (PRIVATE).
> Does that work for you?
Yes, that does the trick! I wonder if perhaps that's what Cymon meant to
say rather than interleave_by_partition (hence the boolean problem) ?
More information about the Biopython-dev