Which identifier do I have to use when I want to add a ##Fasta section to a gff? I have a gff file like this

scaffold_1  source  mRNA    2987526 2992430 .   -   .   ID=protein_id_68892;Name="foobar";locus_tag=my_organism_68892;translation=MHTGDALEGSTGNVSILV...
scaffold_1  source  exon    2987526 2987805 .   -   .   name "foobar"; transcriptId 68892;locus_tag=my_organism_68892
scaffold_1  source  CDS     2987526 2987805 .   -   1   name "foobar"; proteinId 68892; exonNumber 5;locus_tag=my_organism_68892;Parent=protein_id_68892
scaffold_1  source  exon    2988610 2988745 .   -   .   name "foobar"; transcriptId 68892;locus_tag=my_organism_68892
scaffold_1  source  CDS     2988610 2988745 .   -   2   name "foobar"; proteinId 68892; exonNumber 4;locus_tag=my_organism_68892;Parent=protein_id_68892
scaffold_1  source  exon    2989157 2989645 .   -   .   name "foobar"; transcriptId 68892;locus_tag=my_organism_68892
scaffold_1  source  CDS     2989157 2989645 .   -   2   name "foobar"; proteinId 68892; exonNumber 3;locus_tag=my_organism_68892;Parent=protein_id_68892
scaffold_1  source  exon    2990903 2991541 .   -   .   name "foobar"; transcriptId 68892;locus_tag=my_organism_68892
scaffold_1  source  CDS     2990903 2991541 .   -   2   name "foobar"; proteinId 68892; exonNumber 2;locus_tag=my_organism_68892;Parent=protein_id_68892
scaffold_1  source  exon    2991587 2992430 .   -   .   name "foobar"; transcriptId 68892;locus_tag=my_organism_68892
scaffold_1  source  CDS     2991587 2992430 .   -   0   name "foobar"; proteinId 68892; exonNumber 1;locus_tag=my_organism_68892;Parent=protein_id_68892


The mRNAentry was not present at first and I added it in. I also have the protein fast file available and would now like to add the amino acid sequences to the gff. I originally added them in column 9 to the mRNAentry which is apparently incorrect. Here it is written that the sequences should go at the end of the file in the ##Fastasection. However, I struggle to figure out which identifier I should use to link it to my mRNA entries.

Do I have to use

##Fasta
&gt;protein_id_68892
MHTGDALEGSTGNVSILV...


or does it work with the locus_tag

##Fasta
&gt;my_organism_68892
MHTGDALEGSTGNVSILV...


or is it something completely else? Where and how do can I add the translation information?

In the link above (and also in the comments it is suggested) the identifier in the first column is used, in my case that would be scaffold_1. However, I do have a lot of entries with scaffold_1in my file so a link between scaffold_1and an amino acid sequence would not be unique as I would have

##Fasta
&gt;scaffold_1
MHTGDALEGSTGNVSILV...
&gt;scaffold_1
GDAHTEGSTGNVSILV...


. In the end, I want to create a genbank file (which does not exist yet) where I can link a CDS to an amino acid sequence.
Unless I'm mistaken, the only variant of GFF that explicitly permits Fasta entries is GFF3, and the data you've shown above is definitely not valid GFF3. The mRNA entry seems to correctly use the = symbol to separate keys from values in each attribute, but the remaining columns all use spaces and quotation marks (GTF style) instead. This is likely to cause all kinds of problems with software packages that take GFF data as input.

But to more directly address your question, there is no "right" way to connect feature entries to sequence entries in a GFF3 file. There are some conventions, but these are all very specific to a small set of tools and community of practice, and it is rare that these conventions are objectively enforced. Some options include:


Placing genomic nucleotide sequences in the ##FASTA section, and then using feature coordinates to pull out mature mRNA sequences and translate them in silico to derive the corresponding peptide sequence. In this case, the Fasta entries would be genomic sequence identifiers that correspond to the first field/column in each feature entry.
Placing mature mRNA sequences in the ##FASTA section, and then directly translating this sequence to derive the corresponding peptide sequence. In this case, you'll want the sequence IDs in the ##FASTA section to match the ID attribute of the corresponding mRNA feature.
Placing the peptide sequences directly in the ##FASTA section. In this case, you would either want to have protein features declared in the GFF3 file (uncommon) or have some sort of protein_id attribute associated with each mRNA feature, in which case you'd want the sequence IDs in the ##FASTA section to match this protein_id attribute.


There are probably other ways of doing it, too. Which way is "right"? The GFF3 specification has nothing to say about it. It depends on the tools you are using to do the subsequent processing and analysis. If you're lucky, those tools might even document what they expect in terms of input.



Let me just say, as a post-script, that I think placing sequences and feature annotations in the same file is a horrible idea. I've never liked this about GFF3.