Author: bugman Date: Wed Feb 5 17:16:11 2014 New Revision: 22135 URL: http://svn.gna.org/viewcvs/relax?rev=22135&view=rev Log: Converted the chain ID list in the internal structural object to the CHAIN_ID_LIST module variable. Modified: trunk/lib/structure/internal/object.py Modified: trunk/lib/structure/internal/object.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/object.py?rev=22135&r1=22134&r2=22135&view=diff ============================================================================== --- trunk/lib/structure/internal/object.py (original) +++ trunk/lib/structure/internal/object.py Wed Feb 5 17:16:11 2014 @@ -45,6 +45,9 @@ from lib.structure.internal.molecules import MolContainer from lib.warnings import RelaxWarning + +# Module variables. +CHAIN_ID_LIST = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz' class Internal: @@ -2384,9 +2387,6 @@ if hasattr(model, 'num') and model.num != None: model_records = True - # Chain IDs. - chain_id_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - #################### # Hetrogen section # @@ -2414,7 +2414,7 @@ # If the residue is not already stored initialise a new het_data element. # (residue number, residue name, chain ID, number of atoms, atom count array). if not het_data[index] or not mol.res_num[i] == het_data[index][-1][0]: - het_data[index].append([mol.res_num[i], mol.res_name[i], chain_id_list[index], 0, []]) + het_data[index].append([mol.res_num[i], mol.res_name[i], CHAIN_ID_LIST[index], 0, []]) # Catch missing chain_ids. if het_data[index][-1][2] == None: @@ -2617,19 +2617,19 @@ atom_name = "%s" % mol.atom_name[i] # Write out. - pdb_write.atom(file, serial=atom_num, name=atom_name, res_name=mol.res_name[i], chain_id=chain_id_list[index], res_seq=mol.res_num[i], x=mol.x[i], y=mol.y[i], z=mol.z[i], occupancy=1.0, temp_factor=0, element=mol.element[i]) + pdb_write.atom(file, serial=atom_num, name=atom_name, res_name=mol.res_name[i], chain_id=CHAIN_ID_LIST[index], res_seq=mol.res_num[i], x=mol.x[i], y=mol.y[i], z=mol.z[i], occupancy=1.0, temp_factor=0, element=mol.element[i]) num_atom += 1 ser_num += 1 # Info for the TER record. ter_num = atom_num + 1 ter_name = mol.res_name[i] - ter_chain_id = chain_id_list[index] + ter_chain_id = CHAIN_ID_LIST[index] ter_res_num = mol.res_num[i] # Finish the ATOM section with the TER record. if atom_record: - pdb_write.ter(file, serial=ser_num, res_name=ter_name, chain_id=chain_id_list[index], res_seq=ter_res_num) + pdb_write.ter(file, serial=ser_num, res_name=ter_name, chain_id=CHAIN_ID_LIST[index], res_seq=ter_res_num) num_ter += 1 ser_num += 1 @@ -2650,7 +2650,7 @@ atom_num += 1 # Write out. - pdb_write.hetatm(file, serial=ser_num, name=self._translate(mol.atom_name[i]), res_name=mol.res_name[i], chain_id=chain_id_list[index], res_seq=mol.res_num[i], x=mol.x[i], y=mol.y[i], z=mol.z[i], occupancy=1.0, temp_factor=0.0, element=mol.element[i]) + pdb_write.hetatm(file, serial=ser_num, name=self._translate(mol.atom_name[i]), res_name=mol.res_name[i], chain_id=CHAIN_ID_LIST[index], res_seq=mol.res_num[i], x=mol.x[i], y=mol.y[i], z=mol.z[i], occupancy=1.0, temp_factor=0.0, element=mol.element[i]) num_hetatm += 1 ser_num += 1