This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to get CDS.fasta from gff file + sequenceFile.fasta

I have two files:

  1. An annotation file in gff format
  2. A fasta formatted sequnce file for a whole genome.

I want to have a resulting file : myGenomeCDS.fasta

How can I go about doing this via python or Tools ?

Thanks

sequence python gff annotation

2 answers

If your gtf file has the annotation of CDS's you can extract CDS sequences using gffread in this way:

gffread -g genome.fa -x CDS.fa annotation.gtf

There are so many ways to do this. If you don't want to write your own code, use the utilities from preexisiting packages such as BedTools (fastafrombed), Glimmer (extract) and even Galaxy as a tool (extract features).

Log in to answer this question.