lib/bio/db/primer3.rb in bio-polyploid-tools-0.8.4 vs lib/bio/db/primer3.rb in bio-polyploid-tools-0.8.5

- old
+ new

@@ -57,10 +57,11 @@ attr_accessor :primers_line_1, :primers_line_2 attr_accessor :used_contigs attr_accessor :snp_from attr_accessor :regions attr_accessor :primer3_errors + attr_accessor :repetitive def line_1_name "#{gene}:#{position}#{original}>#{snp} #{line_1}}" end @@ -110,21 +111,22 @@ return @values if @values left_start = 0 left_end = 0 right_start = 0 right_end = 0 - total_columns_before_messages=17 + total_columns_before_messages=18 #puts "Values in primer3" #puts snp_from.inspect @values = Array.new #@values << "#{gene},,#{template_length}," @values << gene @values << "#{original}#{position}#{snp}" @values << template_length @values << snp_from.chromosome @values << regions.size @values << regions.join("|") + @values << repetitive if primer3_line_1 and primer3_line_2 @values << primer3_line_1.polymorphism #Block that searches both if both pairs have a TM primer_2 = primer3_line_2.left_primer_with_coordinates(primer3_line_1.left_coordinates, primer3_line_1.orientation) @@ -653,12 +655,11 @@ attr_accessor :pair def initialize @values = Hash.new end - def method_missing(m, *args, &block) - + def method_missing(m, *args, &block) return @values[m.to_s] if @values[m.to_s] != nil raise NoMethodError.new(), "There's no method called #{m}, available: #{@values.keys.to_s}." end def set_value(key, value) @@ -752,16 +753,18 @@ snp.line_2 = @line_2 end end 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 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 }}