mailr10885 - in /branches/bmrb/generic_fns: bmrb.py exp_info.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 24, 2010 - 01:27:
Author: bugman
Date: Wed Feb 24 01:27:24 2010
New Revision: 10885

URL: http://svn.gna.org/viewcvs/relax?rev=10885&view=rev
Log:
All references are now taken from the Info_box.bib dictionary

The CITE structure has therefore been deleted.


Modified:
    branches/bmrb/generic_fns/bmrb.py
    branches/bmrb/generic_fns/exp_info.py

Modified: branches/bmrb/generic_fns/bmrb.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/bmrb.py?rev=10885&r1=10884&r2=10885&view=diff
==============================================================================
--- branches/bmrb/generic_fns/bmrb.py (original)
+++ branches/bmrb/generic_fns/bmrb.py Wed Feb 24 01:27:24 2010
@@ -30,6 +30,7 @@
 from data import Relax_data_store; ds = Relax_data_store()
 from data.exp_info import ExpInfo
 from generic_fns import exp_info
+from info import Info_box
 from relax_errors import RelaxError, RelaxFileError, 
RelaxFileOverwriteError, RelaxNoPipeError
 from relax_io import get_file_path, mkdir_nofail
 from specific_fns.setup import get_specific_fn
@@ -102,9 +103,16 @@
     # Create the directories.
     mkdir_nofail(directory, verbosity=0)
 
+    # Get the info box.
+    info = Info_box()
+
     # Add the relax citations.
-    for id, key in zip(['relax_ref1', 'relax_ref2'], ['relax 1', 'relax 2']):
-        cdp.exp_info.add_citation(cite_id=id, 
authors=exp_info.CITE[key].authors, doi=exp_info.CITE[key].doi, 
pubmed_id=exp_info.CITE[key].pubmed_id, 
full_citation=exp_info.CITE[key].full_citation, 
title=exp_info.CITE[key].title, status=exp_info.CITE[key].status, 
type=exp_info.CITE[key].type, 
journal_abbrev=exp_info.CITE[key].journal_abbrev, 
journal_full=exp_info.CITE[key].journal_full, 
volume=exp_info.CITE[key].volume, issue=exp_info.CITE[key].issue, 
page_first=exp_info.CITE[key].page_first, 
page_last=exp_info.CITE[key].page_last, year=exp_info.CITE[key].year)
+    for id, key in zip(['relax_ref1', 'relax_ref2'], ['dAuvergneGooley08a', 
'dAuvergneGooley08b']):
+        # Alias the bib entry.
+        bib = info.bib[key]
+
+        # Add.
+        cdp.exp_info.add_citation(cite_id=id, authors=bib.author2, 
doi=bib.doi, pubmed_id=bib.pubmed_id, full_citation=bib.cite_short(doi=False, 
url=False), title=bib.title, status=bib.status, type=bib.type, 
journal_abbrev=bib.journal, journal_full=bib.journal_full, volume=bib.volume, 
issue=bib.number, page_first=bib.page_first, page_last=bib.page_last, 
year=bib.year)
 
     # Add the relax software package.
     cdp.exp_info.software_setup(name=exp_info.SOFTWARE['relax'].name, 
version=version_full(), vendor_name=exp_info.SOFTWARE['relax'].authors, 
url=exp_info.SOFTWARE['relax'].url, cite_ids=['relax_ref1', 'relax_ref2'], 
tasks=exp_info.SOFTWARE['relax'].tasks)

Modified: branches/bmrb/generic_fns/exp_info.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/generic_fns/exp_info.py?rev=10885&r1=10884&r2=10885&view=diff
==============================================================================
--- branches/bmrb/generic_fns/exp_info.py (original)
+++ branches/bmrb/generic_fns/exp_info.py Wed Feb 24 01:27:24 2010
@@ -22,9 +22,6 @@
 
 # Module docstring.
 """Module containing functions for specifying the experimental details."""
-
-# Python module imports.
-from string import split
 
 # relax module imports.
 from info import Info_box
@@ -34,29 +31,6 @@
 from version import version_full
 
 
-# Storage containers.
-class Cite_store:
-    """Citation storage container."""
-
-    def __init__(self):
-        """Initialise all variables."""
-
-        self.authors = None
-        self.doi = None
-        self.pubmed_id = None
-        self.full_citation = None
-        self.title = None
-        self.status = None
-        self.type = None
-        self.journal_abbrev = None
-        self.journal_full = None
-        self.volume = None
-        self.issue = None
-        self.page_first = None
-        self.page_last = None
-        self.year = None
-
-
 class Software_store:
     """Software storage container."""
 
@@ -69,8 +43,7 @@
         self.tasks = None
 
 
-# Citation and software data structures.
-CITE = {}
+# Software data structure.
 SOFTWARE = {}
 
 # relax software.
@@ -80,60 +53,12 @@
 SOFTWARE['relax'].url = "http://nmr-relax.com";
 SOFTWARE['relax'].tasks = ["data processing"]
 
-# relax citation 1.
-CITE['relax 1'] = Cite_store()
-CITE['relax 1'].authors = [["Edward", "d'Auvergne", "E.", "J."], ["Paul", 
"Gooley", "P.", "R."]]
-CITE['relax 1'].doi = "10.1007/s10858-007-9214-2"
-CITE['relax 1'].pubmed_id = "18085410"
-CITE['relax 1'].full_citation = "d'Auvergne, E. J. and Gooley, P. R. (2008). 
 Optimisation of NMR dynamic models I.  Minimisation algorithms and their 
performance within the model-free and Brownian rotational diffusion spaces.  
J. Biomol. NMR, 40(2), 107-119."
-CITE['relax 1'].title = "Optimisation of NMR dynamic models I.  Minimisation 
algorithms and their performance within the model-free and Brownian 
rotational diffusion spaces."
-CITE['relax 1'].status = "published"
-CITE['relax 1'].type = "journal"
-CITE['relax 1'].journal_abbrev = "J. Biomol. NMR"
-CITE['relax 1'].journal_full = "Journal of Biomolecular NMR"
-CITE['relax 1'].volume = 40
-CITE['relax 1'].issue = 2
-CITE['relax 1'].page_first = 107
-CITE['relax 1'].page_last = 119
-CITE['relax 1'].year = 2008
-
-# relax citation 2.
-CITE['relax 2'] = Cite_store()
-CITE['relax 2'].authors = [["Edward", "d'Auvergne", "E.", "J."], ["Paul", 
"Gooley", "P.", "R."]]
-CITE['relax 2'].doi = "10.1007/s10858-007-9213-3"
-CITE['relax 2'].pubmed_id = "18085411"
-CITE['relax 2'].full_citation = "d'Auvergne, E. J. and Gooley, P. R. (2008). 
 Optimisation of NMR dynamic models II.  A new methodology for the dual 
optimisation of the model-free parameters and the Brownian rotational 
diffusion tensor.  J. Biomol. NMR, 40(2), 121-133."
-CITE['relax 2'].title = "Optimisation of NMR dynamic models II.  A new 
methodology for the dual optimisation of the model-free parameters and the 
Brownian rotational diffusion tensor."
-CITE['relax 2'].status = "published"
-CITE['relax 2'].type = "journal"
-CITE['relax 2'].journal_abbrev = "J. Biomol. NMR"
-CITE['relax 2'].journal_full = "Journal of Biomolecular NMR"
-CITE['relax 2'].volume = 40
-CITE['relax 2'].issue = 2
-CITE['relax 2'].page_first = 121
-CITE['relax 2'].page_last = 133
-CITE['relax 2'].year = 2008
-
 # NMRPipe software and citation.
 SOFTWARE['NMRPipe'] = Software_store()
 SOFTWARE['NMRPipe'].name = "NMRPipe"
 SOFTWARE['NMRPipe'].authors = "Delaglio, F., Grzesiek, S., Vuister, G. W., 
Zhu, G., Pfeifer, J., and Bax, A"
 SOFTWARE['NMRPipe'].url = "http://spin.niddk.nih.gov/NMRPipe/";
 SOFTWARE['NMRPipe'].tasks = ["processing"]
-CITE['NMRPipe'] = Cite_store()
-CITE['NMRPipe'].authors = [["Frank", "Delaglio", "F.", None], ["Stephan", 
"Grzesiek", "S.", None], ["Geerten", "Vuister", "G.", "W."], ["Guang", "Zhu", 
"G.", None], ["John", "Pfeifer", "J.", None], ["Ad", "Bax", "A.", None]]
-CITE['NMRPipe'].doi = "10.1007/BF00197809"
-CITE['NMRPipe'].pubmed_id = "8520220"
-CITE['NMRPipe'].full_citation = "Delaglio, F., Grzesiek, S., Vuister, G. W., 
Zhu, G., Pfeifer, J., and Bax, A. (1995).  NMRPipe: a multidimensional 
spectral processing system based on UNIX pipes.  J. Biomol. NMR. 6, 277-293."
-CITE['NMRPipe'].title = "NMRPipe: a multidimensional spectral processing 
system based on UNIX pipes." 
-CITE['NMRPipe'].status = "published"
-CITE['NMRPipe'].type = "journal"
-CITE['NMRPipe'].journal_abbrev = "J. Biomol. NMR"
-CITE['NMRPipe'].journal_full = "Journal of Biomolecular NMR"
-CITE['NMRPipe'].volume = 6
-CITE['NMRPipe'].page_first = 277
-CITE['NMRPipe'].page_last = 293
-CITE['NMRPipe'].year = 1995
 
 # Sparky software and citation.
 SOFTWARE['Sparky'] = Software_store()
@@ -142,12 +67,6 @@
 SOFTWARE['Sparky'].ref = "Goddard, T. D. and Kneller, D. G., SPARKY 3, 
University of California, San Francisco."
 SOFTWARE['Sparky'].url = "http://www.cgl.ucsf.edu/home/sparky/";
 SOFTWARE['Sparky'].tasks = ["spectral analysis"]
-CITE['Sparky'] = Cite_store()
-CITE['Sparky'].authors = [["Tom", "Goddard", "T.", "D."], ["Donald", 
"Kneller", "D.", "G."]]
-CITE['Sparky'].full_citation = "Goddard, T. D. and Kneller, D. G., SPARKY 3, 
University of California, San Francisco."
-CITE['Sparky'].title = "Sparky."
-CITE['Sparky'].status = "unpublished"
-CITE['Sparky'].type = "internet"
 
 
 
@@ -331,7 +250,7 @@
         bib = info.bib[key]
 
         # Add the citation.
-        cdp.exp_info.add_citation(cite_id=id, authors=bib.author2, 
doi=bib.doi, pubmed_id=bib.pubmed_id, full_citation=bib.cite_short(), 
title=bib.title, status=bib.status, type=bib.type, 
journal_abbrev=bib.journal, journal_full=bib.journal_full, volume=bib.volume, 
page_first=split(bib.pages, '-')[0], page_last=split(bib.pages, '-')[1], 
year=bib.year)
+        cdp.exp_info.add_citation(cite_id=id, authors=bib.author2, 
doi=bib.doi, pubmed_id=bib.pubmed_id, full_citation=bib.cite_short(doi=False, 
url=False), title=bib.title, status=bib.status, type=bib.type, 
journal_abbrev=bib.journal, journal_full=bib.journal_full, volume=bib.volume, 
page_first=bib.page_first, page_last=bib.page_last, year=bib.year)
 
     # Place the data in the container.
     cdp.exp_info.setup_script(file=file, dir=dir, text=text, 
cite_ids=cite_id, analysis_type=analysis_type, 
model_selection=model_selection, engine=engine, model_elim=model_elim, 
universal_solution=universal_solution)
@@ -389,7 +308,7 @@
     if name == 'relax':
         # The info.
         cite_ids.append(['relax_ref1', 'relax_ref2'])
-        keys.append(['relax 1', 'relax 2'])
+        keys.append(['dAuvergneGooley08a', 'dAuvergneGooley08b'])
         software_keys.append('relax')
         versions.append(version_full())
 
@@ -397,7 +316,7 @@
     if name == 'NMRPipe':
         # The info.
         cite_ids.append(['nmrpipe_ref'])
-        keys.append(['NMRPipe'])
+        keys.append(['Delaglio95'])
         software_keys.append('NMRPipe')
         versions.append(version)
 
@@ -409,15 +328,21 @@
 
         # The info.
         cite_ids.append(['sparky_ref'])
-        keys.append(['Sparky'])
+        keys.append(['GoddardKneller'])
         software_keys.append('Sparky')
         versions.append(version)
+
+    # Get the info box.
+    info = Info_box()
 
     # Loop over the citations.
     for i in range(len(cite_ids)):
         for j in range(len(cite_ids[i])):
+            # Alias the bib entry.
+            bib = info.bib[keys[i][j]]
+
             # Add the citations.
-            cdp.exp_info.add_citation(cite_id=cite_ids[i][j], 
authors=CITE[keys[i][j]].authors, doi=CITE[keys[i][j]].doi, 
pubmed_id=CITE[keys[i][j]].pubmed_id, 
full_citation=CITE[keys[i][j]].full_citation, title=CITE[keys[i][j]].title, 
status=CITE[keys[i][j]].status, type=CITE[keys[i][j]].type, 
journal_abbrev=CITE[keys[i][j]].journal_abbrev, 
journal_full=CITE[keys[i][j]].journal_full, volume=CITE[keys[i][j]].volume, 
page_first=CITE[keys[i][j]].page_first, page_last=CITE[keys[i][j]].page_last, 
year=CITE[keys[i][j]].year)
+            cdp.exp_info.add_citation(cite_id=cite_ids[i][j], 
authors=bib.author2, doi=bib.doi, pubmed_id=bib.pubmed_id, 
full_citation=bib.cite_short(doi=False, url=False), title=bib.title, 
status=bib.status, type=bib.type, journal_abbrev=bib.journal, 
journal_full=bib.journal_full, volume=bib.volume, issue=bib.number, 
page_first=bib.page_first, page_last=bib.page_last, year=bib.year)
 
         # Add the software info.
         cdp.exp_info.software_setup(name=SOFTWARE[software_keys[i]].name, 
version=versions[i], vendor_name=SOFTWARE[software_keys[i]].authors, 
url=SOFTWARE[software_keys[i]].url, cite_ids=cite_ids, 
tasks=SOFTWARE[software_keys[i]].tasks)




Related Messages


Powered by MHonArc, Updated Wed Feb 24 01:40:02 2010