Changeset 1210:b85a856cc161 in orange-bioinformatics


Ignore:
Timestamp:
09/21/10 09:11:55 (4 years ago)
Author:
markotoplak
Branch:
default
Convert:
c16716ac1952059c81da8c3f0080ffc1dacfa32a
Message:

PIPA: widget now shows local availability of raw chips. script fixed for new column names.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • obiDicty.py

    r1208 r1210  
    178178                return httpGet(self.address + request, data=urllib.urlencode(data)) 
    179179        except IOError: 
    180             return self.raw(request, tryN=tryN-1) 
     180            return self.raw(request, data=data, tryN=tryN-1) 
    181181 
    182182    def get(self, request, data=None, tryN=3): 
     
    519519def bufferkeypipa(command, data): 
    520520    """ Do not save password to the buffer! """ 
    521     command = command + " v3" #add version 
     521    command = command + " v4" #add version 
    522522    if data != None: 
    523523        data = data.copy() 
     
    556556        data = { "genome": genome_id } 
    557557        res, legend = self.sq("geneinfo_get", data=self.add_auth(data), reload=reload, bufferkey=bufferkeypipa) 
    558         newlegend = ["gene", "len"] 
     558        newlegend = ["gene", "length"] 
    559559        return onlyColumns(res, legend, newlegend), newlegend 
    560560 
     
    563563        data = { "genome": genome_id } 
    564564        res, legend = self.sq("geneinfo_get", data=self.add_auth(data), reload=reload, bufferkey=bufferkeypipa) 
    565         newlegend = ["gene", "map35"] 
     565        newlegend = ["gene", "mapability_factor"] 
    566566        return onlyColumns(res, legend, newlegend), newlegend 
    567567 
     
    601601    def chips_keynaming(self): 
    602602        keynamingfn,_ = self.downloadMulti_bufcommand_replace_multi("download_expression", data=self.add_auth({"ids":"$MULTI$"}), chunk=100, bufferkey=bufferkeypipa, transformfn=None) 
     603        return keynamingfn 
     604 
     605    def chips_keynaming_raw(self): 
     606        keynamingfn,_ = self.downloadMulti_bufcommand_replace_multi("download_raw_expression", data=self.add_auth({"ids":"$MULTI$"}), chunk=100, bufferkey=bufferkeypipa, transformfn=None) 
    603607        return keynamingfn 
    604608 
     
    15571561 
    15581562    #data = d.get_data(ids=allids) 
    1559     data = d.get_data(ids=allids, transform=lambda x: math.log(x+1, 2), allowed_labels=["strain"]) 
     1563    data = d.get_data(ids=allids, transform=lambda x: math.log(x+1, 2), allowed_labels=["strain"], map_lengths=True, raw=True, map_map35=True) 
    15601564    #data = orange.ExampleTable(data.domain, data[:1]) 
    15611565    printet(data) 
  • widgets/OWPIPA.py

    r1208 r1210  
    55<priority>30</priority> 
    66""" 
    7  
    8 #FIXME Availability is not valid for raw expressions. 
    97 
    108from OWWidget import * 
     
    5755    pass 
    5856bufferfile = os.path.join(bufferpath, "database.sq3") 
    59  
    60 CACHED_COLOR = Qt.darkGreen 
    6157 
    6258class ListItemDelegate(QStyledItemDelegate): 
     
    438434        OWGUI.checkBox(self.controlArea, self, "joinreplicates", "Average replicates (use median)" ) 
    439435        OWGUI.checkBox(self.controlArea, self, "log2", "Logarithmic (base 2) transformation" ) 
    440         OWGUI.checkBox(self.controlArea, self, "raw", "Download Raw Expressions" ) 
     436        OWGUI.checkBox(self.controlArea, self, "raw", "Download Raw Expressions", callback=self.UpdateCached) 
    441437        OWGUI.checkBox(self.controlArea, self, "lenandmap35", "Add length and mapability info" ) 
    442438 
     
    609605    def UpdateCached(self): 
    610606        if self.wantbufver and self.dbc: 
    611             fn = self.dbc.chips_keynaming() 
     607            fn = self.dbc.chips_keynaming() if not self.raw else self.dbc.chips_keynaming_raw() 
    612608            for item in self.items: 
    613609                c = str(item.text(9)) 
    614610                item.setData(0, Qt.DisplayRole, QVariant(" " if self.dbc.inBuffer(fn(c)) == self.wantbufver(c) else "")) 
    615 #                color = Qt.black 
    616 #                if self.dbc.inBuffer(fn(c)) == self.wantbufver(c): 
    617 #                    color = CACHED_COLOR 
    618 #                brush = QBrush(color) 
    619 #                for i in range(item.columnCount()): 
    620 #                    item.setForeground(i, brush) 
    621611 
    622612    def SearchUpdate(self, string=""): 
     
    703693##    from pywin.debugger import set_trace 
    704694##    set_trace() 
     695    #obiDicty.verbose = True 
    705696    w = OWPIPA() 
    706697    w.show() 
Note: See TracChangeset for help on using the changeset viewer.