Mercurial > repos > fubar > microsatbed
diff find_str.py @ 25:8d0b8a75350f draft
planemo upload for repository https://github.com/fubar2/microsatbed commit d952bc313f408735456747c3d33e09a3170c8f59-dirty
author | fubar |
---|---|
date | Fri, 19 Jul 2024 06:41:18 +0000 |
parents | 94c5f834c0cc |
children | 26e9575c2c83 |
line wrap: on
line diff
--- a/find_str.py Fri Jul 19 05:20:35 2024 +0000 +++ b/find_str.py Fri Jul 19 06:41:18 2024 +0000 @@ -21,7 +21,7 @@ dw = [ (name, (x * winwidth)+1, (x + 1) * winwidth, float(d[x])) for x in range(nwin + 1) - if (x + 1) * winwidth <= chrlen + if (x + 1) * winwidth <= chrlen - 1 ] return dw @@ -42,6 +42,8 @@ specific = args.specific.upper().split(",") fa = Fastx(args.fasta, uppercase=True) for name, seq in fa: + chrlen = len(seq) + chrlens[name] = chrlen cbed = [] for ssr in pytrf.STRFinder( name, @@ -78,15 +80,12 @@ cbed.append(row) bed += cbed if args.bigwig: - chrlen = len(seq) - chrlens[name] = chrlen w = getDensity(name, cbed, chrlen, args.winwidth) wig += w if args.bigwig: wig.sort() bw = pybigtools.open("temp.bw", "w") bw.write(chrlens, wig) - bw.close() shutil.move("temp.bw", args.bed) else: bed.sort()