nugen_barcode_splitter 0.0.10 → 0.0.11
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.
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 . 11
|
9
9
|
#{$0} [options] -p project_dir -o out_dir -c sample_sheet_nugen
|
10
10
|
_____________________________________________________________________________
|
11
11
|
|
@@ -79,13 +79,14 @@ class Merger
|
|
79
79
|
rev_out_files[i].write(rev_line)
|
80
80
|
for k in 1..3
|
81
81
|
fwd_file.readline()
|
82
|
-
rev_splitted_files[i].readline if marker2
|
83
82
|
compare_line_fwd = fwd_splitted_files[i].readline()
|
84
83
|
fwd_out_files[i].write("NNNN"+compare_line_fwd) if k == 1
|
85
84
|
fwd_out_files[i].write(compare_line_fwd) if k == 2
|
86
85
|
fwd_out_files[i].write("@@@@"+compare_line_fwd) if k == 3
|
87
86
|
rev_out_files[i].write(rev_file.readline())
|
88
87
|
end
|
88
|
+
fwd_file.lineno = fwd_file.lineno - 1
|
89
|
+
rev_file.lineno = rev_file.lineno - 1
|
89
90
|
end
|
90
91
|
end
|
91
92
|
if !marker && !rev_splitted_files[i].eof?
|
@@ -111,6 +112,8 @@ class Merger
|
|
111
112
|
rev_out_files[i].write("@@@@"+compare_line_rev) if k == 3
|
112
113
|
fwd_out_files[i].write(fwd_file.readline())
|
113
114
|
end
|
115
|
+
fwd_file.lineno = fwd_file.lineno - 1
|
116
|
+
rev_file.lineno = rev_file.lineno - 1
|
114
117
|
end
|
115
118
|
end
|
116
119
|
break if !marker
|
@@ -4,18 +4,26 @@ class NugenTemplate
|
|
4
4
|
|
5
5
|
def initialize(fastq_multx, options)
|
6
6
|
@template =<<EOF
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
gunzip -c <%= @read %> | #{fastq_multx} \\
|
8
|
+
--bcfile <%= @barcodes %> #{options} <%= @options %> \\
|
9
|
+
--prefix <%= @lane_dir %>/<%= @direction %> \\
|
10
|
+
--suffix ".fq"
|
11
11
|
EOF
|
12
|
+
# @template =<<EOF
|
13
|
+
##{fastq_multx} #{options} <%= @barcodes %> \\
|
14
|
+
# <(gunzip -c <%= @read %>) \\
|
15
|
+
# -o <%= @lane_dir %>/<%= @direction %>.%.fq \\
|
16
|
+
# >> <%= @lane_dir %>/nugen_demultiplexing.log
|
17
|
+
#EOF
|
12
18
|
end
|
13
19
|
|
14
20
|
def fill(lane, number, lane_dir, barcodes, read, is_fwd)
|
15
21
|
if is_fwd
|
16
|
-
direction = "R1_#{number}"
|
22
|
+
direction = "R1_#{number}_"
|
23
|
+
options = "--bol"
|
17
24
|
else
|
18
|
-
direction = "R2_#{number}"
|
25
|
+
direction = "R2_#{number}_"
|
26
|
+
options = "--eol"
|
19
27
|
end
|
20
28
|
context = {
|
21
29
|
:lane => lane,
|
@@ -23,7 +31,8 @@ EOF
|
|
23
31
|
:lane_dir => lane_dir,
|
24
32
|
:barcodes => barcodes,
|
25
33
|
:read => read,
|
26
|
-
:direction => direction
|
34
|
+
:direction => direction,
|
35
|
+
:options => options
|
27
36
|
}
|
28
37
|
|
29
38
|
eruby = Erubis::Eruby.new(@template)
|