src/scBONITA/classDefinitions.py
def find_pathways_from_gmt_LEGACY(self, gmtFile, minOverlap=4):
        """LEGACY CODE: find list of pathways with at least four genes found in data"""
        if not hasattr(self, cvGenes):
            print("You have not filtered the genes; are you sure you want to proceed?")
        self.pathwayGraphs = []
        if hasattr(self, "cvGenes"):
            pathwayGenes = set(self.cvGenes)
        else:
            if not hasattr(self, "cvGenes"):
                pathwayGenes = set(self.geneList)
        self.pathways = {}
        GMTdict = read_gmt(gmtFile)
        for key in GMTdict.keys():
            if (
                len(pathwayGenes.intersection(GMTdict[key])) >= minOverlap
            ):  # ensure there are at least minOverlap nodes in both pathway and detected genes
                print(key)
                self.pathways[key] = pathwayGenes.intersection(GMTdict[key])
                print(len(self.pathways[key]))
                # Get the KEGG network
                sif = makeSIF(key)
                pathGraph = sif_to_digraph(sif)
                self.pathwayGraphs.append(pathGraph)
LEGACY CODE: find list of pathways with at least four genes found in data
LEGACY CODE: find list of pathways with at least four genes found in data
LEGACY CODE : find list of pathways with at least four genes found in data
def find_pathways_from_gmt_LEGACY(self, gmtFile, minOverlap=4):
        if not hasattr(self, cvGenes):
            print("You have not filtered the genes; are you sure you want to proceed?")
        self.pathwayGraphs = []
        if hasattr(self, "cvGenes"):
            pathwayGenes = set(self.cvGenes)
        else:
            if not hasattr(self, "cvGenes"):
                pathwayGenes = set(self.geneList)
        self.pathways = {}
        GMTdict = read_gmt(gmtFile)
        for key in GMTdict.keys():
            if (
                len(pathwayGenes.intersection(GMTdict[key])) >= minOverlap
            ):  
                print(key)
                self.pathways[key] = pathwayGenes.intersection(GMTdict[key])
                print(len(self.pathways[key]))
                sif = makeSIF(key)
                pathGraph = sif_to_digraph(sif)
                self.pathwayGraphs.append(pathGraph)
def find_pathways_from_gmt_LEGACY ( self , gmtFile , minOverlap = 4 ) : if not hasattr ( self , cvGenes ) : print ( "You have not filtered the genes; are you sure you want to proceed?" ) self . pathwayGraphs = [ ] if hasattr ( self , "cvGenes" ) : pathwayGenes = set ( self . cvGenes ) else : if not hasattr ( self , "cvGenes" ) : pathwayGenes = set ( self . geneList ) self . pathways = { } GMTdict = read_gmt ( gmtFile ) for key in GMTdict . keys ( ) : if ( len ( pathwayGenes . intersection ( GMTdict [ key ] ) ) >= minOverlap ) : print ( key ) self . pathways [ key ] = pathwayGenes . intersection ( GMTdict [ key ] ) print ( len ( self . pathways [ key ] ) ) sif = makeSIF ( key ) pathGraph = sif_to_digraph ( sif ) self . pathwayGraphs . append ( pathGraph )
LEGACY CODE: find list of pathways with at least four genes found in data
LEGACY CODE : find list of pathways with at least four genes found in data
"""LEGACY CODE: find list of pathways with at least four genes found in data""" # ensure there are at least minOverlap nodes in both pathway and detected genes # Get the KEGG network
self
gmtFile
minOverlap