I'm usually amazed by the elegant awk solutions you offer, but today you took this a step too far o.O
Construct a gene arrow map to show the gene features
Hello,
I want to generate a gene arrow map showing all the details like gene features, annotation etc. I have the data in the following format:
start stop strand function
208 885 + Chromosomal replication initiator protein DnaA
1576 1157 - FIG00958722: hypothetical protein
2174 1578 - Flavoprotein WrbA
2524 2171 - Arsenate reductase (EC 1.20.4.1)
2649 3884 + Inner membrane protein YihY, formerly thought to be RNase BN
4034 4228 + FIG00956556: hypothetical protein
Please let me know about any software that can convert the above mentioned information to well formatted gene arrow map.
Thanks
• 3,847 views
•
link
2 answers
using awk :-D
awk -F '\t ' -v chromStart=208.0 -v chromEnd=4228.0 '/^start/{next;} {L=60.0;x1=L*(int($1)-chromStart)/(chromEnd-chromStart);x2=L*(int($2)-chromStart)/(chromEnd-chromStart);if(x1>x2) { t=x1;x1=x2;x2=t;} for(i=0;i<L;++i) {c=" ";if(i>=int(x1) && i<=int(x2)) { c=$3=="+"?">":"<" } ; printf("%c",c);}printf(" %s\n",$4);}' input.tsv
>>>>>>>>>>> Chromosomal replication initiator protein DnaA
<<<<<<< FIG00958722: hypothetical protein
<<<<<<<<<< Flavoprotein WrbA
<<<<<< Arsenate reductase (EC 1.20.4.1)
>>>>>>>>>>>>>>>>>>> Inner membrane protein YihY, formerly thought to be RNase BN
>>> FIG00956556: hypothetical protein
else see
• 0 views
•
link
• 0 views
•
link
he is a master at these , he always amazes me. I have learnt a lot from his blogs and posts here to be honest. Take a bow @Pierre
• 0 views
•
link
Log in to answer this question.
