Created
May 9, 2014 14:25
-
-
Save lexnederbragt/3689ee2301493c34c8ab to your computer and use it in GitHub Desktop.
Convert the latest TRF output, using the '-ngs' flag, to gff. Very rudimentary, use at your own risk.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open(fname) as fh: | |
for line in fh: | |
ele = line.strip().split(" ") | |
if line.startswith('@'): | |
seq_name = ele[0][1:] | |
else: | |
[start, stop, period, copies, | |
consensus_size, perc_match, perc_indels, | |
align_score, perc_A, perc_C, perc_G, perc_T, | |
entropy, cons_seq, repeat_seq, left_flank, right_flank] = ele | |
gff_line = [seq_name, 'TRF', cons_seq + '_' + copies + '_copies', | |
start, stop, '.', '.', '.', 'Name='+ cons_seq + '_' + copies + '_copies'] | |
print '\t'.join(gff_line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment