<commit_before>defmodule NucleotideCount do
  @nucleotides [?A, ?C, ?G, ?T]

  @doc """
  Counts individual nucleotides in a NucleotideCount strand.

  ## Examples

  iex> NucleotideCount.count('AATAA', ?A)
  4

  iex> NucleotideCount.count('AATAA', ?T)
  1
  """

  def count(strand, nucleotide) when nucleotide in(@nucleotides) do
    validate!(strand)
    Enum.count strand, &(&1 == nucleotide)
  end
  def count(_strand, _nucleotide), do: raise ArgumentError

  @doc """
  Returns a summary of counts by nucleotide.

  ## Examples

  iex> NucleotideCount.nucleotide_counts('AATAA')
  %{?A => 4, ?T => 1, ?C => 0, ?G => 0}
  """

  def histogram(strand) do
    Enum.map(@nucleotides, &{&1, count(strand, &1)}) |> Enum.into(%{})
  end

  defp validate!(strand) do
    unless Enum.all?(strand, &(&1 in @nucleotides)), do: raise ArgumentError
  end
end<commit_msg>Remove leftover functionality<commit_after>defmodule NucleotideCount do
  @nucleotides [?A, ?C, ?G, ?T]

  @doc """
  Counts individual nucleotides in a NucleotideCount strand.

  ## Examples

  iex> NucleotideCount.count('AATAA', ?A)
  4

  iex> NucleotideCount.count('AATAA', ?T)
  1
  """

  def count(strand, nucleotide) when nucleotide in(@nucleotides) do
    Enum.count strand, &(&1 == nucleotide)
  end
  def count(_strand, _nucleotide), do: raise ArgumentError

  @doc """
  Returns a summary of counts by nucleotide.

  ## Examples

  iex> NucleotideCount.nucleotide_counts('AATAA')
  %{?A => 4, ?T => 1, ?C => 0, ?G => 0}
  """

  def histogram(strand) do
    Enum.map(@nucleotides, &{&1, count(strand, &1)}) |> Enum.into(%{})
  end
end
{'fraction_non_alphanumeric': 0.15527950310559005, 'fraction_numerical': 0.011801242236024845, 'mean_word_length': 3.941717791411043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3417484', 'n_tokens_mistral': 683, 'n_tokens_neox': 552, 'n_words': 158}