Sha256: f9eb37e1f371ebb5d27b6b31c70b7bb94551faa453a7affa77d9828fee2be995

Contents?: true

Size: 813 Bytes

Versions: 4

Compression:

Stored size: 813 Bytes

Contents

require 'ms/error_rate/sbv'

module Ms
  module ErrorRate
    class Sbv
      # Constraints on aaseq attribute of peptides (the bare amino acid sequence)
      # works by calculating amino acid frequencies in the fasta file used.
      class PeptideBased

        def self.generate_hashes(pep_to_prot_file, aa="C", min_num=1 )
          Ms::ErrorRate::Sbv.generate_hashes(pep_to_prot_file, :type_code => "aa_min#{min_num}") do |pep|
            if min_num == 1
              if pep.include?(aa) ; 1
              else ; 0
              end
            else
              count = 0
              pep.each_char {|c| count += 1 if c == aa }
              if count >= min_num ; 1
              else ; 0
              end
            end
          end
        end

      end # class
    end # Sbv
  end # ER
end # Ms

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ms-error_rate-0.0.13 lib/ms/error_rate/sbv/peptide_based.rb
ms-error_rate-0.0.12 lib/ms/error_rate/sbv/peptide_based.rb
ms-error_rate-0.0.11 lib/ms/error_rate/sbv/peptide_based.rb
ms-error_rate-0.0.10 lib/ms/error_rate/sbv/peptide_based.rb