development release: conversion of ReadDataset to use BAM files
[erange.git] / commoncode.py
index 6ef4edfcb3e10d75ae0eecea887f45581f9e4edb..cd449620f0fc88304f4e8adceee0e96e37e1295d 100755 (executable)
@@ -192,6 +192,7 @@ def getMergedRegionsFromList(regionList, maxDist=1000, minHits=0, verbose=False,
     #      the case of 3 regions ABC that are in the input file as ACB as it goes now when processing C there
     #      will be no merge with A as B is needed to bridge the two.  When it comes time to process B it will
     #      be merged with A but that will exit the loop and the merge with C will be missed.
+    #TODO: QForAli - Are we going to require sorted region files to have this even work?
     for regionEntry in regionList:
         if regionEntry[0] == "#":
             if "pvalue" in regionEntry:
@@ -340,6 +341,10 @@ def findPeak(hitList, start, length, readlen=25, doWeight=False, leftPlus=False,
 
     # implementing a triangular smooth
     smoothArray = array("f", [0.] * length)
+    #TODO: QForAli - really?  We're going to insert MANUFACTURED data (0.0's) and use them in the calculation
+    # (probably) just to avoid IndexError exceptions.  Then we are going to completely ignore adjusting the
+    # last 2 elements of the array for (probably) the same issue.  Is this how erange is dealing with the
+    # edge cases?
     for pos in range(2,length -2):
         smoothArray[pos] = (seqArray[pos -2] + 2 * seqArray[pos - 1] + 3 * seqArray[pos] + 2 * seqArray[pos + 1] + seqArray[pos + 2]) / 9.0