nugen_barcode_splitter 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.puts(stats)
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}\t(#{percent.to_f}%)\n"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nugen_barcode_splitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: