Skip to content

Commit 296dfcf

Browse files
Jon PalmerJon Palmer
Jon Palmer
authored and
Jon Palmer
committed
update
1 parent 86d4295 commit 296dfcf

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ if [ "$dep" = 'pass' ]; then
204204
fi
205205

206206
check='pass'
207-
for i in {blastp,hmmsearch,hmmscan,augustus,'gmes_petap.pl',mummer,nucmer,show-coords,exonerate,gmap,blat,RepeatModeler,RepeatMasker,pslCDnaFilter,bedtools,bamtools,'gag.py',tbl2asn,'braker.pl',funannotate,mafft,trimal,raxmlHPC-PTHREADS,tRNAscan-SE, 'rmOutToGFF3.pl'}; do
207+
for i in {blastp,hmmsearch,hmmscan,augustus,'gmes_petap.pl',mummer,nucmer,show-coords,exonerate,gmap,blat,RepeatModeler,RepeatMasker,pslCDnaFilter,bedtools,bamtools,'gag.py',tbl2asn,'braker.pl',funannotate,mafft,trimal,raxmlHPC-PTHREADS,tRNAscan-SE,'rmOutToGFF3.pl'}; do
208208
var=$(command -v $i)
209209
if [ "$var" ]; then
210210
echo "$i installed.........$var"

util/fgenesh2gff3.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,22 @@
3737
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'gene', genestart, genestop, '.', strand, '.', 'ID='+k+';'))
3838
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'mRNA', genestart, genestop, '.', strand, '.', 'ID='+k+'-T1;Parent='+k+';'))
3939
last_index = len(v)
40-
for i in range(0,last_index):
41-
start = v[i][0]
42-
stop = v[i][1]
43-
if i == 0: #first CDS, set phase to 0, calculate next phase
44-
phase = '0'
40+
phase = 0
41+
if strand == '+':
42+
for i in range(0,last_index):
43+
start = v[i][0]
44+
stop = v[i][1]
45+
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'exon', start, stop, '.', strand, '.', 'ID='+k+':exon'+str(i+1)+';Parent='+k+'-T1;'))
46+
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'CDS', start, stop, '.', strand, str(phase), 'ID=cds.'+k+';Parent='+k+'-T1;'))
4547
diff = int(stop) - int(start) + 1
4648
next_phase = (int(phase) - diff) % 3
47-
else:
48-
phase = next_phase
49+
phase = next_phase
50+
else:
51+
for i in reversed(range(0,last_index)):
52+
start = v[i][0]
53+
stop = v[i][1]
54+
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'exon', start, stop, '.', strand, '.', 'ID='+k+':exon'+str(i+1)+';Parent='+k+'-T1;'))
55+
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'CDS', start, stop, '.', strand, phase, 'ID=cds.'+k+';Parent='+k+'-T1;'))
4956
diff = int(stop) - int(start) + 1
5057
next_phase = (int(phase) - diff) % 3
51-
52-
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'exon', start, stop, '.', strand, '.', 'ID='+k+':exon'+str(i+1)+';Parent='+k+'-T1;'))
53-
sys.stdout.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (scaffold, 'FGENESH', 'CDS', start, stop, '.', strand, phase, 'ID=cds.'+k+';Parent='+k+'-T1;'))
58+
phase = next_phase

0 commit comments

Comments
 (0)