convert Trinotate resulte to GFF file
1
0
Entering edit mode
6.4 years ago

how i can convert Trinotate result to GFF file also how i can replace gene name in gff file by another annotation example thse is the GFF file

 MA_CS_1000      transdecoder    mRNA    1       3238    .       - ID=MA_CS_1000.p1;Parent=GENE.MA_CS_1000~~MA_CS_1000.p1;Name=ORF%20type%3Acomplete%20len%3A560%20%28-%29%2Cscore%3D45.62

and thise is the annotation file

   MA_CS_1000.p1 ,  Zinc finger C2H2-like

i want match those id to the Gff and change Gene_Name by colmne 2 in the Gff file any help !

desired output

MA_CS_1000      transdecoder    mRNA    1       3238    .       - ID=MA_CS_1000.p1;Parent=GENE.MA_CS_1000~~MA_CS_1000.p1;Name=Zinc%finger%C2H2-like
RNA-Seq bash Annotation • 3.0k views
ADD COMMENT
1
Entering edit mode

Hello Mostafa,

please rephrase your question. To me it looks like you're asking two things.

  1. How to convert Trinotate output to a GFF file
  2. How to replace a column in a GFF file based on informations in another file

It is very good to always provide an example of the input files and the desired output based on this examples.

In the examples you gave ,above I cannot see any overlap.

Regarding this note makes it much more probably to receive an answer in short time.

Thanks.

fin swimmer

ADD REPLY
0
Entering edit mode

Thanks fin for replay i have just two one tabulated and another is GFF i want replace anntoations in tab file to the GFF file by change the gene name

ADD REPLY
0
Entering edit mode

Hello Mostafa,

better but still many things that are unclear.

In the annotation file the values are comma seperated. Is there a whitespace before the first comma (this is important!)?

The first part in the annotation file (until the comma) should match the value of ID in the last column of your gff file? The value for Name in the last column should be replaced by anything that followed the ID in the annotation file? Why is the comma URL encoded but the whitespace not? Is it necessary?

fin swimmer

ADD REPLY
0
Entering edit mode

yes simply match the id and replace.

ADD REPLY
0
Entering edit mode

Please also answer the rest of my questions.

ADD REPLY
0
Entering edit mode

Thats it fin great jop thank you very much.

ADD REPLY
0
Entering edit mode

Please use the ADD REPLY Button to reply to a comment/answer. Answers are only meant for (full) answers to the original question. So I moved your post to a comment. As you can see this is not perfect.

Also note that I changed my command a little bit, to make sure that also line to which no changes where made are printed.

fin swimmer

ADD REPLY
0
Entering edit mode

second question is how to convert Trinotate.xls to gff do you have any idea.

ADD REPLY
0
Entering edit mode

Cite from this post:

Please use the ADD REPLY Button to reply to a comment/answer. Answers are only meant for (full) answers to the original question.

Cite from this post:

It is very good to always provide an example of the input files and the desired output based on this examples.

[...]

Regarding this note makes it much more probably to receive an answer in short time.

ADD REPLY
0
Entering edit mode

I'm personally not a fan of including these functional annotations in a GFF file format. GFF is messy enough as it is without adding all this data

ADD REPLY
3
Entering edit mode
6.4 years ago

Hello Mostafa,

you haven't answer my questions, so I had to make some guesses.

Input files:

$ cat annotation.txt
MA_CS_1000.p1,Zinc finger C2H2-like


$ cat input.gff
MA_CS_1000      transdecoder    mRNA    1       3238    .       - ID=MA_CS_1000.p1;Parent=GENE.MA_CS_1000~~MA_CS_1000.p1;Name=ORF%20type%3Acomplete%20len%3A560%20%28-%29%2Cscore%3D45.62

Command:

$  awk 'NR==FNR {split($0, ann,","); new[ann[1]]=ann[2]; next;} { match($0, /ID=([^;]+);/, id); if(id[1] in new) {gsub("Name=[^;]*", "Name="new[id[1]])} print}' > output.gff

Output:

$ cat output.gff
MA_CS_1000      transdecoder    mRNA    1       3238    .       - ID=MA_CS_1000.p1;Parent=GENE.MA_CS_1000~~MA_CS_1000.p1;Name=Zinc finger C2H2-like

fin swimmer

ADD COMMENT

Login before adding your answer.

Traffic: 2083 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6