diff --git a/bakta/io/gff.py b/bakta/io/gff.py index 208ab4d..16f6393 100644 --- a/bakta/io/gff.py +++ b/bakta/io/gff.py @@ -169,7 +169,7 @@ def write_features(data: dict, features_by_sequence: Dict[str, dict], gff3_path: if(ba.RE_GENE_SYMBOL.fullmatch(feat['gene'])): # discard non-standard ncRNA gene symbols gene_annotations['gene'] = feat['gene'] else: - annotations.pop('gene') + annotations.pop('gene', None) if('truncated' in feat): gene_annotations[bc.INSDC_FEATURE_PSEUDO] = True gene_annotations = encode_annotations(gene_annotations) diff --git a/bakta/io/insdc.py b/bakta/io/insdc.py index 6af9dd3..836559f 100644 --- a/bakta/io/insdc.py +++ b/bakta/io/insdc.py @@ -263,7 +263,7 @@ def build_biopython_sequence_list(data: dict, features: Sequence[dict]): if(ba.RE_GENE_SYMBOL.fullmatch(feature['gene'])): # discard non-standard gene symbols gene_qualifier['gene'] = feature['gene'] else: - qualifiers.pop('gene') + qualifiers.pop('gene', None) else: qualifiers['gene'] = feature['gene'] gene_qualifier['gene'] = feature['gene']