From 89c4f17fc43a1dd69b391524866114de65b7c236 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 28 Nov 2015 16:11:14 +0100 Subject: [PATCH] Patch a bug on the generation of the location of tRNA for gene on reverse complement strand with an intron. Former-commit-id: 729905450d60c9b2e76ac73567b3efb09cb1bb86 Former-commit-id: 722dc77682ef3da8a746879c52072c46adb9de71 --- detectors/trna/lib/aragorn_wrapper.awk | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/detectors/trna/lib/aragorn_wrapper.awk b/detectors/trna/lib/aragorn_wrapper.awk index 83b6a48..90b9b2b 100755 --- a/detectors/trna/lib/aragorn_wrapper.awk +++ b/detectors/trna/lib/aragorn_wrapper.awk @@ -89,10 +89,16 @@ function gene2product(gene) { function emblTRNA(geneid,trna,loc,anti,intron,seq) { if (loc ~ /^c/) { + complement=1; + match(loc,",[0-9][0-9]*\\]"); + ge=substr(loc,RSTART,RLENGTH); + match(ge,"[0-9][0-9]*"); + ge=substr(ge,RSTART,RLENGTH); sub("c\\[","complement(",loc); sub("\\]",")",loc); sub(",","..",loc)} else { + complement=0; sub("\\[","",loc); sub("\\]","",loc); sub(",","..",loc)} @@ -105,11 +111,16 @@ function emblTRNA(geneid,trna,loc,anti,intron,seq) { l=length(intron); intron=substr(intron,2,l-2); split(intron,intronpos,","); - ib=intronpos[0]; - ie=intronpos[1]; + ib=intronpos[1]; + ie=intronpos[2]; match(loc,"[0-9][0-9]*"); gb=substr(loc,RSTART,RLENGTH); - sub("\\.\\.",".." (gb + ib -2) "," (gb + ie) "..",loc); \ + if (complement==0) { + sub("\\.\\.",".." (gb + ib - 2) "," (gb + ie) "..",loc); + } + else { + sub("\\.\\.",".." (ge - ie - 1) "," (ge - ib + 2) "..",loc); + } sub("complement","complement(join",loc);\ if (substr(loc,1,1) ~ /[0-9]/) { loc="join("loc}