View Source Bio.Restriction.Enzyme (bio_ex_restriction v0.1.1)

This module represents the basic data of a restriction enzyme, as well as functions for accessing them.

The core struct contains information regarding the cut sites, bluntness, name, and recognition site of the restriction enzyme that it represents.

The structs declaration is wrapped in a function that is prefixed by an _, this allows the import of the module without overloading the context with a lot of extraneous functions. The primary interface for accessing enzymes is the get/1 function.

Summary

Functions

The primary struct for interacting with restriction enzymes

Get an enzyme struct by name, where name is either a binary or atom and case insensitive. Returning an error tuple, the error case is a three-tuple with the requested enzyme name as well as the error

Like get/1, but raises for unknown enzymes or returns the struct.

Return a supplier's full name from a code.

Types

@type supplier_code() :: atom()
@type supplier_list() :: [supplier_code()]
@type t() :: %Bio.Restriction.Enzyme{
  blunt?: boolean(),
  cut_1: integer(),
  cut_2: integer(),
  cut_3: integer(),
  cut_4: integer(),
  name: String.t(),
  pattern: String.t(),
  suppliers: supplier_list()
}

Functions

Link to this function

%Bio.Restriction.Enzyme{}

View Source (struct)

The primary struct for interacting with restriction enzymes

@spec get(atom() | String.t()) :: t()

Get an enzyme struct by name, where name is either a binary or atom and case insensitive. Returning an error tuple, the error case is a three-tuple with the requested enzyme name as well as the error:

{:error, :undef_enzyme, <enzyme>}

Examples

iex>Bio.Restriction.Enzyme.get(:CviRI)
{:ok, %Bio.Restriction.Enzyme{
    blunt?: true,
    cut_1: 2,
    cut_2: 2,
    cut_3: 0,
    cut_4: 0,
    name: "CviRI",
    pattern: "tgca"
  }}

iex>Bio.Restriction.Enzyme.get("CviRI")
{:ok, %Bio.Restriction.Enzyme{
    blunt?: true,
    cut_1: 2,
    cut_2: 2,
    cut_3: 0,
    cut_4: 0,
    name: "CviRI",
    pattern: "tgca"
  }}

iex>Bio.Restriction.Enzyme.get(:not_an_enzyme)
{:error, :undef_enzyme, "not_an_enzyme"}
@spec get!(atom() | String.t()) :: t()

Like get/1, but raises for unknown enzymes or returns the struct.

Examples

iex>Bio.Restriction.Enzyme.get!(:CviRI)
%Bio.Restriction.Enzyme{
    blunt?: true,
    cut_1: 2,
    cut_2: 2,
    cut_3: 0,
    cut_4: 0,
    name: "CviRI",
    pattern: "tgca"
  }

iex>Bio.Restriction.Enzyme.get!("CviRI")
%Bio.Restriction.Enzyme{
    blunt?: true,
    cut_1: 2,
    cut_2: 2,
    cut_3: 0,
    cut_4: 0,
    name: "CviRI",
    pattern: "tgca"
  }
@spec get_supplier(atom() | String.t()) :: String.t()

Return a supplier's full name from a code.

Supplier information is encoded in a list of atoms on each struct, which can be used to filter the enzymes that you make available or ensure that they are available through a given entity.

This function allows you to get the full name for a given entity from that code. Codes can be given as either an atom or a binary, either will be modified to ensure case insensitive comparisons.

Examples

iex>Bio.Restriction.Enzyme.get_supplier(:N)
"New England Biolabs"

iex>Bio.Restriction.Enzyme.get_supplier("b")
"Thermo Fisher Scientific"