Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added script to split outputs from augustus.

  • Loading branch information...
commit 73f3ec33400c4d45427e410d0647dd9179fd0dd7 1 parent 57769c5
@bl0b authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 extract_augustus_results.py
View
31 extract_augustus_results.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+from parse_gff3 import parse_gff3
+import fasta
+import sys
+
+if len(sys.argv) != 2:
+ print "Usage: %s gff_file"
+ sys.exit(0)
+
+inf = sys.argv[1]
+outdna = inf + '.dna.fas'
+outprot = inf + '.prot.fas'
+outgff = inf + '.gff3'
+
+g = parse_gff3(sys.argv[1])
+
+# First, extract DNA and protein fasta
+
+for seq, outf in (('protein_seq', outprot), ('coding_seq', outdna)):
+ f = fasta.Fasta()
+ for x in g:
+ f.add_seq(fasta.Sequence(x.name + ' ' + x[0].sequence_name,
+ getattr(x, seq)))
+ f.save_to(outf)
+
+# Now, output all GFF data.
+
+outf = open(outgff, 'w')
+print >> outf, "##gff-version\t3"
+for p in (p for x in g for p in x):
+ print >> outf, str(p)
Please sign in to comment.
Something went wrong with that request. Please try again.