From ae71c09199981004db8c870d198e8ce11b2e60f8 Mon Sep 17 00:00:00 2001 From: Oliver Schwengers Date: Wed, 6 Mar 2024 16:23:20 +0100 Subject: [PATCH] add parent ID to CRISPR repeat/spacer features in GFF3 outputs --- bakta/io/gff.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bakta/io/gff.py b/bakta/io/gff.py index 37e5d9c8..35fcef08 100644 --- a/bakta/io/gff.py +++ b/bakta/io/gff.py @@ -191,13 +191,15 @@ def write_gff3(genome: dict, features_by_contig: Dict[str, dict], gff3_path: Pat while i < len(feat['spacers']): repeat = feat['repeats'][i] annotations = { - 'ID': f"{feat['id']}_repeat_{i+1}" + 'ID': f"{feat['id']}_repeat_{i+1}", + 'Parent': feat['id'] } annotations = encode_annotations(annotations) fh.write(f"{feat['contig']}\tPILER-CR\t{bc.FEATURE_CRISPR_REPEAT}\t{repeat['start']}\t{repeat['stop']}\t.\t{repeat['strand']}\t.\t{annotations}\n") spacer = feat['spacers'][i] annotations = { 'ID': f"{feat['id']}_spacer_{i+1}", + 'Parent': feat['id'], 'sequence': spacer['sequence'] } annotations = encode_annotations(annotations)