<commit_before>package edu.stanford.hivdb.genotyper;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

public class HIVGenotypeReferenceTest {

	//@Test
	public void testCompareAll() {
		TestSequence seqX51 = TestSequence.loadResource("X51_full.json");
		List<BoundGenotype> results = HIVGenotypeReference.compareAll(
			seqX51.sequence, seqX51.firstNA, seqX51.lastNA);
		BoundGenotype primary = results.get(0);
		assertEquals("X51", primary.getGenotype().getIndexName());
		assertEquals("JN029801", primary.getReference().getAccession());
		assertEquals(66.0 / 2841, primary.getDistance(), 1e-10);
		assertEquals("B", results.get(1).getGenotype().getIndexName());
		
		// test boundary cases
		StringBuffer buf = new StringBuffer(seqX51.sequence);
		buf.setCharAt(0, 'A');
		buf.setCharAt(2840, 'C');
		results = HIVGenotypeReference.compareAll(
			buf.toString(), seqX51.firstNA, seqX51.lastNA);
		assertEquals(68.0 / 2841,results.get(0).getDistance(), 1e-10);
	}
	
	//@Test
	public void testGetDisplayGenotype() {
		TestSequence seqX51 = TestSequence.loadResource("X51_no_integrase.json");
		List<BoundGenotype> results = HIVGenotypeReference.compareAll(
			seqX51.sequence, seqX51.firstNA, seqX51.lastNA);
		BoundGenotype primary = results.get(0);
		assertEquals("X51", primary.getGenotype().getIndexName());
		assertEquals("B", primary.getDisplayGenotype().getIndexName());

		seqX51 = TestSequence.loadResource("X51_full.json");
		results = HIVGenotypeReference.compareAll(<commit_msg>Re-enable the tests which were disabled accidently<commit_after>package edu.stanford.hivdb.genotyper;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

public class HIVGenotypeReferenceTest {

	@Test
	public void testCompareAll() {
		TestSequence seqX51 = TestSequence.loadResource("X51_full.json");
		List<BoundGenotype> results = HIVGenotypeReference.compareAll(
			seqX51.sequence, seqX51.firstNA, seqX51.lastNA);
		BoundGenotype primary = results.get(0);
		assertEquals("X51", primary.getGenotype().getIndexName());
		assertEquals("JN029801", primary.getReference().getAccession());
		assertEquals(66.0 / 2841, primary.getDistance(), 1e-10);
		assertEquals("B", results.get(1).getGenotype().getIndexName());
		
		// test boundary cases
		StringBuffer buf = new StringBuffer(seqX51.sequence);
		buf.setCharAt(0, 'A');
		buf.setCharAt(2840, 'C');
		results = HIVGenotypeReference.compareAll(
			buf.toString(), seqX51.firstNA, seqX51.lastNA);
		assertEquals(68.0 / 2841,results.get(0).getDistance(), 1e-10);
	}
	
	@Test
	public void testGetDisplayGenotype() {
		TestSequence seqX51 = TestSequence.loadResource("X51_no_integrase.json");
		List<BoundGenotype> results = HIVGenotypeReference.compareAll(
			seqX51.sequence, seqX51.firstNA, seqX51.lastNA);
		BoundGenotype primary = results.get(0);
		assertEquals("X51", primary.getGenotype().getIndexName());
		assertEquals("B", primary.getDisplayGenotype().getIndexName());

		seqX51 = TestSequence.loadResource("X51_full.json");
		results = HIVGenotypeReference.compareAll(
{'fraction_non_alphanumeric': 0.13785274083684723, 'fraction_numerical': 0.0447615958481998, 'mean_word_length': 5.883928571428571, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2894523', 'n_tokens_mistral': 1130, 'n_tokens_neox': 992, 'n_words': 167}