Skip to content
Snippets Groups Projects
Commit 4053afe3 authored by Jakob Rien's avatar Jakob Rien
Browse files

Replace find_representative_transcripts.py

parent 55bd3a65
No related branches found
No related tags found
No related merge requests found
...@@ -191,10 +191,13 @@ def gtf_file_writer (original_file, output_file): ...@@ -191,10 +191,13 @@ def gtf_file_writer (original_file, output_file):
if type_ == 'gene': if type_ == 'gene':
gene_id = find_in_attributs(attributes, 'gene_id') gene_id = find_in_attributs(attributes, 'gene_id')
output.append(entry) output.append(entry)
if type_ != 'gene': else:
transcript_id = find_in_attributs(attributes, 'transcript_id') transcript_id = find_in_attributs(attributes, 'transcript_id')
if rep_transcript_dict[gene_id] == transcript_id: try:
output.append(entry) if rep_transcript_dict[gene_id] == transcript_id:
output.append(entry)
except:
print("error")
with open(output_file, 'w') as last_file: with open(output_file, 'w') as last_file:
last_file.write(output) last_file.write(output)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment