comparison RepEnrich2.py @ 6:388a47ca4199 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/main/tools/repenrich2 commit a9af1284d644055565b6cf3401569694218ab8e9
author artbio
date Mon, 22 Apr 2024 10:31:50 +0000
parents 08e50af788f7
children 61e0404f0d76
comparison
equal deleted inserted replaced
5:08e50af788f7 6:388a47ca4199
195 familyfractionalcounts[repeat_ref[key]['family']] += value 195 familyfractionalcounts[repeat_ref[key]['family']] += value
196 196
197 # print class-, family- and fraction-repeats counts to files 197 # print class-, family- and fraction-repeats counts to files
198 with open("class_fraction_counts.tsv", 'w') as fout: 198 with open("class_fraction_counts.tsv", 'w') as fout:
199 for key in sorted(classfractionalcounts): 199 for key in sorted(classfractionalcounts):
200 fout.write(f"{key}\t{classfractionalcounts[key]}\n") 200 fout.write(f"{key}\t{round(classfractionalcounts[key], 2)}\n")
201 201
202 with open("family_fraction_counts.tsv", 'w') as fout: 202 with open("family_fraction_counts.tsv", 'w') as fout:
203 for key in sorted(familyfractionalcounts): 203 for key in sorted(familyfractionalcounts):
204 fout.write(f"{key}\t{familyfractionalcounts[key]}\n") 204 fout.write(f"{key}\t{round(familyfractionalcounts[key], 2)}\n")
205 205
206 with open("fraction_counts.tsv", 'w') as fout: 206 with open("fraction_counts.tsv", 'w') as fout:
207 for key in sorted(fractionalcounts): 207 for key in sorted(fractionalcounts):
208 fout.write(f"{key}\t{repeat_ref[key]['class']}\t" 208 fout.write(f"{key}\t{repeat_ref[key]['class']}\t"
209 f"{repeat_ref[key]['family']}\t" 209 f"{repeat_ref[key]['family']}\t"
210 f"{fractionalcounts[key]}\n") 210 f"{round(fractionalcounts[key], 2)}\n")