Author: bugman Date: Wed Feb 2 17:01:31 2011 New Revision: 12508 URL: http://svn.gna.org/viewcvs/relax?rev=12508&view=rev Log: The bmrb.read() user function now accepts the sample_conditions arg. Modified: branches/bmrb/prompt/bmrb.py Modified: branches/bmrb/prompt/bmrb.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/prompt/bmrb.py?rev=12508&r1=12507&r2=12508&view=diff ============================================================================== --- branches/bmrb/prompt/bmrb.py (original) +++ branches/bmrb/prompt/bmrb.py Wed Feb 2 17:01:31 2011 @@ -175,7 +175,7 @@ bmrb.display(version=version) - def read(self, file=None, dir=None, version=None): + def read(self, file=None, dir=None, version=None, sample_conditions='conditions_1'): """Read BMRB files in the NMR-STAR format. Keyword Arguments @@ -185,11 +185,18 @@ dir: The directory where the file is located. - - Description - ~~~~~~~~~~~ - - To search for the results file in the current working directory, set dir to None. + version: For the reading to use the given NMR-STAR version. + + sample_conditions: The sample conditions label in the NMR-STAR file to restrict loading to. + + + Description + ~~~~~~~~~~~ + + To search for the results file in the current working directory, set dir to None. Note that + only one sample condition can be read per relax data pipe. Therefore if sample_conditions + is not given and multiple conditions exist in the NMR-STAR file, a RelaxError will be + raised. """ # Function intro text. @@ -197,16 +204,18 @@ text = self._exec_info.ps3 + "bmrb.read(" text = text + "file=" + repr(file) text = text + ", dir=" + repr(dir) - text = text + ", version=" + repr(version) + ")" + text = text + ", version=" + repr(version) + text = text + ", sample_conditions=" + repr(sample_conditions) + ")" print(text) # The argument checks. arg_check.is_str(file, 'file name') arg_check.is_str(dir, 'directory name', can_be_none=True) arg_check.is_str(version, 'NMR-STAR dictionary version', can_be_none=True) - - # Execute the functional code. - bmrb.read(file=file, directory=dir, version=version) + arg_check.is_str(sample_conditions, 'sample conditions label', can_be_none=True) + + # Execute the functional code. + bmrb.read(file=file, directory=dir, version=version, sample_conditions=sample_conditions) def script(self, file='reduced', dir=None, analysis_type=None, model_selection=None, engine='relax', model_elim=False, universal_solution=False):