Mercurial > repos > iuc > microsatbed
changeset 4:5f8efb080f49 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/microsatbed commit 891fc6321cd94c9a63c880d75989d79521f1a9b6
author | iuc |
---|---|
date | Sat, 14 Sep 2024 12:17:02 +0000 |
parents | 8c8299e553ec |
children | |
files | find_str.py microsatbed.xml test-data/dibed_indexed_sample test-data/dibed_wig_sample |
diffstat | 4 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/find_str.py Thu Sep 12 15:41:01 2024 +0000 +++ b/find_str.py Sat Sep 14 12:17:02 2024 +0000 @@ -7,6 +7,7 @@ """ Allows all STR or those for a subset of motifs to be written to a bed file Designed to build some of the microsatellite tracks from https://github.com/arangrhie/T2T-Polish/tree/master/pattern for the VGP. +Note that there are only four possible types of dinucleotide repeat, because CA = AC = GT = TG, GA = AG = CT = TC, AT = TA, and GC = CG. """ @@ -22,7 +23,7 @@ bin = int(b[1] / winwidth) d[bin] += nt bedg = [ - (name, (x * winwidth), ((x + 1) * winwidth) - 1, float(d[x])) + (name, (x * winwidth), ((x + 1) * winwidth), float(d[x])) for x in range(nwin + 1) if (x + 1) * winwidth <= chrlen ] @@ -82,13 +83,13 @@ cbed.append(row) if args.bigwig: w = getDensity(name, cbed, chrlen, args.winwidth) - wig += w - bed += cbed + wig.extend(w) + bed.extend(cbed) if args.bigwig: wig.sort() - bedg = ["%s %d %d %.2f" % x for x in wig] with open("temp.bedg", "w") as bw: - bw.write("\n".join(bedg)) + for row in wig: + bw.write("%s %d %d %.2f\n" % row) chroms = ["%s\t%s" % (x, chrlens[x]) for x in chrlens.keys()] with open("temp.chromlen", "w") as cl: cl.write("\n".join(chroms)) @@ -96,10 +97,9 @@ subprocess.run(cmd) else: bed.sort() - obed = ["%s\t%d\t%d\t%s_%d\t%d" % x for x in bed] with open(args.bed, "w") as outbed: - outbed.write("\n".join(obed)) - outbed.write("\n") + for row in bed: + outbed.write("%s\t%d\t%d\t%s_%d\t%d\n" % row) if __name__ == "__main__":
--- a/microsatbed.xml Thu Sep 12 15:41:01 2024 +0000 +++ b/microsatbed.xml Sat Sep 14 12:17:02 2024 +0000 @@ -3,7 +3,7 @@ <description>Short Tandem Repeats to bed features from fasta</description> <macros> <token name="@TOOL_VERSION@">1.3.3</token> - <token name="@VERSION_SUFFIX@">0</token> + <token name="@VERSION_SUFFIX@">1</token> <token name="@PYTHON_VERSION@">3.12.3</token> <macro name="subsetmacro"> <param name="subset" type="select" label="Select at least 1 specific motif length to report" @@ -217,9 +217,9 @@ <param name="tetramin" value="20"/> <param name="pentamin" value="20"/> <param name="hexamin" value="20"/> - <output name="bed" value="dibed_wig_sample" compare="sim_size" delta="10"> + <output name="bed" value="dibed_indexed_sample" compare="sim_size" delta="10"> <assert_contents> - <has_size value="73544" delta="10" /> + <has_size value="67559" delta="10" /> </assert_contents> </output> </test>