# HG changeset patch # User fubar # Date 1721431979 0 # Node ID efc775ab30fe4c4ead53dbec9b28b761fbfb1252 # Parent 4cb6cc083620fe4cd6e37142c3aeccc0a9877677 planemo upload for repository https://github.com/fubar2/microsatbed commit d952bc313f408735456747c3d33e09a3170c8f59-dirty diff -r 4cb6cc083620 -r efc775ab30fe dibed.bw Binary file dibed.bw has changed diff -r 4cb6cc083620 -r efc775ab30fe find_str.py --- a/find_str.py Fri Jul 19 22:32:44 2024 +0000 +++ b/find_str.py Fri Jul 19 23:32:59 2024 +0000 @@ -2,7 +2,6 @@ import shutil import subprocess -import pybigtools import pytrf # 1.3.0 from pyfastx import Fastx # 0.5.2 @@ -13,18 +12,22 @@ def getDensity(name, bed, chrlen, winwidth): + """ + pybigtools can write bigwigs and they are processed by other ucsc tools - but jb2 will not read them. + Swapped the conversion to use a bedgraph file processed by bedGraphToBigWig + """ 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 = [ + bedg = [ (name, (x * winwidth), ((x + 1) * winwidth) - 1, float(d[x])) for x in range(nwin + 1) if (x + 1) * winwidth <= chrlen ] - return dw + return bedg def write_ssrs(args): @@ -86,7 +89,6 @@ if args.bigwig: wig.sort() bedg = ['%s %d %d %.3f' % x for x in wig] - # bedg.insert(0,'track type=bedGraph') https://genomebrowser.wustl.edu/goldenPath/help/bigWig.html with open("temp.bedg", "w") as bw: bw.write('\n'.join(bedg)) chroms = ["%s\t%s" % (x, chrlens[x]) for x in chrlens.keys()] @@ -94,8 +96,6 @@ cl.write('\n'.join(chroms)) cmd = ["bedGraphToBigWig", "temp.bedg", "temp.chromlen", "temp.bw" ] subprocess.run(cmd) - #bw = pybigtools.open("temp.bw", "w") - #bw.write(chrlens, wig) shutil.move("temp.bw", args.bed) else: bed.sort() diff -r 4cb6cc083620 -r efc775ab30fe microsatbed.xml --- a/microsatbed.xml Fri Jul 19 22:32:44 2024 +0000 +++ b/microsatbed.xml Fri Jul 19 23:32:59 2024 +0000 @@ -1,10 +1,9 @@ - + Short Tandem Repeats to bed features from fasta python pyfastx pytrf - pybigtools ucsc-bedgraphtobigwig diff -r 4cb6cc083620 -r efc775ab30fe test.bw Binary file test.bw has changed