Author: bugman Date: Fri Apr 11 14:38:17 2008 New Revision: 5580 URL: http://svn.gna.org/viewcvs/relax?rev=5580&view=rev Log: Improvements to the Scientific Python structural object atom_loop() method. Multiple molecules of different types are now simultaneously supported. Modified: 1.3/generic_fns/structure/scientific.py Modified: 1.3/generic_fns/structure/scientific.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=5580&r1=5579&r2=5580&view=diff ============================================================================== --- 1.3/generic_fns/structure/scientific.py (original) +++ 1.3/generic_fns/structure/scientific.py Fri Apr 11 14:38:17 2008 @@ -89,24 +89,30 @@ # Loop over the loaded structures. for struct in self.structural_data: + # Initialise an array of individual structures from each element of self.structural_data. + comps = [] + molecule = [] + # Protein. if struct.peptide_chains: - chains = struct.peptide_chains - molecule = 'protein' + for chain in struct.peptide_chains: + comps.append(chain) + molecule.append('protein') # RNA/DNA. elif struct.nucleotide_chains: - chains = struct.nucleotide_chains - molecule = 'nucleic acid' - - # We have a problem! + for chain in struct.nucleotide_chains: + comps.append(chain) + molecule.append('nucleic acid') + + # Other molecules. else: - raise RelaxNoPdbChainError - - # Loop over the chains (each of which will be treated as a new molecule). - for chain in chains: + pass # for now. + + # Loop over each individual molecules. + for mol in comps: # The molecule name. - if chain.chain_id: + if mol.chain_id: mol_name = chain.chain_id elif chain.segment_id: mol_name = chain.segment_id