comparison 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
comparison
equal deleted inserted replaced
22:b5acf60b903d 23:45f690db0eaf
9 """ 9 """
10 Allows all STR or those for a subset of motifs to be written to a bed file 10 Allows all STR or those for a subset of motifs to be written to a bed file
11 Designed to build some of the microsatellite tracks from https://github.com/arangrhie/T2T-Polish/tree/master/pattern for the VGP. 11 Designed to build some of the microsatellite tracks from https://github.com/arangrhie/T2T-Polish/tree/master/pattern for the VGP.
12 """ 12 """
13 13
14 def getDensity(name, bed, len, winwidth): 14 def getDensity(name, bed, chrlen, winwidth):
15 nwin = int(len / winwidth) 15 nwin = int(chrlen/winwidth)
16 d = [0.0 for x in range(nwin+1)] 16 d = [0.0 for x in range(nwin+1)]
17 for b in bed: 17 for b in bed:
18 nt = b[5] 18 nt = b[5]
19 bin = int(b[1]/winwidth) 19 bin = int(b[1]/winwidth)
20 d[bin] += nt 20 d[bin] += nt
21 dw = [(name,x*winwidth,(x+1)*winwidth,float(d[x])) for x in range(nwin+1) if (x+1)*winwidth <= len] 21 dw = [(name,x*winwidth,(x+1)*winwidth,float(d[x])) for x in range(nwin+1) if (x+1)*winwidth <= chrlen]
22 return dw 22 return dw
23 23
24 def write_ssrs(args): 24 def write_ssrs(args):
25 """ 25 """
26 The integers in the call change the minimum repeats for mono-, di-, tri-, tetra-, penta-, hexa-nucleotide repeats 26 The integers in the call change the minimum repeats for mono-, di-, tri-, tetra-, penta-, hexa-nucleotide repeats