From e686d3771748f2c882423a29e66e87bd5c7a645e Mon Sep 17 00:00:00 2001 From: Petr Danecek Date: Wed, 11 Dec 2024 11:15:04 +0000 Subject: [PATCH] Extend transcript boundaries instead of skipping the transcript This modifies the commit d6cf97b17, it is better to include such transcript and modify their boundaries instead of omitting the transcripts entirely Resolves #2323 --- NEWS | 3 ++- gff.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 77cfd62a..149dc881 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,8 @@ Changes affecting specific commands: * bcftools csq - - Check the input GFF for features outside transcript boundaries (#2323) + - Check the input GFF for features outside transcript boundaries and extend the transcript + to contain the feature fully (#2323) * bcftools query diff --git a/gff.c b/gff.c index b3b01d01..a29a91c9 100644 --- a/gff.c +++ b/gff.c @@ -1017,9 +1017,9 @@ int gff_parse(gff_t *gff) if ( !gff->warned.ftr_out_of_bounds || gff->verbosity > 1 ) fprintf(stderr,"Warning: The GFF contains features outside the transcript boundaries .. %s\n",gff_id2string(gff,transcript,tr->id)); gff->warned.ftr_out_of_bounds++; - continue; + if ( ftr->beg < tr->beg ) tr->beg = ftr->beg; + if ( ftr->end > tr->end ) tr->end = ftr->end; } - tr->used = 1; tr->gene->used = 1;