Changeset 23 for trunk/mzcms/models.py


Ignore:
Timestamp:
Aug 11, 2010, 4:03:54 PM (10 years ago)
Author:
j@…
bzr:base-revision:
j@dannynavarro.net-20100806085731-45ijibdj8w02ovi1
bzr:committer:
Danny Navarro <j@dannynavarro.net>
bzr:file-ids:

mzcms/models.py models.py-20100730084238-fjjwldiefr0w07zv-4
bzr:mapping-version:
v4
bzr:repository-uuid:
724254b2-fbe6-419d-9466-c04ef4c9d29d
bzr:revision-id:
j@dannynavarro.net-20100806091643-g521xmp8asz6sjpv
bzr:revno:
23
bzr:revprop:branch-nick:
trunk
bzr:root:
trunk
bzr:timestamp:
2010-08-06 11:16:43.279000044 +0200
bzr:user-agent:
bzr2.1.2+bzr-svn1.0.3
svn:original-date:
2010-08-06T09:16:43.279000Z
Message:

Creation of data folders directly from Experiment

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mzcms/models.py

    r22 r23  
    44class Experiment(Folder):
    55    __parent__ = __name__ = None
    6     super(Experiment, self).__init__()
     6    def __init__(self, proteins, peptides, spectra, psms):
     7        super(Experiment, self).__init__()
     8        self['proteins'] = Proteins(proteins)
     9        self['peptides'] = Peptides(peptides)
     10        self['spectra'] = Spectra(spectra)
     11        self['psms'] = Psms(psms)
    712
    813class Proteins(Folder):
    9     """A container for proteins objects"""
    10     def __init__(self):
     14    """Proteins folder factory"""
     15    def __init__(self, proteins):
    1116        self.name = 'proteins'
    1217
     
    1924
    2025class Peptides(Folder):
    21     """A container for peptides"""
     26    """Peptides folder factory"""
    2227    def __init__(self):
    2328        self.name = 'peptides'
     
    3136
    3237class Spectra(Folder):
    33     """A Container for spectra"""
     38    """Spectra folder factory"""
    3439    def __init__(self):
    3540        self.name = 'spectra'
     
    4651
    4752class Psms(Folder):
    48     """A container for psms"""
     53    """Psms folder factory"""
    4954    def __init__(self):
    5055        self.name = 'psms'
     
    6469def appmaker(zodb_root):
    6570    if not 'app_root' in zodb_root:
    66         app_root = Experiment()
     71        #        data = parse_results(files)
     72        #app_root = Experiment(data)
     73        zodb_root['app_root'] = app_root
    6774        import transaction
    6875        transaction.commit()
    69 #        folders = parse_results(files)
    70 #        for folder in folders:
    71 #            app_root[folder.name] = folder
    72 #        zodb_root['app_root'] = app_root
    7376
    7477    return zodb_root['app_root']
Note: See TracChangeset for help on using the changeset viewer.