File: rf2of.rb

package info (click to toggle)
genometools 1.6.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 50,412 kB
  • sloc: ansic: 271,241; ruby: 30,339; python: 4,880; sh: 3,193; makefile: 1,194; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (17 lines) | stat: -rwxr-xr-x 368 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env ruby

STDIN.each do |line|
  if not line.match(/^#/)
    a = line.split(/ /)
    len1 = a[0].to_i
    start1 = a[2].to_i
    len2 = a[4].to_i
    start2 = a[6].to_i
    if len1 < len2
      weight = 3 * len1 - len2
    else 
      weight = 3 * len2 - len1
    end
    puts "#{start1}\t#{start1+len1-1}\t#{start2}\t#{start2+len2-1}\t#{weight}"
  end
end