Author: bugman Date: Tue Aug 17 17:45:08 2010 New Revision: 11527 URL: http://svn.gna.org/viewcvs/relax?rev=11527&view=rev Log: Created the frame_order.domain_to_pdb() user function to associated PDB files with domains. This will be used to rotated the moving domain to the average position within pymol. Modified: 1.3/prompt/frame_order.py 1.3/specific_fns/frame_order.py Modified: 1.3/prompt/frame_order.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/frame_order.py?rev=11527&r1=11526&r2=11527&view=diff ============================================================================== --- 1.3/prompt/frame_order.py (original) +++ 1.3/prompt/frame_order.py Tue Aug 17 17:45:08 2010 @@ -95,6 +95,49 @@ frame_order_obj._cone_pdb(size=size, inc=inc, file=file, dir=dir, force=force) + def domain_to_pdb(self, domain=None, pdb=None): + """Match the domains to PDB files. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + domain: The domain to associate the PDB file to. + + pdb: The PDB file to associate the domain to. + + + Description + ~~~~~~~~~~~ + + To display the frame order cone models within Pymol, the two domains need to be associated + with PDB files. Then the reference domain will be fixed in the PDB frame, and the moving + domain will be rotated to its average position. + + + Examples + ~~~~~~~~ + + To set the 'N' domain to the PDB file 'bax_N_1J7O_1st.pdb', type one of: + + relax> frame_order.domain_to_pdb('N', 'bax_N_1J7O_1st.pdb') + relax> frame_order.domain_to_pdb(domain='N', pdb='bax_N_1J7O_1st.pdb') + """ + + # Function intro text. + if self._exec_info.intro: + text = self._exec_info.ps3 + "frame_order.domain_to_pdb(" + text = text + "domain=" + repr(domain) + text = text + ", pdb=" + repr(pdb) + ")" + print(text) + + # The argument checks. + arg_check.is_str(domain, 'domain') + arg_check.is_str(pdb, 'PDB file') + + # Execute the functional code. + frame_order_obj._domain_to_pdb(domain=domain, pdb=pdb) + + def pivot(self, pivot=None): """Set the pivot point for the two body motion in the structural coordinate system. Modified: 1.3/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/frame_order.py?rev=11527&r1=11526&r2=11527&view=diff ============================================================================== --- 1.3/specific_fns/frame_order.py (original) +++ 1.3/specific_fns/frame_order.py Tue Aug 17 17:45:08 2010 @@ -332,6 +332,31 @@ pdb_file = open_write_file(file, dir, force=force) structure.write_pdb(pdb_file) pdb_file.close() + + + def _domain_to_pdb(self, domain=None, pdb=None): + """Match domains to PDB files. + + @keyword domain: The domain to associate the PDB file to. + @type domain: str + @keyword pdb: The PDB file to associate the domain to. + @type pdb: str + """ + + # Check that the domain exists. + exists = False + for i in range(len(cdp.align_tensors)): + if hasattr(cdp.align_tensors[i], 'domain') and domain == cdp.align_tensors[i].domain: + exists = True + if not exists: + raise RelaxError("The domain '%s' cannot be found" % domain) + + # Init if needed. + if not hasattr(cdp, 'domain_to_pdb'): + cdp.domain_to_pdb = [] + + # Add the data. + cdp.domain_to_pdb.append([domain, pdb]) def _grid_row(self, incs, lower, upper, dist_type=None, end_point=True):