Changeset 207


Ignore:
Timestamp:
Sep 8, 2009, 2:55:29 PM (11 years ago)
Author:
jjbot
Message:

First version of the I2D parser.

Location:
parsers
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • parsers/refseq2.py

    r173 r207  
    122122        # Find the types needed
    123123        uniq_types = unique(items[:,'type']()).tolist() # FIXME: should be changed to items[:,_.type]
    124         db_types = cd.term[_.name.within(uniq_types), (0, 2)]()
     124        db_types = self.cd.term[_.name.within(uniq_types), (0, 2)]()
    125125       
    126126        items_with_type = items.join(db_types, 'type', 'name')
  • parsers/uniprot2.py

    r196 r207  
    3333        )
    3434
    35     def flush(self, cd):
    36         # Create new dataset
     35    def flush_terms(self, cd):
     36        # Add fields as types
    3737        ds_id = flush_utils.resolveDataset(cd, 'Uniprot', '?')
    38 
    39         # Add fields as types
    4038        descs = [name + " mapping to UniProt." for name in _fields]
    4139        terms = table(zip(_fields, _fields, descs), ['name', 'identifier', 'description'])
     
    4442        term_ids = cd.term.extend(terms)
    4543        terms = term_ids %+ terms
     44   
     45
     46    def flush(self, cd):
     47        # Create new dataset
     48        ds_id = flush_utils.resolveDataset(cd, 'Uniprot', '?')
     49
     50        terms = cd.term[_.identifier.within(*_fields)]
    4651
    4752        # Collect item information and put into database
     
    5358        item_cont = item_ids %+ item_cont
    5459        self.item_cont = item_cont
     60
     61        # add items as their own synonym, these are a lot of items, we might
     62        # want to consider not doing this.
     63        item_syn = item_cont.fname(display_name="value")
     64        # FIXME: should find correct type
     65        cd.item_prop_accession.extend(item_syn)
    5566
    5667        # Collect accession information and flush to database
Note: See TracChangeset for help on using the changeset viewer.