Commit 733604a9 authored by Alexander, William's avatar Alexander, William
Browse files

Lines 218-221: added logic to remedy divide-by-zero woes

parent bf226fd9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -215,8 +215,10 @@ def motifCounter(methylSet: set, genomeDict : dict, motif: str, modCoord: int) -
                if i + revModCoord in methylSet:
                    methylSites.append(i + revModCoord)
                    methylHits += 1

    if totalSites:
        percentMeth = 100 * (methylHits / totalSites)
    else:
        percentMeth = 0
    return (methylHits, totalSites, "{:.2f}".format(percentMeth), methylSites)