Skip to content

Commit

Permalink
add parent ID to CRISPR repeat/spacer features in GFF3 outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwengers committed Mar 6, 2024
1 parent 4e3b80e commit ae71c09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bakta/io/gff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ae71c09

Please sign in to comment.