qu-pcr 1.0.9 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/qu/pcr/primer3.rb +21 -20
- data/lib/qu/pcr/primer3_parameters.rb +188 -73
- data/lib/qu/pcr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0463909bfb89c89aa7739042805062be342224e
|
4
|
+
data.tar.gz: 32dccb0916f92057097f2dc90c04ccfad0fd380a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 091ecb385b0aa540fb8032ff13cefd28c370a0714cbd7b61484411dc6f1167f9d37a2345ef7b6b5524a7f3656cf591887b40a767c5b50479f63165fa828f0937
|
7
|
+
data.tar.gz: c470f7dbadcde3df10789aba3ca77b7fafa6d5996eb508913694cf444b11a528b01abf45de6f65b8d5078f1f16c314345b06e0308ef4e90e4c969aba3e89fb85
|
data/.gitignore
CHANGED
data/lib/qu/pcr/primer3.rb
CHANGED
@@ -25,32 +25,15 @@ module Qu
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def out
|
28
|
-
|
29
|
-
p3_input_file = Tempfile.new('p3_input')
|
30
|
-
p3_input_file.write(p3_string)
|
31
|
-
p3_input_file.close
|
32
|
-
|
33
|
-
p3_out = Cmdwrapper::primer3_core(p3_input_file)
|
34
|
-
|
35
|
-
p3_input_file.unlink
|
28
|
+
p3_out = Cmdwrapper::primer3_core(@para)
|
36
29
|
|
37
30
|
return Primer3Parser.new(p3_out).records
|
38
31
|
end
|
39
32
|
|
40
|
-
private
|
41
|
-
def create_p3_input()
|
42
|
-
lines = []
|
43
|
-
@para.each_pair do |key, value|
|
44
|
-
next if value.to_s.empty?
|
45
|
-
lines << "#{key}=#{value}"
|
46
|
-
end
|
47
|
-
lines << "="
|
48
|
-
return lines.join("\n")
|
49
|
-
end
|
50
33
|
end # End Primer3 class
|
51
34
|
|
52
35
|
class Amplicon
|
53
|
-
attr_reader :fp, :rp, :product
|
36
|
+
attr_reader :fp, :rp, :probe, :product
|
54
37
|
def initialize(record, i, type='primer3')
|
55
38
|
if type == 'primer3'
|
56
39
|
(fp_5_pos, fp_size) = record["PRIMER_LEFT_%s" %[i]].split(',')
|
@@ -70,6 +53,24 @@ module Qu
|
|
70
53
|
id = record["SEQUENCE_ID"].to_s
|
71
54
|
product_seq = record["SEQUENCE_TEMPLATE"].to_s[fp_5_pos.to_i..rp_5_pos.to_i]
|
72
55
|
|
56
|
+
if record.has_key?("PRIMER_INTERNAL_NUM_RETURNED") && record["PRIMER_INTERNAL_NUM_RETURNED"].to_i > 0
|
57
|
+
(probe_5_pos, probe_size) = record["PRIMER_INTERNAL_%s" %[i]].split(',')
|
58
|
+
probe_seq = record["PRIMER_INTERNAL_%s_SEQUENCE" % [i]]
|
59
|
+
probe_gc = record["PRIMER_INTERNAL_%s_GC_PERCENT" % [i]].to_f
|
60
|
+
probe_tm = record["PRIMER_INTERNAL_%s_TM" % [i]].to_f
|
61
|
+
probe_penalty = record["PRIMER_INTERNAL_%s_PENALTY" % [i]].to_f
|
62
|
+
|
63
|
+
@probe = Primer.new(seq = probe_seq,
|
64
|
+
type = 'probe',
|
65
|
+
gc = probe_gc,
|
66
|
+
tm = probe_tm,
|
67
|
+
penalty = probe_penalty,
|
68
|
+
pos = probe_5_pos,
|
69
|
+
)
|
70
|
+
else
|
71
|
+
@probe = nil
|
72
|
+
end
|
73
|
+
|
73
74
|
@fp = Primer.new(seq = fp_seq,
|
74
75
|
type = 'forward',
|
75
76
|
gc = fp_gc,
|
@@ -139,8 +140,8 @@ module Qu
|
|
139
140
|
$stderr.puts "\tFailed design for %s" % [seq_id]
|
140
141
|
$stderr.puts "\tLeft: #{record['PRIMER_LEFT_EXPLAIN']}"
|
141
142
|
$stderr.puts "\tRight: #{record['PRIMER_RIGHT_EXPLAIN']}"
|
143
|
+
$stderr.puts "\INTERNAL: #{record['PRIMER_INTERNAL_EXPLAIN']}" if record.has_key?("PRIMER_INTERNAL_EXPLAIN")
|
142
144
|
$stderr.puts "\tPair: #{record['PRIMER_PAIR_EXPLAIN']}"
|
143
|
-
#exit
|
144
145
|
end
|
145
146
|
p3_hash[seq_id] = []
|
146
147
|
(0...pp_num).each do |i|
|
@@ -3,83 +3,198 @@
|
|
3
3
|
module Qu
|
4
4
|
module Pcr
|
5
5
|
PRIMER3_OPTIONS = {
|
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
|
-
|
6
|
+
SEQUENCE_ID: "",
|
7
|
+
SEQUENCE_TEMPLATE: "",
|
8
|
+
SEQUENCE_INCLUDED_REGION: "",
|
9
|
+
SEQUENCE_TARGET: "",
|
10
|
+
SEQUENCE_EXCLUDED_REGION: "",
|
11
|
+
SEQUENCE_PRIMER_PAIR_OK_REGION_LIST: "",
|
12
|
+
SEQUENCE_OVERLAP_JUNCTION_LIST: "",
|
13
|
+
SEQUENCE_INTERNAL_EXCLUDED_REGION: "",
|
14
|
+
SEQUENCE_PRIMER: "",
|
15
|
+
SEQUENCE_INTERNAL_OLIGO: "",
|
16
|
+
SEQUENCE_PRIMER_REVCOMP: "",
|
17
|
+
SEQUENCE_FORCE_LEFT_START: -1000000,
|
18
|
+
SEQUENCE_FORCE_LEFT_END: -1000000,
|
19
|
+
SEQUENCE_FORCE_RIGHT_START: -1000000,
|
20
|
+
SEQUENCE_FORCE_RIGHT_END: -1000000,
|
21
|
+
|
22
|
+
PRIMER_TASK: "generic",
|
23
|
+
PRIMER_PICK_LEFT_PRIMER: 1,
|
24
|
+
PRIMER_PICK_INTERNAL_OLIGO: 0,
|
25
|
+
PRIMER_PICK_RIGHT_PRIMER: 1,
|
26
|
+
PRIMER_NUM_RETURN: 10,
|
27
|
+
PRIMER_MIN_3_PRIME_OVERLAP_OF_JUNCTION: 4,
|
28
|
+
PRIMER_MIN_5_PRIME_OVERLAP_OF_JUNCTION: 7,
|
29
|
+
PRIMER_MUST_MATCH_FIVE_PRIME: "",
|
30
|
+
PRIMER_INTERNAL_MUST_MATCH_FIVE_PRIME: "",
|
31
|
+
PRIMER_MUST_MATCH_THREE_PRIME: "",
|
32
|
+
PRIMER_INTERNAL_MUST_MATCH_THREE_PRIME: "",
|
33
|
+
PRIMER_PRODUCT_SIZE_RANGE: "100-150 151-250 100-300 301-400 401-500 501-600 601-700 701-850 851-1000",
|
34
|
+
PRIMER_PRODUCT_OPT_SIZE: 0,
|
35
|
+
PRIMER_PAIR_WT_PRODUCT_SIZE_LT: 0.0,
|
36
|
+
PRIMER_PAIR_WT_PRODUCT_SIZE_GT: 0.0,
|
37
|
+
PRIMER_MIN_SIZE: 15,
|
38
|
+
PRIMER_INTERNAL_MIN_SIZE: 18,
|
39
|
+
PRIMER_OPT_SIZE: 22,
|
40
|
+
PRIMER_INTERNAL_OPT_SIZE: 20,
|
41
|
+
PRIMER_MAX_SIZE: 35,
|
42
|
+
PRIMER_INTERNAL_MAX_SIZE: 35,
|
43
|
+
# Customed by Wubin Qu
|
44
|
+
PRIMER_WT_SIZE_LT: 0.0,
|
45
|
+
PRIMER_INTERNAL_WT_SIZE_LT: 0.0,
|
46
|
+
# Customed by Wubin Qu
|
47
|
+
PRIMER_WT_SIZE_GT: 0.0,
|
48
|
+
PRIMER_INTERNAL_WT_SIZE_GT: 0.0,
|
49
|
+
PRIMER_MIN_GC: 20.0,
|
50
|
+
PRIMER_INTERNAL_MIN_GC: 20.0,
|
51
|
+
PRIMER_OPT_GC_PERCENT: 50.0,
|
52
|
+
PRIMER_INTERNAL_OPT_GC_PERCENT: 50.0,
|
53
|
+
PRIMER_MAX_GC: 80.0,
|
54
|
+
PRIMER_INTERNAL_MAX_GC: 80.0,
|
55
|
+
PRIMER_WT_GC_PERCENT_LT: 0.0,
|
56
|
+
PRIMER_INTERNAL_WT_GC_PERCENT_LT: 0.0,
|
57
|
+
PRIMER_WT_GC_PERCENT_GT: 0.0,
|
58
|
+
PRIMER_INTERNAL_WT_GC_PERCENT_GT: 0.0,
|
59
|
+
PRIMER_GC_CLAMP: 0,
|
60
|
+
PRIMER_MAX_END_GC: 5,
|
61
|
+
PRIMER_MIN_TM: 55.0,
|
62
|
+
PRIMER_INTERNAL_MIN_TM: 55.0,
|
63
|
+
PRIMER_OPT_TM: 62.0,
|
64
|
+
PRIMER_INTERNAL_OPT_TM: 62.0,
|
65
|
+
PRIMER_MAX_TM: 65.0,
|
66
|
+
PRIMER_INTERNAL_MAX_TM: 65.0,
|
67
|
+
PRIMER_PAIR_MAX_DIFF_TM: 10.0,
|
68
|
+
PRIMER_WT_TM_LT: 1.0,
|
69
|
+
PRIMER_INTERNAL_WT_TM_LT: 1.0,
|
70
|
+
PRIMER_WT_TM_GT: 1.0,
|
71
|
+
PRIMER_INTERNAL_WT_TM_GT: 1.0,
|
72
|
+
PRIMER_PAIR_WT_DIFF_TM: 1.0,
|
73
|
+
PRIMER_PRODUCT_MIN_TM: -1000000.0,
|
74
|
+
PRIMER_PRODUCT_OPT_TM: 0.0,
|
75
|
+
PRIMER_PRODUCT_MAX_TM: 1000000.0,
|
76
|
+
PRIMER_PAIR_WT_PRODUCT_TM_LT: 0.0,
|
77
|
+
PRIMER_PAIR_WT_PRODUCT_TM_GT: 0.0,
|
78
|
+
PRIMER_TM_FORMULA: 1,
|
79
|
+
PRIMER_SALT_MONOVALENT: 50.0,
|
80
|
+
PRIMER_INTERNAL_SALT_MONOVALENT: 50.0,
|
81
|
+
PRIMER_SALT_DIVALENT: 1.5,
|
82
|
+
PRIMER_INTERNAL_SALT_DIVALENT: 0.0,
|
83
|
+
# Customed by Wubin Qu
|
84
|
+
PRIMER_DNTP_CONC: 0.25,
|
85
|
+
PRIMER_INTERNAL_DNTP_CONC: 0.0,
|
86
|
+
PRIMER_SALT_CORRECTIONS: 1,
|
87
|
+
PRIMER_DNA_CONC: 50.0,
|
88
|
+
PRIMER_INTERNAL_DNA_CONC: 50.0,
|
89
|
+
PRIMER_THERMODYNAMIC_OLIGO_ALIGNMENT: 1,
|
90
|
+
PRIMER_THERMODYNAMIC_TEMPLATE_ALIGNMENT: 1,
|
91
|
+
PRIMER_THERMODYNAMIC_PARAMETERS_PATH: Cmdwrapper::THERMO_PATH,
|
92
|
+
PRIMER_MAX_SELF_ANY: 8.00,
|
93
|
+
PRIMER_MAX_SELF_ANY_TH: 47.00,
|
94
|
+
PRIMER_INTERNAL_MAX_SELF_ANY: 12.00,
|
95
|
+
PRIMER_INTERNAL_MAX_SELF_ANY_TH: 47.00,
|
96
|
+
PRIMER_PAIR_MAX_COMPL_ANY: 8.00,
|
97
|
+
PRIMER_PAIR_MAX_COMPL_ANY_TH: 47.00,
|
98
|
+
PRIMER_WT_SELF_ANY: 0.0,
|
99
|
+
PRIMER_WT_SELF_ANY_TH: 0.0,
|
100
|
+
PRIMER_INTERNAL_WT_SELF_ANY: 0.0,
|
101
|
+
PRIMER_INTERNAL_WT_SELF_ANY_TH: 0.0,
|
102
|
+
PRIMER_PAIR_WT_COMPL_ANY: 0.0,
|
103
|
+
PRIMER_PAIR_WT_COMPL_ANY_TH: 0.0,
|
104
|
+
PRIMER_MAX_SELF_END: 3.0,
|
105
|
+
PRIMER_MAX_SELF_END_TH: 47.00,
|
106
|
+
PRIMER_INTERNAL_MAX_SELF_END: 12.00,
|
107
|
+
PRIMER_INTERNAL_MAX_SELF_END_TH: 47.00,
|
108
|
+
PRIMER_PAIR_MAX_COMPL_END: 3.00,
|
109
|
+
PRIMER_PAIR_MAX_COMPL_END_TH: 47.00,
|
110
|
+
PRIMER_WT_SELF_END: 0.0,
|
111
|
+
PRIMER_WT_SELF_END_TH: 0.0,
|
112
|
+
PRIMER_INTERNAL_WT_SELF_END: 0.0,
|
113
|
+
PRIMER_INTERNAL_WT_SELF_END_TH: 0.0,
|
114
|
+
PRIMER_PAIR_WT_COMPL_END: 0.0,
|
115
|
+
PRIMER_PAIR_WT_COMPL_END_TH: 0.0,
|
116
|
+
PRIMER_MAX_HAIRPIN_TH: 47.0,
|
117
|
+
PRIMER_INTERNAL_MAX_HAIRPIN_TH: 47.0,
|
118
|
+
PRIMER_WT_HAIRPIN_TH: 0.0,
|
119
|
+
PRIMER_INTERNAL_WT_HAIRPIN_TH: 0.0,
|
120
|
+
PRIMER_MAX_END_STABILITY: 100.0,
|
121
|
+
PRIMER_WT_END_STABILITY: 0.0,
|
122
|
+
PRIMER_MAX_NS_ACCEPTED: 0,
|
123
|
+
PRIMER_INTERNAL_MAX_NS_ACCEPTED: 0,
|
124
|
+
PRIMER_WT_NUM_NS: 0.0,
|
125
|
+
PRIMER_INTERNAL_WT_NUM_NS: 0.0,
|
126
|
+
PRIMER_MAX_POLY_X: 5,
|
127
|
+
PRIMER_INTERNAL_MAX_POLY_X: 5,
|
128
|
+
PRIMER_MIN_THREE_PRIME_DISTANCE: 1,
|
129
|
+
PRIMER_PICK_ANYWAY: 0,
|
130
|
+
PRIMER_LOWERCASE_MASKING: 1,
|
131
|
+
PRIMER_EXPLAIN_FLAG: 1,
|
132
|
+
PRIMER_LIBERAL_BASE: 0,
|
133
|
+
PRIMER_FIRST_BASE_INDEX: 0,
|
134
|
+
PRIMER_MAX_TEMPLATE_MISPRIMING: -1.00,
|
135
|
+
PRIMER_MAX_TEMPLATE_MISPRIMING_TH: -1.00,
|
136
|
+
PRIMER_PAIR_MAX_TEMPLATE_MISPRIMING: -1.00,
|
137
|
+
PRIMER_PAIR_MAX_TEMPLATE_MISPRIMING_TH: -1.00,
|
138
|
+
PRIMER_WT_TEMPLATE_MISPRIMING: 0.0,
|
139
|
+
PRIMER_WT_TEMPLATE_MISPRIMING_TH: 0.0,
|
140
|
+
PRIMER_PAIR_WT_TEMPLATE_MISPRIMING: 0.0,
|
141
|
+
PRIMER_PAIR_WT_TEMPLATE_MISPRIMING_TH: 0.0,
|
142
|
+
PRIMER_MISPRIMING_LIBRARY: "",
|
143
|
+
PRIMER_INTERNAL_MISHYB_LIBRARY: "",
|
144
|
+
PRIMER_LIB_AMBIGUITY_CODES_CONSENSUS: 0,
|
145
|
+
PRIMER_MAX_LIBRARY_MISPRIMING: 12.00,
|
146
|
+
PRIMER_INTERNAL_MAX_LIBRARY_MISHYB: 12.00,
|
147
|
+
PRIMER_PAIR_MAX_LIBRARY_MISPRIMING: 24.00,
|
148
|
+
PRIMER_WT_LIBRARY_MISPRIMING: 0.0,
|
149
|
+
PRIMER_INTERNAL_WT_LIBRARY_MISHYB: 0.0,
|
150
|
+
PRIMER_PAIR_WT_LIBRARY_MISPRIMING: 0.0,
|
151
|
+
PRIMER_MIN_QUALITY: 0,
|
152
|
+
PRIMER_INTERNAL_MIN_QUALITY: 0,
|
153
|
+
PRIMER_MIN_END_QUALITY: 0,
|
154
|
+
PRIMER_QUALITY_RANGE_MIN: 0,
|
155
|
+
PRIMER_QUALITY_RANGE_MAX: 100,
|
156
|
+
PRIMER_WT_SEQ_QUAL: 0.0,
|
157
|
+
PRIMER_INTERNAL_WT_SEQ_QUAL: 0.0,
|
158
|
+
PRIMER_PAIR_WT_PR_PENALTY: 1.0,
|
159
|
+
PRIMER_PAIR_WT_IO_PENALTY: 0.0,
|
160
|
+
PRIMER_INSIDE_PENALTY: -1.0,
|
161
|
+
PRIMER_OUTSIDE_PENALTY: 0.0,
|
162
|
+
PRIMER_WT_POS_PENALTY: 1.0,
|
163
|
+
PRIMER_SEQUENCING_LEAD: 50,
|
164
|
+
PRIMER_SEQUENCING_SPACING: 500,
|
165
|
+
PRIMER_SEQUENCING_INTERVAL: 250,
|
166
|
+
PRIMER_SEQUENCING_ACCURACY: 20,
|
167
|
+
PRIMER_WT_END_QUAL: 0.0,
|
168
|
+
PRIMER_INTERNAL_WT_END_QUAL: 0.0,
|
169
|
+
|
170
|
+
P3_FILE_FLAG: 0,
|
56
171
|
}
|
57
172
|
|
58
173
|
# Parameters not shown to users for editing
|
59
174
|
USER_SPECIFIC_OPTIONS = [
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
175
|
+
:SEQUENCE_ID,
|
176
|
+
:SEQUENCE_TARGET,
|
177
|
+
:SEQUENCE_EXCLUDED_REGION,
|
178
|
+
:SEQUENCE_FORCE_LEFT_START,
|
179
|
+
:SEQUENCE_FORCE_LEFT_END,
|
180
|
+
:SEQUENCE_FORCE_RIGHT_START,
|
181
|
+
:SEQUENCE_FORCE_RIGHT_END,
|
182
|
+
:SEQUENCE_PRIMER,
|
183
|
+
:SEQUENCE_PRIMER_REVCOMP,
|
184
|
+
:PRIMER_PRODUCT_SIZE_RANGE,
|
185
|
+
:PRIMER_MIN_SIZE,
|
186
|
+
:PRIMER_OPT_SIZE,
|
187
|
+
:PRIMER_MAX_SIZE,
|
188
|
+
:PRIMER_MIN_TM,
|
189
|
+
:PRIMER_OPT_TM,
|
190
|
+
:PRIMER_MAX_TM,
|
191
|
+
:PRIMER_MIN_GC,
|
192
|
+
:PRIMER_OPT_GC,
|
193
|
+
:PRIMER_MAX_GC,
|
194
|
+
:PRIMER_MAX_POLY_X,
|
195
|
+
:PRIMER_MAX_HAIRPIN_TH, # I think it's no needed here, becuse they should be checked in MFEprimer (>v3.0), Wubin Qu [2014-5-8]
|
196
|
+
:PRIMER_MAX_SELF_ANY_TH,
|
197
|
+
:PRIMER_MAX_SELF_END_TH,
|
83
198
|
:PRIMER_PAIR_MAX_COMPL_ANY_TH,
|
84
199
|
:PRIMER_PAIR_MAX_COMPL_END_TH,
|
85
200
|
:PRIMER_PRODUCT_OPT_TM,
|
data/lib/qu/pcr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qu-pcr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wubin Qu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: qu-utils
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.2.2
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: A ruby library for PCR
|