Permalink
Browse files

Adding deepcopy patch back in. See bug #2380.

  • Loading branch information...
1 parent 56eb84b commit 22853c17bdd27bc63eab34d11eb4553d5584b5d8 mdehoon committed Jun 29, 2008
Showing with 9 additions and 9 deletions.
  1. +9 −9 Bio/Nexus/Nexus.py
View
@@ -666,17 +666,17 @@ def _format(self,options):
if options.has_key('datatype'):
self.datatype=options['datatype'].lower()
if self.datatype=='dna' or self.datatype=='nucleotide':
- self.alphabet=IUPAC.ambiguous_dna
- self.ambiguous_values=IUPACData.ambiguous_dna_values
- self.unambiguous_letters=IUPACData.unambiguous_dna_letters
+ self.alphabet=copy.deepcopy(IUPAC.ambiguous_dna)
+ self.ambiguous_values=copy.deepcopy(IUPACData.ambiguous_dna_values)
+ self.unambiguous_letters=copy.deepcopy(IUPACData.unambiguous_dna_letters)
elif self.datatype=='rna':
- self.alphabet=IUPAC.ambiguous_rna
- self.ambiguous_values=IUPACData.ambiguous_rna_values
- self.unambiguous_letters=IUPACData.unambiguous_rna_letters
+ self.alphabet=copy.deepcopy(IUPAC.ambiguous_rna)
+ self.ambiguous_values=copy.deepcopy(IUPACData.ambiguous_rna_values)
+ self.unambiguous_letters=copy.deepcopy(IUPACData.unambiguous_rna_letters)
elif self.datatype=='protein':
- self.alphabet=IUPAC.protein
- self.ambiguous_values={'B':'DN','Z':'EQ','X':IUPACData.protein_letters} # that's how PAUP handles it
- self.unambiguous_letters=IUPACData.protein_letters+'*' # stop-codon
+ self.alphabet=copy.deepcopy(IUPAC.protein)
+ self.ambiguous_values={'B':'DN','Z':'EQ','X':copy.deepcopy(IUPACData.protein_letters)} # that's how PAUP handles it
+ self.unambiguous_letters=copy.deepcopy(IUPACData.protein_letters)+'*' # stop-codon
elif self.datatype=='standard':
raise NexusError('Datatype standard is not yet supported.')
#self.alphabet=None

0 comments on commit 22853c1

Please sign in to comment.