I have a text file with a list of name of genes (alias names) like this (**
added for emphasis):
Solyc00g019980
**Solyc01g005020**
..
.
And i have a gff file like this:
SL4.0ch01 maker_ITAG gene 46201 59605 . - . ID=gene:Solyc01g005020.3;Alias=**Solyc01g005020**;Name=Solyc01g005020.3;length=13404
SL4.0ch01 maker_ITAG mRNA 46201 59605 . - . ID=mRNA:Solyc01g005020.3.1;Parent=gene:Solyc01g005020.3;Name=Solyc01g005020.3.1;Note=Salt Overly Sensitive 1;_AED=0.25;_QI=241|1|1|1|0|0|23|311|1151;_eAED=0.25;**Ontology_term=GO:0006812,GO:0015299,GO:0016021,GO:0055085**
SL4.0ch01 maker_ITAG three_prime_UTR 46201 46511 . - . ID=three_prime_UTR:Solyc01g005020.3.1.0;Parent=mRNA:Solyc01g005020.3.1
SL4.0ch01 maker_ITAG exon 46201 46844 . - . ID=exon:Solyc01g005020.3.1.1;Parent=mRNA:Solyc01g005020.3.1
SL4.0ch01 maker_ITAG CDS 46512 46844 . - 0 ID=CDS:Solyc01g005020.3.1.1;Parent=mRNA:Solyc01g005020.3.1
SL4.0ch01 maker_ITAG exon 47281 47585 . - . ID=exon:Solyc01g005020.3.1.2;Parent=mRNA:Solyc01g005020.3.1
SL4.0ch01 maker_ITAG CDS 47281 47585 . - 2 ID=CDS:Solyc01g005020.3.1.2;Parent=mRNA:Solyc01g005020.3.1
SL4.0ch01 maker_ITAG exon 48276 48543 . - . ID=exon:Solyc01g005020.3.1.3;Parent=mRNA:Solyc01g005020.3.1
I would like to grab only the ones i have in my list gene text file (Alias names) and the corresponding "Ontology_term" next to it.
Terminal is more convenient if there is a solution like grep or something.
Thanks in advance
edit: i would like to get this output, as an example
Solyc01g005070 Ontology_term=GO:0005543
Solyc01g005230 Ontology_term=GO:0008168
i dont mind if this is included "Ontology_term=", i would prefer not to be included though
thanks again
grep -f list.txt data.gff
doesn't work for me, because it grabs all the other as well.
Solyc01g005070
andSolyc01g005230
are not referred anywhere in yourgff
example. Thus, it's hard to relate exactly what you want exactly $\endgroup$