class Bio::DB::Primer3::KASPContainer
Attributes
line_1[RW]
line_2[RW]
scores[RW]
snp_hash[RW]
Public Instance Methods
add_primers_file(filename)
click to toggle source
# File lib/bio/db/primer3.rb, line 790 def add_primers_file(filename) #primer3record.scores = @scores if @scores Primer3Record.parse_file(filename, scores: @scores) do | primer3record | current_snp = @snp_hash["#{primer3record.snp.to_s}:#{primer3record.chromosome}"] current_snp.add_record(primer3record) end end
add_snp(snp_in)
click to toggle source
# File lib/bio/db/primer3.rb, line 769 def add_snp(snp_in) #TODO: Here we need to also copy the errors that will be printed. @snp_hash=Hash.new unless @snp_hash snp = SNP.new snp.gene = snp_in.gene snp.original = snp_in.original snp.primer3_errors = Set.new snp_in.errors snp.position = snp_in.position snp.snp = snp_in.snp snp.repetitive = snp_in.repetitive #puts snp_in.inspect snp.hit_count = snp_in.hit_count snp.snp_type = snp_in.snp_type snp.line_1 = @line_1 snp.line_2 = @line_2 snp.snp_from = snp_in snp.regions = snp_in.exon_list.values.collect { |x| x.collect {|y| y.target_region.to_s }} @snp_hash[snp.to_s] = snp snp end
add_snp_file(filename)
click to toggle source
# File lib/bio/db/primer3.rb, line 760 def add_snp_file(filename) @snp_hash=Hash.new unless @snp_hash SNP.parse_file(filename) do |snp| @snp_hash[snp.to_s] = snp snp.line_1 = @line_1 snp.line_2 = @line_2 end end
print_primers()
click to toggle source
# File lib/bio/db/primer3.rb, line 798 def print_primers str = "" snp_hash.each do |k, snp| str << snp.print_primers << "\n" end return str end
print_primers_with_tails(tail_a: "GAAGGTCGGAGTCAACGGATT", tail_b: "GAAGGTGACCAAGTTCATGCT")
click to toggle source
# File lib/bio/db/primer3.rb, line 806 def print_primers_with_tails(tail_a: "GAAGGTCGGAGTCAACGGATT", tail_b: "GAAGGTGACCAAGTTCATGCT") str = "" snp_hash.each do |k, snp| if snp.found_primers? str << snp.gene << snp.original << "_1st\t" << tail_a << snp.first_primer << "\n" str << snp.gene << snp.snp << "_2nd\t" << tail_b << snp.second_primer << "\n" str << snp.gene << "_common\t" << snp.common_primer << "\n" end end return str end