<commit_before>/*--------------------------------------------------------------------------
 *  Copyright 2010 utgenome.org
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *--------------------------------------------------------------------------*/
//--------------------------------------
// utgb-core Project
//
// KmerTest.java
// Since: 2010/11/10
//
//--------------------------------------
package org.utgenome.format.fasta;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.utgenome.gwt.utgb.client.bio.ACGTEncoder;

public class KmerTest {

	@Test
	public void constructor() throws Exception {

		final String s = "AAACCTGT";
		Kmer kmer = new Kmer(s);
		assertEquals(s, kmer.toString());
		for (int i = 0; i < s.length(); ++i) {
			assertEquals(s.charAt(i), kmer.charAt(i));
		}

		assertEquals(s.length(), kmer.length());
	}

	@Test
	public void setACGT() throws Exception {
		final String s = "AAACCTGT";
		Kmer kmer = new Kmer(s);
		kmer.set(0, "G");
		assertEquals("GAACCTGT", kmer.toString());
		kmer.set(1, "C");
		assertEquals("GCACCTGT", kmer.toString());
		kmer.set(2, "T");
		assertEquals("GCTCCTGT", kmer.toString());
		kmer.set(3, "T");
		assertEquals("GCTTCTGT", kmer.toString());
<commit_msg>add test for creating Kmer from CompactACGT<commit_after>/*--------------------------------------------------------------------------
 *  Copyright 2010 utgenome.org
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *--------------------------------------------------------------------------*/
//--------------------------------------
// utgb-core Project
//
// KmerTest.java
// Since: 2010/11/10
//
//--------------------------------------
package org.utgenome.format.fasta;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.utgenome.gwt.utgb.client.bio.ACGTEncoder;

public class KmerTest {

	@Test
	public void constructor() throws Exception {

		final String s = "AAACCTGT";
		Kmer kmer = new Kmer(s);
		assertEquals(s, kmer.toString());
		for (int i = 0; i < s.length(); ++i) {
			assertEquals(s.charAt(i), kmer.charAt(i));
		}

		assertEquals(s.length(), kmer.length());
	}

	@Test
	public void createFromCompactACGT() throws Exception {
		final String s = "AAACCTGT";
		Kmer kmer = new Kmer(CompactACGT.createFromString(s));
		assertEquals(s, kmer.toString());
		for (int i = 0; i < s.length(); ++i) {
			assertEquals(s.charAt(i), kmer.charAt(i));
		}

		assertEquals(s.length(), kmer.length());

	}

	@Test
	public void setACGT() throws Exception {
		final String s = "AAACCTGT";
		Kmer kmer = new Kmer(s);
		kmer.set(0, "G");
		assertEquals("GAACCTGT", kmer.toString());
		kmer.set(1, "C");
		assertEquals("GCACCTGT", kmer.toString());
		kmer.set(2, "T");
		assertEquals("GCTCCTGT", kmer.toString());
		kmer.set(3, "T");
		assertEquals("GCTTCTGT", kmer.toString());

{'fraction_non_alphanumeric': 0.239136024685009, 'fraction_numerical': 0.01105682694780149, 'mean_word_length': 2.3361921097770155, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3401976', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1149, 'n_words': 345}