nugen_barcode_splitter 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
data/bin/nugen_barcode_splitter
CHANGED
@@ -5,7 +5,7 @@ require "nugen_barcode_splitter"
|
|
5
5
|
require "fileutils"
|
6
6
|
|
7
7
|
usage =<<EOF
|
8
|
-
V E R S I O N - 0 . 0 .
|
8
|
+
V E R S I O N - 0 . 0 . 5
|
9
9
|
#{$0} [options] -p project_dir -o out_dir -c sample_sheet_nugen
|
10
10
|
_____________________________________________________________________________
|
11
11
|
|
@@ -138,7 +138,7 @@ Dir.glob(options[:project_dir]+"/*").each do |p|
|
|
138
138
|
if options[:debug]
|
139
139
|
STDERR.puts cmd if options[:debug]
|
140
140
|
else
|
141
|
-
status = system(cmd)
|
141
|
+
status = system('bash', '-c', cmd)
|
142
142
|
raise "Calling the template did not succeed!" if !status
|
143
143
|
end
|
144
144
|
end
|
@@ -147,7 +147,7 @@ Dir.glob(options[:project_dir]+"/*").each do |p|
|
|
147
147
|
Dir.glob(outdir+"/*").each do |fwd|
|
148
148
|
if fwd =~ /nugen_demultiplexing.log/
|
149
149
|
sample_sheet.lanes
|
150
|
-
statistics = Statistics.new(fwd
|
150
|
+
statistics = Statistics.new(fwd)
|
151
151
|
end
|
152
152
|
next unless fwd =~ /R1_[0-9]{3}./
|
153
153
|
cmd = "base_adder #{fwd} 4 #{fwd}_added"
|
@@ -1,6 +1,18 @@
|
|
1
1
|
class Statistics
|
2
2
|
|
3
|
-
def initialize(lane_log
|
3
|
+
def initialize(lane_log)
|
4
|
+
# getting barcodes:
|
5
|
+
i = 0
|
6
|
+
@barcodes = []
|
7
|
+
File.open(lane_log).each do |line|
|
8
|
+
next if line.include?("Id")
|
9
|
+
next if line.empty?
|
10
|
+
break if line.include?("unmatched")
|
11
|
+
line = line.split("\t")
|
12
|
+
barcodes[i] = line[0]
|
13
|
+
i += 1
|
14
|
+
end
|
15
|
+
|
4
16
|
@num_reads = Array.new(barcodes.length(),0)
|
5
17
|
@num_unmatched = 0
|
6
18
|
@total = 0
|
@@ -47,7 +47,7 @@ class NugenBarcodeSplitterTest < Test::Unit::TestCase
|
|
47
47
|
|
48
48
|
def test_statistics
|
49
49
|
log_file = "test/fixtures/Lane4.log"
|
50
|
-
stats = Statistics.new(log_file
|
50
|
+
stats = Statistics.new(log_file)
|
51
51
|
assert_equal(stats.total, 31920000)
|
52
52
|
assert_equal(stats.num_reads[0], 8533927)
|
53
53
|
assert_equal(stats.num_unmatched, 2614681)
|