From 22853c17bdd27bc63eab34d11eb4553d5584b5d8 Mon Sep 17 00:00:00 2001 From: mdehoon Date: Sun, 29 Jun 2008 13:10:22 +0000 Subject: [PATCH] Adding deepcopy patch back in. See bug #2380. --- Bio/Nexus/Nexus.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Bio/Nexus/Nexus.py b/Bio/Nexus/Nexus.py index 1f03108b26f..b418818c129 100644 --- a/Bio/Nexus/Nexus.py +++ b/Bio/Nexus/Nexus.py @@ -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