Changeset 1514:912706a3f472 in orange-bioinformatics


Ignore:
Timestamp:
11/24/11 19:40:48 (2 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
23ce017bc13a9ce5f4c062ab1d1b36c1337b6cf5
Message:

Renamed STRINGNonCommercial to STRINGDetailed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • obiPPI.py

    r1512 r1514  
    869869         
    870870 
    871 STRINGNonCommercialInteraction = namedtuple("STRINGNonCommercialInteraction", 
     871STRINGDetailedInteraction = namedtuple("STRINGDetailedInteraction", 
    872872        ["protein_id1", "protein_id2", "combined_score", "mode", 
    873873         "action", "score", "neighborhood", "fusion", "cooccurence",  
     
    875875         ]) 
    876876 
    877 class STRINGNonCommercial(STRING): 
    878     """ The Creative Commons Attribution-Noncommercial-Share  
    879     Alike licensed part of STRING. 
    880      
     877class STRINGDetailed(STRING): 
     878    """  Access `STRING <http://www.string-db.org/>`_ PPI database. 
     879    This class also allows access to subscores per channel. 
     880     
     881    .. note:: This data is released under a  
     882        `Creative Commons Attribution-Noncommercial-Share Alike 3.0 License <http://creativecommons.org/licenses/by-nc-sa/3.0/>`_. 
     883        If you want to use this data for commercial purpuses  
     884        you must get a license from STRING. 
    881885     
    882886    """ 
     
    898902         
    899903    """ 
    900     FILENAME_NC = "string-protein-NC.sqlite" 
     904    FILENAME_DETAILED = "string-protein-detailed.sqlite" 
    901905     
    902906    def __init__(self): 
    903907        STRING.__init__(self) 
    904         db_nc_file = orngServerFiles.localpath(self.DOMAIN, self.FILENAME_NC) 
    905908        db_file = orngServerFiles.localpath(self.DOMAIN, self.FILENAME) 
    906         self.db_nc = sqlite3.connect(db_nc_file) 
    907         self.db_nc.execute("ATTACH DATABASE ? as string", (db_file,)) 
     909        db_detailed_file = orngServerFiles.localpath_download(self.DOMAIN, self.FILENAME_DETAILED) 
     910        self.db_detailed = sqlite3.connect(db_detailed_file) 
     911        self.db_detailed.execute("ATTACH DATABASE ? as string", (db_file,)) 
    908912         
    909913    def edges_annotated(self, id): 
     
    914918        for edge in edges: 
    915919            id1, id2 = edge.protein_id1, edge.protein_id2 
    916             cur = self.db_nc.execute("""\ 
     920            cur = self.db_detailed.execute("""\ 
    917921                SELECT neighborhood, fusion, cooccurence, coexpression, 
    918922                       experimental, database, textmining 
     
    926930                evidence = [0] * 7 
    927931            edges_nc.append( 
    928                 STRINGNonCommercialInteraction(*(tuple(edge) + tuple(evidence))) 
     932                STRINGDetailedInteraction(*(tuple(edge) + tuple(evidence))) 
    929933            ) 
    930934        return edges_nc 
     
    969973        links_file = open(links_filename, "rb") 
    970974         
    971         con = sqlite3.connect(os.path.join(dir, cls.FILENAME_NC)) 
     975        con = sqlite3.connect(os.path.join(dir, cls.FILENAME_DETAILED)) 
    972976        with con: 
    973977            con.execute("""\ 
Note: See TracChangeset for help on using the changeset viewer.