-
Notifications
You must be signed in to change notification settings - Fork 4
/
read_stats_multi_mappers.rb
72 lines (68 loc) · 1.74 KB
/
read_stats_multi_mappers.rb
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
###
#
# IN:
# [hayer@consign aligner_benchmark]$ ls */comp_res_multi_mappers.txt
# gsnap/comp_res_multi_mappers.txt hisat/comp_res_multi_mappers.txt mapsplice2/comp_res_multi_mappers.txt
# OUT: Summary
#
###
all = []
names = ["Aligner"]
count = 0
borders = []
first = true
ARGV[0..-1].each do |arg|
info = []
info << arg.gsub(/([\.\/]|comp_res_multi_mappers.txt$)/,"")
File.open(arg).each do |line|
line.chomp!
if line =~ /^------/
borders << count
next
end
count += 1
fields = line.split("\t")
if line =~ /exist in true data/
info << "NA"
info << "NA"
names << fields[0] if first
names << fields[0].gsub(/FD/, "FN") if first
count += 1
next
end
if line =~ /^Junctions\ Sides/
names << fields[0].split(/[\(\)]/)[1].split("|").map { |e| e = "Junction Sides #{e}" } if first
info << fields[-1].split("|")
count += 4
next
end
info << fields[-1]
names << fields[0] if first
end
first = false
all << info.flatten
end
names.flatten!
#info.flatten!
#puts "aligner\ttotal_number_of_bases_of_reads\taccuracy over all bases\taccuracy over uniquely aligned bases"
names.each_with_index do |name, j|
print "#{name}\t"
res = []
for i in 0...ARGV.length
res << all[i][j]
end
print res.join("\t")
print "\n"
case j
when borders[0]
puts "---------------- READ LEVEL ---------------------"
when borders[1]
puts "---------------- BASE LEVEL ---------------------"
when borders[2]
puts "---------------- JUNC LEVEL ---------------------"
when borders[3]-2
puts "---------------- READ LEVEL PAIRS ---------------------"
when borders[4]-2
puts "---------------- BASE LEVEL PAIRS ---------------------"
end
end