- print "calculating background..."
- backgroundTrimValue = 1/20.
- backgroundRegionStats, backgroundRegionWeights = locateRegions(mockRDS, mockSampleSize, hitRDS, hitSampleSize,
- chromosome, useMulti, normalize, maxSpacing,
- doDirectionality, doTrim, minHits, minRatio,
- readlen, shiftValue, minPeak, minPlusRatio,
- maxPlusRatio, leftPlusRatio, listPeak, noMulti,
- doControl, factor, backgroundTrimValue)
-
- statistics["mIndex"] += backgroundRegionStats["index"]
- statistics["mTotal"] += backgroundRegionStats["total"]
- statistics["failed"] += backgroundRegionStats["failed"]
- print statistics["mIndex"], statistics["mTotal"]
- if doPvalue:
- if pValueType == "self":
- p, poissonmean = calculatePValue(allRegionWeights)
- else:
- p, poissonmean = calculatePValue(backgroundRegionWeights)
+ if mockRDS is not None:
+ print "calculating background..."
+ backgroundTrimValue = 1/20.
+ backgroundRegionStats, backgroundRegionWeights = locateRegions(mockRDS, mockSampleSize, hitRDS, hitSampleSize,
+ chromosome, useMulti, normalize, maxSpacing,
+ doDirectionality, doTrim, minHits, minRatio,
+ readlen, shiftValue, minPeak, minPlusRatio,
+ maxPlusRatio, leftPlusRatio, listPeak, noMulti,
+ doControl, factor, backgroundTrimValue)
+
+ statistics["mIndex"] += backgroundRegionStats["index"]
+ statistics["mTotal"] += backgroundRegionStats["total"]
+ statistics["failed"] += backgroundRegionStats["failed"]
+ print statistics["mIndex"], statistics["mTotal"]
+ if doPvalue:
+ if pValueType == "self":
+ p, poissonmean = calculatePValue(allRegionWeights)
+ else:
+ p, poissonmean = calculatePValue(backgroundRegionWeights)