how to use fasta file to get gene id
I have a fasta file like this:
>PNT69813 cds chromosome:Brachypodium_distachyon_v3.0:2:509940:518687:-1 gene:BRADI_2g00840v3
ATGGGGACGTCGGTGCAGGTGACGCCGCTCAGCGGCGCGTACGGGGAGGGCCCCCTGTGC
TACCTGCTCGCGGTCGACGGGTTCCGCTTCCTCCTCGACTGCGGCTGGACCGACCACTGC
>KQJ91612 cds chromosome:Brachypodium_distachyon_v3.0:4:43426944:43435168:-1 gene:BRADI_4g38660v3 gene_biotype:protein_coding
ATGGGGACGTCGGTGCAGGTGACGCCGCTCAGCGGCGCGTACGGGGAGGGGCCCCTGTGC
TACCTGCTCGCGGTCGACGGGTTCCGCTTCCTCCTCGACTGCGGCTGGACCGACCACTGC
GACCCCTCCCTCCTCCAGCCCCTCGCCAGGGTTGCGCCAACAATAGATGCTGTTCTTCTG
how can I get result like this:
PNT69813
KQJ91612
Thank you!
• 327 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello LZH289!
We believe that this post does not fit the main topic of this site.
Please invest some effort, OP. This is a simple and straightforward task. Also, please don't cross-post on multiple sites: https://bioinformatics.stackexchange.com/questions/13040/get-all-gene-id-in-fasta-file
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!
thank you for your reply. Firstly, it is my third day to use biostars.org, when I post first question I couldn't get answer in this web, but I got answer from another community. So I hope more people can see my question and help me to solve this problem. So I post again in here. I don't know this two website are same, sorry! Secondly, I try before when I post this question. I used grep before, it can use gene id then to extract gene sequence. But I don't know how to use a fasta file to get output file only contain gene 1, gene 2, gene123 and so on. If you don't mind, can you give me some guidances? The gene id doesn't in the same length.
thank you!
What exactly did you try using
grep?grep '>.*cds' ori.fa >output.txt