File: required_methods.lua

package info (click to toggle)
genometools 1.6.6%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 50,576 kB
  • sloc: ansic: 271,876; ruby: 29,930; python: 5,106; sh: 3,083; makefile: 1,213; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (27 lines) | stat: -rw-r--r-- 535 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function usage()
  io.stderr:write(string.format("Usage: %s <GFF annotation>\n" , arg[0]))
  os.exit(1)
end

if #arg < 1 then
  usage()
  os.exit(1)
end

f_stream = gt.custom_stream_new_unsorted()
f_stream.instream = gt.gff3_in_stream_new_sorted(arg[1])
function f_stream:next_tree()
  local node = self.instream:next_tree()
  if node then
    node:get_range()
    node:get_seqid()
    node:get_filename()
    node:get_line_number()
  end
  return node
end

local gn = f_stream:next_tree()
while (gn) do
  gn = f_stream:next_tree()
end