I have both StringTie (stringtie_merged.gtf.fasta.transdecoder.genome.gff3) and BRAKER2 (augustus.hints_utr.gff3) GFF3 files which I would like to intersect with bedtools. Whenever StringTie covers the genome region and BRAKER2 intersect them then I would like to remove BRAKER2 annotation. However, if BRAKER2 is the only in the region then I would like to keep it. Unfortunately, the following commands did not include the last condition as shown in this screenshot e.g. for
bedtools intersect -wa -a stringtie_merged.gtf.fasta.transdecoder.genome.gff3 -b augustus.hints_utr.gff3 > bedtools.gff3 perl gff3sort.pl --precise bedtools.gff3 > bedtools.gff3sort.gff
I tried also
gff3_sp_complement_annotations.pl from the GAAS package but it kept the BRAKER2 annotation despite overlapping with StringTie e.g.
g83533.t1 as shown in this screenshot. How it possible to remove BRAKER2 annotation when it is overlapping with StringTie?
What did I miss or is there a better tools to intersect GFF3 files?
Thank you in advance,