Question: Python scripting for adding gene name into gff annotation file
1
gravatar for ahmed.elfarargi
3.2 years ago by
ahmed.elfarargi10 wrote:

I have a excel sheet and gff file and all I want to do is for each gene in the excel file match the same gene in gff file and any matches for each gene id in the first column and adding (Name=name) from the second column from excel file. I need a script to do it.

Excel sheet contains: two columns Gene ID and Name

gff file:

scf0000 merged gene 218802 221564 . - . ID=gene id

The output that I want is:

scf0000 merged gene 218802 221564 . - . Name=gene_name; ID=gene id

Thanks in advance

assembly sequence gene genome • 1.7k views
ADD COMMENTlink modified 8 months ago by wag0 • written 3.2 years ago by ahmed.elfarargi10
1

What have you tried? Although I like the language the most, why must it be python? And most people here are highly allergic to excel, so you're better off writing 'tab delimited file' before we start sneezing!

ADD REPLYlink written 3.2 years ago by WouterDeCoster41k

Thanks for your reply.

ADD REPLYlink written 3.2 years ago by ahmed.elfarargi10

And thanks for yours. Look, I could write what you need in about 5-10 minutes depending on my blood caffeine level, but with zero effort from your side I don't feel like it.

ADD REPLYlink modified 3.2 years ago • written 3.2 years ago by WouterDeCoster41k
1
gravatar for Newgene
3.2 years ago by
Newgene350
United States
Newgene350 wrote:

Getting gene symbol/name from a given gene id is fairly straightforward. One easy option is to use MyGene.info web API:

http://mygene.info/v3/gene/1017?fields=symbol,name

where 1017 is your gene id. It can also be done via mygene Python module:

https://pypi.python.org/pypi/mygene

I think you just need to figure out the parsing gff file part and add the matching gene_name into your output file.

ADD COMMENTlink written 3.2 years ago by Newgene350
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1390 users visited in the last hour