Sha256: 9c0112a7a8a6d71e00525d3fe2596c41a06939eb633c07a5cd07c1e3bfa077ea
Contents?: true
Size: 695 Bytes
Versions: 39
Compression:
Stored size: 695 Bytes
Contents
require 'andand' module Mspire ; end module Mspire::Ident module ProteinLike # an id for the protein attr_accessor :id # the protein sequence attr_accessor :sequence alias_method :seq, :sequence alias_method :seq=, :sequence= # a description of the protein attr_accessor :description # if the GN=([^\s]+) regexp is found in the description, returns the first # match, or nil if not found def gene_id description.andand[/ GN=(\w+) ?/, 1] end end # a generic protein class that is ProteinLike class Protein include ProteinLike def initialize(id=nil, sequence=nil) (@id, @sequence) = id, sequence end end end
Version data entries
39 entries across 39 versions & 1 rubygems