X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=erange.git;a=blobdiff_plain;f=commoncode.py;fp=commoncode.py;h=cd449620f0fc88304f4e8adceee0e96e37e1295d;hp=6ef4edfcb3e10d75ae0eecea887f45581f9e4edb;hb=cfc5602b26323ad2365295145e3f6c622d912eb4;hpb=c4561c55cfa9726530c6777b6515c4ef66306b2f diff --git a/commoncode.py b/commoncode.py index 6ef4edf..cd44962 100755 --- a/commoncode.py +++ b/commoncode.py @@ -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