diff find_str.py @ 23:45f690db0eaf draft

planemo upload for repository https://github.com/fubar2/microsatbed commit d952bc313f408735456747c3d33e09a3170c8f59-dirty
author fubar
date Wed, 17 Jul 2024 23:19:12 +0000
parents 410144c7b2d6
children 94c5f834c0cc
line wrap: on
line diff
--- a/find_str.py	Wed Jul 17 22:41:41 2024 +0000
+++ b/find_str.py	Wed Jul 17 23:19:12 2024 +0000
@@ -11,14 +11,14 @@
 Designed to build some of the microsatellite tracks from https://github.com/arangrhie/T2T-Polish/tree/master/pattern for the VGP.
 """
 
-def getDensity(name, bed, len, winwidth):
-    nwin = int(len / winwidth)
+def getDensity(name, bed, chrlen, winwidth):
+    nwin = int(chrlen/winwidth)
     d = [0.0 for x in range(nwin+1)]
     for b in bed:
         nt = b[5]
         bin = int(b[1]/winwidth)
         d[bin] += nt
-    dw = [(name,x*winwidth,(x+1)*winwidth,float(d[x])) for x in range(nwin+1) if (x+1)*winwidth <= len]
+    dw = [(name,x*winwidth,(x+1)*winwidth,float(d[x])) for x in range(nwin+1) if (x+1)*winwidth <= chrlen]
     return dw
 
 def write_ssrs(args):