Author: bugman Date: Wed Jul 15 17:38:43 2009 New Revision: 9236 URL: http://svn.gna.org/viewcvs/relax?rev=9236&view=rev Log: The rdc.read() user function now accepts the spin_id arg. Modified: 1.3/generic_fns/rdc.py 1.3/prompt/rdc.py Modified: 1.3/generic_fns/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=9236&r1=9235&r2=9236&view=diff ============================================================================== --- 1.3/generic_fns/rdc.py (original) +++ 1.3/generic_fns/rdc.py Wed Jul 15 17:38:43 2009 @@ -365,7 +365,7 @@ return index -def read(id=None, file=None, dir=None, file_data=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None): +def read(id=None, file=None, dir=None, file_data=None, spin_id=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None): """Read the RDC data from file. @param id: The RDC identification string. @@ -379,6 +379,8 @@ correct format. The format is a list of lists where the first index corresponds to the row and the second the column. @type file_data: list of lists + @keyword spin_id: The spin identification string. + @type spin_id: None or str @param mol_name_col: The column containing the molecule name information. @type mol_name_col: int or None @param res_name_col: The column containing the residue name information. @@ -508,7 +510,7 @@ raise RelaxError, "An invalid error value of zero has been encountered." # Get the corresponding spin container. - spin = return_spin(id) + spin = return_spin([id, spin_id]) if spin == None: raise RelaxNoSpinError, id Modified: 1.3/prompt/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=9236&r1=9235&r2=9236&view=diff ============================================================================== --- 1.3/prompt/rdc.py (original) +++ 1.3/prompt/rdc.py Wed Jul 15 17:38:43 2009 @@ -195,7 +195,7 @@ rdc.display(id=id) - def read(self, id=None, file=None, dir=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None): + def read(self, id=None, file=None, dir=None, spin_id=None, mol_name_col=None, res_num_col=None, res_name_col=None, spin_num_col=None, spin_name_col=None, data_col=None, error_col=None, sep=None): """Read the RDC data from file. Keyword Arguments @@ -206,6 +206,8 @@ file: The name of the file containing the RDC data. dir: The directory where the file is located. + + spin_id: The spin identification string. mol_name_col: The molecule name column (this defaults to no column). @@ -238,6 +240,11 @@ relax> rdc.read('phage', 'rdc_err.txt', error_col=4) relax> rdc.read(id='phage', file='rdc_err.txt', error_col=4) + + + If the RDCs correspond to the 'N' spin and other spins are loaded into relax, then type: + + relax> rdc.read('Tb', 'Tb.txt', spin_id='@N') """ # Function intro text. @@ -246,6 +253,7 @@ text = text + "id=" + `id` text = text + ", file=" + `file` text = text + ", dir=" + `dir` + text = text + ", spin_id=" + `spin_id` text = text + ", mol_name_col=" + `mol_name_col` text = text + ", res_num_col=" + `res_num_col` text = text + ", res_name_col=" + `res_name_col` @@ -268,6 +276,10 @@ if dir != None and type(dir) != str: raise RelaxNoneStrError, ('directory name', dir) + # Spin identifier. + if spin_id != None and type(spin_id) != str: + raise RelaxNoneStrError, ('spin identifier', spin_id) + # Molecule name column. if mol_name_col != None and type(mol_name_col) != int: raise RelaxNoneIntError, ('molecule name column', mol_name_col) @@ -301,7 +313,7 @@ raise RelaxNoneStrError, ('column separator', sep) # Execute the functional code. - rdc.read(id=id, file=file, dir=dir, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep) + rdc.read(id=id, file=file, dir=dir, spin_id=spin_id, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep) def write(self, id=None, file=None, dir=None, force=False):