Author: bugman Date: Fri Sep 26 17:35:58 2008 New Revision: 7350 URL: http://svn.gna.org/viewcvs/relax?rev=7350&view=rev Log: Modified the structural object code to store the file name and path. This will cause some breakages do to the variable name changes. Modified: 1.3/generic_fns/structure/api_base.py 1.3/generic_fns/structure/internal.py 1.3/generic_fns/structure/main.py 1.3/generic_fns/structure/scientific.py Modified: 1.3/generic_fns/structure/api_base.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/api_base.py?rev=7350&r1=7349&r2=7350&view=diff ============================================================================== --- 1.3/generic_fns/structure/api_base.py (original) +++ 1.3/generic_fns/structure/api_base.py Fri Sep 26 17:35:58 2008 @@ -52,8 +52,9 @@ # The parser specific data object. self.structural_data = [] - # Initialise the file name list. - self.file_name = [] + # Initialise the file name and path list. + self.file = [] + self.path = [] def atom_add(self, pdb_record=None, atom_num=None, atom_name=None, res_name=None, chain_id=None, res_num=None, pos=[None, None, None], segment_id=None, element=None, struct_index=None): @@ -224,7 +225,7 @@ xml_to_object(str_node, self) # Now load the structure from file again. - self.load_pdb(file_path=self.file_name, model=None) + self.load_pdb(file_path=self.file, model=None) def load_pdb(self, file_path, model=None, verbosity=False): Modified: 1.3/generic_fns/structure/internal.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/internal.py?rev=7350&r1=7349&r2=7350&view=diff ============================================================================== --- 1.3/generic_fns/structure/internal.py (original) +++ 1.3/generic_fns/structure/internal.py Fri Sep 26 17:35:58 2008 @@ -784,15 +784,12 @@ if verbosity: print "Internal relax PDB parser.\n" - # Store the file name (with full path). - self.file_name.append(file_path) - # Use pointers (references) if the PDB data exists in another pipe. for data_pipe in ds: if hasattr(data_pipe, 'structure'): # Loop over the structures. for i in xrange(len(data_pipe.structure)): - if data_pipe.structure.file_name[i] == file_path and data_pipe.structure[i].model == model and data_pipe.structure.id == 'internal': + if data_pipe.structure.file[i] == file_path and data_pipe.structure[i].model == model and data_pipe.structure.id == 'internal': # Make a pointer to the data. self.structural_data = data_pipe.structure.structural_data[i] Modified: 1.3/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=7350&r1=7349&r2=7350&view=diff ============================================================================== --- 1.3/generic_fns/structure/main.py (original) +++ 1.3/generic_fns/structure/main.py Fri Sep 26 17:35:58 2008 @@ -23,7 +23,7 @@ # Python module imports. from math import sqrt from numpy import dot, float64, ndarray, zeros -from os import F_OK, access +from os import F_OK, access, path from re import search import sys from warnings import warn @@ -198,6 +198,11 @@ elif parser == 'internal': cdp.structure = Internal() + # Set the file name and path. + expanded = path.split(file_path) + cdp.structure.path.append(expanded[0]) + cdp.structure.file.append(expanded[1]) + # Load the structures. cdp.structure.load_pdb(file_path, model, verbosity) Modified: 1.3/generic_fns/structure/scientific.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=7350&r1=7349&r2=7350&view=diff ============================================================================== --- 1.3/generic_fns/structure/scientific.py (original) +++ 1.3/generic_fns/structure/scientific.py Fri Sep 26 17:35:58 2008 @@ -477,15 +477,12 @@ if verbosity: print "Scientific Python PDB parser.\n" - # Store the file name (with full path). - self.file_name = file_path - # Store the model number. self.model = model # Use pointers (references) if the PDB data exists in another run. for data_pipe in ds: - if hasattr(data_pipe, 'structure') and data_pipe.structure.file_name == file_path and data_pipe.structure.model == model: + if hasattr(data_pipe, 'structure') and data_pipe.structure.file[0] == file_path and data_pipe.structure.model == model: # Make a pointer to the data. self.structural_data = data_pipe.structure.structural_data