Author: bugman Date: Sun Oct 11 15:41:56 2009 New Revision: 9721 URL: http://svn.gna.org/viewcvs/relax?rev=9721&view=rev Log: Created the bmrb.software() user function for manually specifying the software used. Modified: branches/bmrb/generic_fns/bmrb.py branches/bmrb/prompt/bmrb.py branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py Modified: branches/bmrb/generic_fns/bmrb.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb.py?rev=9721&r1=9720&r2=9721&view=diff ============================================================================== --- branches/bmrb/generic_fns/bmrb.py (original) +++ branches/bmrb/generic_fns/bmrb.py Sun Oct 11 15:41:56 2009 @@ -73,6 +73,31 @@ read_function(file_path, version=version) +def software(name=None, version=None, url=None, vendor_name=None, cite=None, tasks=None): + """Select by name the software used in the analysis. + + @param name: The name of the software program. + @type name: str + @keyword version: The program version. + @type version: None or str + @keyword url: The program's URL. + @type url: None or str + @keyword vendor_name: The name of the company or person behind the program. + @type vendor_name: str + @keyword cite: The literature citation. + @type cite: None or str + @keyword tasks: The tasks performed by the program. + @type tasks: list of str + """ + + # Set up the experimental info data container, if needed. + if not hasattr(cdp, 'exp_info'): + cdp.exp_info = ExpInfo() + + # Place the data in the container. + cdp.exp_info.software_setup(name=name, version=version, url=url, vendor_name=vendor_name, cite=cite, tasks=tasks) + + def software_select(name, version=None): """Select by name the software used in the analysis. Modified: branches/bmrb/prompt/bmrb.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/prompt/bmrb.py?rev=9721&r1=9720&r2=9721&view=diff ============================================================================== --- branches/bmrb/prompt/bmrb.py (original) +++ branches/bmrb/prompt/bmrb.py Sun Oct 11 15:41:56 2009 @@ -84,6 +84,78 @@ bmrb.read(file=file, directory=dir, version=version) + def software(self, name=None, version=None, url=None, vendor_name=None, cite=None, tasks=None): + """Specify the software used in the analysis. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + name: The name of the software program utilised. + + version: The version of the software, if applicable. + + url: The web address of the software. + + vendor_name: The name of the company or person behind the program. + + cite: The literature citation for the software. + + tasks: A list of all the tasks performed by the software. + + + Description + ~~~~~~~~~~~ + + This user function allows the software used in the analysis to be specified in full detail. + + For the tasks list, this should be a python list of strings (eg. ['spectral processing']). + Although not restricted to these, the values suggested by the BMRB are: + + 'chemical shift assignment', + 'chemical shift calculation', + 'collection', + 'data analysis', + 'geometry optimization', + 'peak picking', + 'processing', + 'refinement', + 'structure solution' + + + Examples + ~~~~~~~~ + + For BMRB deposition, to say that Sparky was used in the analysis, type: + + relax> bmrb.software('Sparky', version='3.110', url="http://www.cgl.ucsf.edu/home/sparky/", + vendor_name="Goddard, T. D.", cite="Goddard, T. D. and Kneller, D. G., + SPARKY 3, University of California, San Francisco.", + tasks=["spectral analysis"]) + """ + + # Function intro text. + if self.__relax__.interpreter.intro: + text = sys.ps3 + "bmrb.software_select(" + text = text + "name=" + repr(name) + text = text + ", version=" + repr(version) + text = text + ", url=" + repr(url) + text = text + ", vendor_name=" + repr(vendor_name) + text = text + ", cite=" + repr(cite) + text = text + ", tasks=" + repr(tasks) + ")" + print(text) + + # The argument checks. + check.is_str(name, 'program name') + check.is_str(version, 'version', can_be_none=True) + check.is_str(url, 'url', can_be_none=True) + check.is_str(vendor_name, 'vendor_name', can_be_none=True) + check.is_str(cite, 'cite', can_be_none=True) + check.is_str_list(tasks, 'tasks', can_be_none=True) + + # Execute the functional code. + bmrb.software(name=name, version=version, url=url, vendor_name=vendor_name, cite=cite, tasks=tasks) + + def software_select(self, name=None, version=None): """Select the software used in the analysis. @@ -91,6 +163,8 @@ ~~~~~~~~~~~~~~~~~ name: The name of the software program utilised. + + version: The version of the software, if applicable. Description Modified: branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py URL: http://svn.gna.org/viewcvs/relax/branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py?rev=9721&r1=9720&r2=9721&view=diff ============================================================================== --- branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py (original) +++ branches/bmrb/test_suite/system_tests/scripts/bmrb_rw.py Sun Oct 11 15:41:56 2009 @@ -36,6 +36,7 @@ # Set up all the BMRB information. bmrb.software_select('NMRPipe') bmrb.software_select('Sparky', version='3.106') +bmrb.software(name='X', url='http://X.X.X', vendor_name='me', cite='Nothing!', tasks=['procrastinating', 'nothing much', 'wasting time']) # Write, then read the data to a new data pipe. bmrb.write(file=ds.tmpfile, dir=None, version=ds.version, force=True)