nugen_barcode_splitter 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
data/bin/nugen_barcode_splitter
CHANGED
@@ -154,7 +154,7 @@ Dir.glob(options[:project_dir]+"/*").each do |p|
|
|
154
154
|
merger = Merger.new(fwd,rev,outdir,number,barcodes)
|
155
155
|
stats = merger.merge()
|
156
156
|
stats_file = File.open("#{outdir}/nugen_demultiplexing.log", 'a')
|
157
|
-
stats_file.
|
157
|
+
stats_file.write(stats)
|
158
158
|
stats_file.close()
|
159
159
|
end
|
160
160
|
|
@@ -50,7 +50,6 @@ class Merger
|
|
50
50
|
|
51
51
|
def merge()
|
52
52
|
statistics = Array.new(@sample_ids.length()+2,0)
|
53
|
-
|
54
53
|
fwd_file = Zlib::GzipReader.open(@fwd)
|
55
54
|
rev_file = Zlib::GzipReader.open(@rev)
|
56
55
|
fwd_splitted_files = []
|
@@ -59,6 +58,7 @@ class Merger
|
|
59
58
|
rev_out_files = []
|
60
59
|
fwd_out_unmatched = File.open(@outdir+"/R1_#{@number}.unmatched.updated.fq",'w')
|
61
60
|
rev_out_unmatched = File.open(@outdir+"/R2_#{@number}.unmatched.updated.fq",'w')
|
61
|
+
|
62
62
|
@sample_ids.each_with_index do |sample_id, i|
|
63
63
|
fwd_splitted_files[i] = File.open(@outdir+"/R1_#{@number}.#{sample_id}.fq")
|
64
64
|
rev_splitted_files[i] = File.open(@outdir+"/R2_#{@number}.#{sample_id}.fq")
|
@@ -42,9 +42,10 @@ class Statistics
|
|
42
42
|
@barcodes.each_with_index do |code, i|
|
43
43
|
str += "#{code}:\t#{@num_reads[i]} \n"
|
44
44
|
end
|
45
|
-
percent = (100 / @total.to_f) * @num_unmatched.to_f
|
46
|
-
percent = (percent.to_f * 100).round / 100.to_f
|
47
|
-
str += "Unmatched:\t#{@num_unmatched}\
|
45
|
+
#percent = (100 / @total.to_f) * @num_unmatched.to_f
|
46
|
+
#percent = (percent.to_f * 100).round / 100.to_f
|
47
|
+
str += "Unmatched:\t#{@num_unmatched}\n"
|
48
48
|
str += "Total:\t#{@total}"
|
49
|
+
str.to_s
|
49
50
|
end
|
50
51
|
end
|