Mercurial > repos > fubar > microsatbed
comparison find_str.py @ 30:53c4f91c6031 draft default tip
planemo upload for repository https://github.com/fubar2/microsatbed commit 80a8c0db54b6e2cab9dfe7178b1e5b3b39592f2c
| author | fubar |
|---|---|
| date | Sat, 20 Jul 2024 01:44:09 +0000 |
| parents | efc775ab30fe |
| children |
comparison
equal
deleted
inserted
replaced
| 29:efc775ab30fe | 30:53c4f91c6031 |
|---|---|
| 86 w = getDensity(name, cbed, chrlen, args.winwidth) | 86 w = getDensity(name, cbed, chrlen, args.winwidth) |
| 87 wig += w | 87 wig += w |
| 88 bed += cbed | 88 bed += cbed |
| 89 if args.bigwig: | 89 if args.bigwig: |
| 90 wig.sort() | 90 wig.sort() |
| 91 bedg = ['%s %d %d %.3f' % x for x in wig] | 91 bedg = ["%s %d %d %.3f" % x for x in wig] |
| 92 with open("temp.bedg", "w") as bw: | 92 with open("temp.bedg", "w") as bw: |
| 93 bw.write('\n'.join(bedg)) | 93 bw.write("\n".join(bedg)) |
| 94 chroms = ["%s\t%s" % (x, chrlens[x]) for x in chrlens.keys()] | 94 chroms = ["%s\t%s" % (x, chrlens[x]) for x in chrlens.keys()] |
| 95 with open("temp.chromlen", "w") as cl: | 95 with open("temp.chromlen", "w") as cl: |
| 96 cl.write('\n'.join(chroms)) | 96 cl.write("\n".join(chroms)) |
| 97 cmd = ["bedGraphToBigWig", "temp.bedg", "temp.chromlen", "temp.bw" ] | 97 cmd = ["bedGraphToBigWig", "temp.bedg", "temp.chromlen", "temp.bw"] |
| 98 subprocess.run(cmd) | 98 subprocess.run(cmd) |
| 99 shutil.move("temp.bw", args.bed) | 99 shutil.move("temp.bw", args.bed) |
| 100 else: | 100 else: |
| 101 bed.sort() | 101 bed.sort() |
| 102 obed = ["%s\t%d\t%d\t%s_%d\t%d" % x for x in bed] | 102 obed = ["%s\t%d\t%d\t%s_%d\t%d" % x for x in bed] |
