def getCorrPvArrayForGeneSymbolPair(self,geneNameLst=None): corrArray = None pvArray = None if len(geneNameLst) == 2: #retrieve SymbolValuePairDict(Dict), dictionary of Symbol and Value Pair.key is symbol, value is one list of expression values of one probeSet symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict =correlationFunction.getTissueProbeSetXRefInfo(cursor=self.cursor,GeneNameLst=geneNameLst,TissueProbeSetFreezeId=self.tProbeSetFreezeId) symbolValuepairDict =correlationFunction.getGeneSymbolTissueValueDict(cursor=self.cursor,symbolList=geneNameLst,dataIdDict=dataIdDict) corrArray,pvArray = correlationFunction.getCorrPvArray(cursor=self.cursor,priGeneSymbolList=geneNameLst,symbolValuepairDict=symbolValuepairDict) return corrArray,pvArray
def getTissueLabelsValues(self, X_geneSymbol=None, Y_geneSymbol=None, TissueProbeSetFreezeId=None ): dataX = [] dataY = [] data_fullLabel = [] data_shortLabel = [] # updated by NL, 2011-01-11 using new function getTissueProbeSetXRefInfo to get dataId value X_symbolList,X_geneIdDict,X_dataIdDict,X_ChrDict,X_MbDict,X_descDict,X_pTargetDescDict = correlationFunction.getTissueProbeSetXRefInfo(cursor=self.cursor,GeneNameLst=[X_geneSymbol],TissueProbeSetFreezeId=TissueProbeSetFreezeId) Y_symbolList,Y_geneIdDict,Y_dataIdDict,Y_ChrDict,Y_MbDict,Y_descDict,Y_pTargetDescDict = correlationFunction.getTissueProbeSetXRefInfo(cursor=self.cursor,GeneNameLst=[Y_geneSymbol],TissueProbeSetFreezeId=TissueProbeSetFreezeId) # in dataIdDict, key is the lower cased geneSymbol X_DataId = X_dataIdDict[X_geneSymbol.lower()] Y_DataId = Y_dataIdDict[Y_geneSymbol.lower()] self.cursor.execute("SELECT TissueID,value FROM TissueProbeSetData WHERE Id = %d ORDER BY TissueID" % int(X_DataId) ) results = self.cursor.fetchall() for item in results: TissueID, Value = item dataX.append(Value) self.cursor.execute("SELECT Tissue.Name, Tissue.Short_Name FROM Tissue WHERE Id = %d" % int(TissueID) ) temp = self.cursor.fetchone() data_fullLabel.append( temp[0] ) data_shortLabel.append( temp[1] ) self.cursor.execute("SELECT TissueID,value FROM TissueProbeSetData WHERE Id = %d ORDER BY TissueID" % int(Y_DataId) ) results = self.cursor.fetchall() for item in results: TissueID, Value = item dataY.append(Value) X_label = "%s" % X_geneSymbol Y_label = "%s" % Y_geneSymbol return dataX, dataY, X_label, Y_label, data_shortLabel, data_fullLabel
def getTissueProbeSetXRefInfo(self,GeneNameLst=[]): symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict =correlationFunction.getTissueProbeSetXRefInfo(cursor=self.cursor,GeneNameLst=GeneNameLst,TissueProbeSetFreezeId=self.tProbeSetFreezeId) return symbolList,geneIdDict,dataIdDict,ChrDict,MbDict,descDict,pTargetDescDict