Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gene interval is short than CDS interval #896

Open
leon945945 opened this issue Dec 13, 2024 · 3 comments
Open

gene interval is short than CDS interval #896

leon945945 opened this issue Dec 13, 2024 · 3 comments

Comments

@leon945945
Copy link

Hi, I used barker3 to annotate my genome, and updated UTR region using GUSHR, but some genes interval are short than CDS interval after updating.

braker3 results:

h1tg000001l AUGUSTUS gene 165856 168762 . - . ID=g16;
h1tg000001l AUGUSTUS mRNA 165856 168762 1 - . ID=g16.t1;Parent=g16;
h1tg000001l AUGUSTUS stop_codon 165856 165858 . - 0 ID=g16.t1.stop1;Parent=g16.t1;
h1tg000001l AUGUSTUS CDS 165856 168762 1 - 0 ID=g16.t1.CDS1;Parent=g16.t1;
h1tg000001l AUGUSTUS exon 165856 168762 . - . ID=g16.t1.exon1;Parent=g16.t1;
h1tg000001l AUGUSTUS start_codon 168760 168762 . - 0 ID=g16.t1.start1;Parent=g16.t1;

GUSHR results:

h1tg000001l GUSHR gene 76535 165638 . - . ID=gene:g16;biotype=protein_coding;
h1tg000001l GUSHR mRNA 76535 165638 . - . ID=transcript:g16.t1;Parent=gene:g16;biotype=protein_coding;
h1tg000001l AnnotationFinalizer three_prime_utr 76521 76535 . - . Parent=transcript:g16.t1;
h1tg000001l AnnotationFinalizer three_prime_utr 165638 165855 . - . Parent=transcript:g16.t1;
h1tg000001l AUGUSTUS stop_codon 165856 165858 . - 0 Parent=transcript:g16.t1;
h1tg000001l AUGUSTUS CDS 165856 168762 1 - 0 Parent=transcript:g16.t1;
h1tg000001l AUGUSTUS start_codon 168760 168762 . - 0 Parent=transcript:g16.t1;
h1tg000001l AnnotationFinalizer five_prime_utr 168763 169190 . - . Parent=transcript:g16.t1;

I want to know how to fix the gff file. Thanks.

@KatharinaHoff
Copy link
Member

KatharinaHoff commented Dec 13, 2024 via email

@leon945945
Copy link
Author

Bad news :(

@leon945945
Copy link
Author

Hi, I wrote a simple python scripts to fix the gff

import pandas as pd
gff = pd.read_csv("GUSHR.gff3",sep="\t",header=None,names=["seqname","source","feature","start","end","score","strand","frame","attribute"])
flag = 0
allRows = []
for idx in gff.index:
        leng = gff.shape[0]
        i = leng - idx -1
        row = gff.iloc[i,:]
        if row["feature"] != "mRNA" and row["feature"] != "gene" and flag == 0:
                end = row["end"]
                flag += 1
        elif row["feature"] == "mRNA" or row["feature"] == "gene":
                start = pre["start"]
                row["start"] = start; row["end"] = end
                flag = 0
        pre = row
        allRows.insert(0,row)
newGff = pd.concat(allRows, axis=1).T
newGff.to_csv("GUSHR.gixed.gff",sep="\t",header=None,index=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants