+ selectQuery = string.join(selectClause, ",")
+
+ return selectQuery
+
+
+ def getReadGroupQuery(self, findallOptimize, limit, combine5p):
+ groupBy = []
+ if findallOptimize:
+ groupBy = ["GROUP BY start, sense"]
+
+ if limit > 0 and not combine5p:
+ groupBy.append("LIMIT %d" % limit)
+
+ groupQuery = string.join(groupBy)
+
+ return groupQuery
+
+
+ def getSplicesDict(self, noSense=False, fullChrom=False, chrom="",
+ flag="", withWeight=False, withFlag=False, withMismatch=False,
+ withID=False, withChrom=False, withPairID=False, readIDDict=False,
+ splitRead=False, hasMismatch=False, flagLike=False, start=-1,
+ stop=-1, strand=""):
+ """ returns a dictionary of spliced reads in a variety of
+ formats and which can be restricted by chromosome or custom-flag.
+ Returns unique spliced reads for now.
+ """
+ whereQuery = self.getReadWhereQuery(chrom, flag, flagLike, start, stop, hasMismatch, strand, splice=True)
+ selectClause = "select ID, chrom, startL, stopL, startR, stopR, readID"
+ selectQuery = self.getReadSelectQuery(selectClause, noSense, withWeight, withFlag, withMismatch)