Author: bugman Date: Wed Jul 15 17:45:07 2009 New Revision: 9238 URL: http://svn.gna.org/viewcvs/relax?rev=9238&view=rev Log: The pcs.read() user function also now accepts the spin_id argument. Modified: 1.3/generic_fns/pcs.py 1.3/prompt/pcs.py Modified: 1.3/generic_fns/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pcs.py?rev=9238&r1=9237&r2=9238&view=diff ============================================================================== --- 1.3/generic_fns/pcs.py (original) +++ 1.3/generic_fns/pcs.py Wed Jul 15 17:45:07 2009 @@ -441,7 +441,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 PCS data from file. @param id: The alignment identification string. @@ -455,6 +455,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. @@ -584,7 +586,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/pcs.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/pcs.py?rev=9238&r1=9237&r2=9238&view=diff ============================================================================== --- 1.3/prompt/pcs.py (original) +++ 1.3/prompt/pcs.py Wed Jul 15 17:45:07 2009 @@ -265,7 +265,7 @@ pcs.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 PCS data from file. Keyword Arguments @@ -276,6 +276,8 @@ file: The name of the file containing the PCS 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). @@ -301,6 +303,13 @@ separated by the symbol ',', and store the PCSs under the identifier 'Tb'. relax> pcs.read('Tb', 'Tb.txt', sep=',') + + + To read the 15N and 1H PCSs from the file 'Eu.txt', where the 15N values are in the 4th + column and the 1H in the 9th, type both the following: + + relax> rdc.read('Tb', 'Tb.txt', spin_id='@N', res_num_col=0, data_col=3) + relax> rdc.read('Tb', 'Tb.txt', spin_id='@H', res_num_col=0, data_col=8) """ # Function intro text. @@ -309,6 +318,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` @@ -331,6 +341,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) @@ -364,7 +378,7 @@ raise RelaxNoneStrError, ('column separator', sep) # Execute the functional code. - pcs.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) + pcs.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):