From 738563494819b611b64f68514137715441fb095b Mon Sep 17 00:00:00 2001 From: jvolkening Date: Sat, 27 May 2023 17:33:24 -0500 Subject: [PATCH] skip empty annotations --- gene_model/collapse_annotation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gene_model/collapse_annotation.py b/gene_model/collapse_annotation.py index c51ae239..e9afadb7 100644 --- a/gene_model/collapse_annotation.py +++ b/gene_model/collapse_annotation.py @@ -63,6 +63,8 @@ def __init__(self, gtfpath): attributes = defaultdict(list) for a in row[8].replace('"', '').replace('_biotype', '_type').split(';')[:-1]: kv = a.strip().split(' ') + if len(kv) < 2: + continue if kv[0]!='tag': attributes[kv[0]] = kv[1] else: