[Biopython-dev] Bio.AlignIO, Bio.Nexus, MrBayes, polymorphic sites, maximum line length

Nick Loman n.j.loman at bham.ac.uk
Thu Dec 2 17:11:13 UTC 2010


Peter wrote:
> 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?
>   
Hi Peter,

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) ?

Excellent.

Cheers

Nick




More information about the Biopython-dev mailing list