def searchExpressionLevelsInDb(self, rnaQuantId, featureIds=[], threshold=0.0, startIndex=0, maxResults=0): """ :param rnaQuantId: string restrict search by quantification id :param threshold: float minimum expression values to return :return an array of dictionaries, representing the returned data. """ sql = ("SELECT * FROM Expression WHERE " "rna_quantification_id = ? " "AND expression > ? ") sql_args = (rnaQuantId, threshold) if len(featureIds) > 0: sql += "AND feature_id in (" sql += ",".join(['?' for featureId in featureIds]) sql += ") " for featureId in featureIds: sql_args += (featureId, ) sql += sqlite_backend.limitsSql(startIndex=startIndex, maxResults=maxResults) query = self._dbconn.execute(sql, sql_args) return sqlite_backend.iterativeFetch(query)
def searchRnaQuantificationsInDb(self, rnaQuantificationId=""): """ :param rnaQuantificationId: string restrict search by id :return an array of dictionaries, representing the returned data. """ sql = ("SELECT * FROM RnaQuantification") sql_args = () if len(rnaQuantificationId) > 0: sql += " WHERE id = ? " sql_args += (rnaQuantificationId, ) query = self._dbconn.execute(sql, sql_args) try: return sqlite_backend.iterativeFetch(query) except AttributeError: raise exceptions.RnaQuantificationNotFoundException( rnaQuantificationId)
def searchRnaQuantificationsInDb( self, rnaQuantificationId=""): """ :param rnaQuantificationId: string restrict search by id :return an array of dictionaries, representing the returned data. """ sql = ("SELECT * FROM RnaQuantification") sql_args = () if len(rnaQuantificationId) > 0: sql += " WHERE id = ? " sql_args += (rnaQuantificationId,) query = self._dbconn.execute(sql, sql_args) try: return sqlite_backend.iterativeFetch(query) except AttributeError: raise exceptions.RnaQuantificationNotFoundException( rnaQuantificationId)
def searchExpressionLevelsInDb( self, rnaQuantId, featureIds=[], threshold=0.0, startIndex=0, maxResults=0): """ :param rnaQuantId: string restrict search by quantification id :param threshold: float minimum expression values to return :return an array of dictionaries, representing the returned data. """ sql = ("SELECT * FROM Expression WHERE " "rna_quantification_id = ? " "AND expression > ? ") sql_args = (rnaQuantId, threshold) if len(featureIds) > 0: sql += "AND feature_id in (" sql += ",".join(['?' for featureId in featureIds]) sql += ") " for featureId in featureIds: sql_args += (featureId,) sql += sqlite_backend.limitsSql( startIndex=startIndex, maxResults=maxResults) query = self._dbconn.execute(sql, sql_args) return sqlite_backend.iterativeFetch(query)
def iterativeFetchMethod(self): sql = self._readGroupSql query = self._dbconn.execute(sql) iterator = sqlite_backend.iterativeFetch(query, 2) return iterator