Changeset 56 for trunk/mzcms/models.py


Ignore:
Timestamp:
Aug 11, 2010, 4:13:29 PM (10 years ago)
Author:
j@…
bzr:base-revision:
j@dannynavarro.net-20100811081721-bl1459g8nbhl4e67
bzr:committer:
Danny Navarro <j@dannynavarro.net>
bzr:file-ids:

mzcms/models.py models.py-20100730084238-fjjwldiefr0w07zv-4
mzcms/parsers.py parsers.py-20100806092910-g1sxvv1o5b9umkof-1
bzr:mapping-version:
v4
bzr:repository-uuid:
724254b2-fbe6-419d-9466-c04ef4c9d29d
bzr:revision-id:
j@dannynavarro.net-20100811085044-aij4496kvr2j04x6
bzr:revno:
56
bzr:revprop:branch-nick:
trunk
bzr:root:
trunk
bzr:timestamp:
2010-08-11 10:50:44.831000090 +0200
bzr:user-agent:
bzr2.1.2+bzr-svn1.0.3
svn:original-date:
2010-08-11T08:50:44.831000Z
Message:

Added update method for proteins folder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mzcms/models.py

    r54 r56  
    1111    def __init__(self):
    1212        super(Experiment, self).__init__()
     13
     14class Proteins(Folder):
     15    """A protein container"""
     16    def update(self, protein_container):
     17        """Updates the protein container so that if the protein is
     18           already in the container only the peptide references are
     19           added.
     20        """
     21        for prot_id, prot in protein_container.items():
     22            if prot_id in self:
     23                self[prot_id].pep_refs.extend(prot.pep_refs)
     24            else:
     25                self[prot_id] = prot
     26
    1327
    1428class Protein(Persistent):
     
    4963    if not 'app_root' in zodb_root:
    5064        app_root = Experiment()
    51         proteins = Folder()
     65        proteins = Proteins()
    5266        peptides = Folder()
    5367        spectra = Folder()
     68        psms = Folder()
    5469        zodb_root['app_root'] = app_root
    5570        app_root['proteins'] = proteins
    5671        app_root['peptides'] = peptides
    5772        app_root['spectra'] = spectra
    58         psms = Folder()
    5973        app_root['psms'] = psms
    6074        folders = parse_dats('./dats',
Note: See TracChangeset for help on using the changeset viewer.