<commit_before><commit_msg>first commit :: dna<commit_after>require 'minitest/autorun'
require 'minitest/pride'

class Rosalind

  NUCLEOTIDS = {'A' => 'T', 'C' => 'G', 'G' => 'C', 'T' => 'A'}

  ## Count all nucleotids in order

  def self.nucleo_count dna_str
    NUCLEOTIDS.keys.sort.map{ |c| dna_str.count c }.join " "
  end

  ## Parse dna strings in FASTA format

  def self.fasta input_dna
    input_dna.delete("\n").delete(" ").scan(/>(Rosalind_\d+)([AGCT]+)/)
  end

end

class TestRosalind < Minitest::Test
  def test_count_nucleothingies
    chorizo = 'AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC'
    assert_equal '20 12 17 21', Rosalind.nucleo_count(chorizo)
  end
end
{'fraction_non_alphanumeric': 0.13983050847457626, 'fraction_numerical': 0.011299435028248588, 'mean_word_length': 4.453846153846154, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '1047729', 'n_tokens_mistral': 312, 'n_tokens_neox': 285, 'n_words': 59}