Author: bugman Date: Tue Oct 6 11:22:21 2009 New Revision: 9568 URL: http://svn.gna.org/viewcvs/relax?rev=9568&view=rev Log: Added the spin_id_col arg to the rdc.read() user function. This allows 2 different formats for spin identification - spin ID string or mol name, res name and num, and spin name and num. Modified: 1.3/prompt/rdc.py Modified: 1.3/prompt/rdc.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=9568&r1=9567&r2=9568&view=diff ============================================================================== --- 1.3/prompt/rdc.py (original) +++ 1.3/prompt/rdc.py Tue Oct 6 11:22:21 2009 @@ -176,7 +176,7 @@ rdc.display(id=id) - 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): + def read(self, id=None, file=None, dir=None, spin_id_col=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, spin_id=None): """Read the RDC data from file. Keyword Arguments @@ -188,23 +188,36 @@ dir: The directory where the file is located. + spin_id_col: The spin identification string column (an alternative to the mol, res, and + spin name and number columns). + + mol_name_col: The molecule name column (alternative to the spid_id_col). + + res_num_col: The residue number column (alternative to the spid_id_col). + + res_name_col: The residue name column (alternative to the spid_id_col). + + spin_num_col: The spin number column (alternative to the spid_id_col). + + spin_name_col: The spin name column (alternative to the spid_id_col). + + data_col: The RDC data column. + + error_col: The experimental error column. + + sep: The column separator (the default is white space). + spin_id: The spin identification string. - mol_name_col: The molecule name column (this defaults to no column). - - res_num_col: The residue number column (the default is 0, i.e. the first column). - - res_name_col: The residue name column (the default is 1, i.e. the second column). - - spin_num_col: The spin number column (this defaults to no column). - - spin_name_col: The spin name column (this defaults to no column). - - data_col: The RDC data column (the default is 2). - - error_col: The experimental error column (the default is 3). - - sep: The column separator (the default is white space). + + Description + ~~~~~~~~~~~ + + The spin system can be identified in the file using two different formats. The first is the + spin ID string column which can include the molecule name, the residue name and number, and + the spin name and number. Alternatively the mol_name_col, res_num_col, res_name_col, + spin_num_col, and/or spin_name_col arguments can be supplied allowing this information to be + in separate columns. Note that the numbering of columns starts at zero. Examples @@ -234,7 +247,7 @@ text = text + "id=" + repr(id) text = text + ", file=" + repr(file) text = text + ", dir=" + repr(dir) - text = text + ", spin_id=" + repr(spin_id) + text = text + ", spin_id_col=" + repr(spin_id_col) text = text + ", mol_name_col=" + repr(mol_name_col) text = text + ", res_num_col=" + repr(res_num_col) text = text + ", res_name_col=" + repr(res_name_col) @@ -242,14 +255,15 @@ text = text + ", spin_name_col=" + repr(spin_name_col) text = text + ", data_col=" + repr(data_col) text = text + ", error_col=" + repr(error_col) - text = text + ", sep=" + repr(sep) + ")" + text = text + ", sep=" + repr(sep) + text = text + ", spin_id=" + repr(spin_id) + ")" print(text) # The argument checks. check.is_str(id, 'alignment identification string') check.is_str(file, 'file name') check.is_str(dir, 'directory name', can_be_none=True) - check.is_str(spin_id, 'spin identification string', can_be_none=True) + check.is_int(spin_id_col, 'spin identification string column', can_be_none=True) check.is_int(mol_name_col, 'molecule name column', can_be_none=True) check.is_int(res_num_col, 'residue number column', can_be_none=True) check.is_int(res_name_col, 'residue name column', can_be_none=True) @@ -258,9 +272,10 @@ check.is_int(data_col, 'data column', can_be_none=True) check.is_int(error_col, 'error column', can_be_none=True) check.is_str(sep, 'column separator', can_be_none=True) - - # Execute the functional code. - 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) + check.is_str(spin_id, 'spin identification string', can_be_none=True) + + # Execute the functional code. + rdc.read(id=id, file=file, dir=dir, spin_id_col=spin_id_col, 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, spin_id=spin_id) def write(self, id=None, file=None, dir=None, force=False):