- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRubyExamples.rb
More file actions
Latest commit
23 lines (16 loc) · 674 Bytes
/
Copy pathRubyExamples.rb
File metadata and controls
23 lines (16 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Ruby Useful Examples
#Hash of Hashes
#assigns the JSON_output_hash as a hash of JSON_hash's ...
#which call on primer3_hash to get its data
JSON_ouput_hash={}
JSON_hash={}
(0..4).eachdo |i|
JSON_hash["forward_primer_sequence"]=primer3_hash["PRIMER_LEFT_#{i}_SEQUENCE"]
JSON_hash["forward_primer_tm"]=primer3_hash["PRIMER_LEFT_#{i}_TM"]
JSON_hash["reverse_primer_sequence"]=primer3_hash["PRIMER_RIGHT_#{i}_SEQUENCE"]
JSON_hash["reverse_primer__tm"]=primer3_hash["PRIMER_RIGHT_#{i}_TM"]
JSON_hash["amplicon_size"]=primer3_hash["PRIMER_PAIR_#{i}_PRODUCT_SIZE"]
JSON_ouput_hash["amplicon_#{i}"]=JSON_hash
end
putsJSON_ouput_hash
#Array of Hashes