View Source Bio.Sequence.DnaStrand (bio_elixir v0.2.0)

A single DNA strand can be represented by the basic sequence which uses Bio.SimpleSequence .

Examples

iex>"tagc" in DnaStrand.new("ttagct")
true

iex>alias Bio.Enum, as: Bnum
...>DnaStrand.new("ttagct")
...>|> Bnum.map(&(&1))
%DnaStrand{sequence: "ttagct", length: 6}

iex>alias Bio.Enum, as: Bnum
...>DnaStrand.new("ttagct")
...>|> Bnum.slice(2, 2)
%DnaStrand{sequence: "ag", length: 2, label: ""}

In order to validate the sequence of nucleotides, you can pass an alphabet to the valid?/2 function.