Skip to content

Commit

Permalink
Fix build error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ldgauthier committed Nov 7, 2018
1 parent 7322bfc commit b909de3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,22 @@
package org.broadinstitute.hellbender.tools.walkers;

import com.intel.genomicsdb.reader.GenomicsDBFeatureReader;
import htsjdk.tribble.AbstractFeatureReader;
import htsjdk.tribble.CloseableTribbleIterator;
import htsjdk.tribble.readers.LineIterator;
import htsjdk.tribble.readers.PositionalBufferedStream;
import htsjdk.variant.bcf2.BCF2Codec;
import htsjdk.variant.variantcontext.Genotype;
import htsjdk.variant.variantcontext.GenotypeBuilder;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.variantcontext.VariantContextBuilder;
import htsjdk.variant.vcf.VCFCodec;
import htsjdk.variant.vcf.VCFHeader;
import org.broadinstitute.hellbender.CommandLineProgramTest;
import org.broadinstitute.hellbender.Main;
import org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBConstants;
import org.broadinstitute.hellbender.tools.genomicsdb.GenomicsDBImport;
import org.broadinstitute.hellbender.utils.IntervalUtils;
import org.broadinstitute.hellbender.testutils.ArgumentsBuilder;
import org.broadinstitute.hellbender.testutils.GenomicsDBTestUtils;
import org.broadinstitute.hellbender.testutils.VariantContextTestUtils;
import org.broadinstitute.hellbender.utils.SimpleInterval;
import org.broadinstitute.hellbender.utils.Utils;
import org.broadinstitute.hellbender.utils.runtime.ProcessController;
import org.broadinstitute.hellbender.utils.test.ArgumentsBuilder;
import org.broadinstitute.hellbender.utils.test.BaseTest;
import org.broadinstitute.hellbender.utils.test.GenomicsDBTestUtils;
import org.broadinstitute.hellbender.utils.test.VariantContextTestUtils;
import org.broadinstitute.hellbender.utils.variant.GATKVariantContextUtils;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;

import static org.broadinstitute.hellbender.utils.test.VariantContextTestUtils.getVariantContexts;
import static org.testng.Assert.*;
import static org.broadinstitute.hellbender.testutils.VariantContextTestUtils.getVariantContexts;

/**
* Created by gauthier on 3/9/18.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.broadinstitute.hellbender.tools.walkers;

import htsjdk.variant.variantcontext.*;
import org.broadinstitute.hellbender.utils.test.VariantContextTestUtils;
import org.broadinstitute.hellbender.testutils.VariantContextTestUtils;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import java.util.*;

import static org.broadinstitute.hellbender.utils.test.VariantContextTestUtils.makeG;
import static org.broadinstitute.hellbender.utils.test.VariantContextTestUtils.makeGwithPLs;
import static org.broadinstitute.hellbender.utils.test.VariantContextTestUtils.makeVC;
import static org.broadinstitute.hellbender.testutils.VariantContextTestUtils.makeG;
import static org.broadinstitute.hellbender.testutils.VariantContextTestUtils.makeGwithPLs;
import static org.broadinstitute.hellbender.testutils.VariantContextTestUtils.makeVC;


@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -70,32 +70,17 @@ private int[] _mleparse(final List<Integer> s) {
*/
private Genotype makeGwithLog10GLs(final String sample, final Allele a1, final Allele a2, final double[] log10GLs) {
final Genotype gt = new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(log10GLs).make();
if ( log10GLs != null && log10GLs.length > 0 ) {
if (log10GLs != null && log10GLs.length > 0) {
Assert.assertNotNull(gt.getPL());
Assert.assertTrue(gt.getPL().length > 0);
for ( final int i : gt.getPL() ) {
for (final int i : gt.getPL()) {
Assert.assertTrue(i >= 0);
}
Assert.assertNotEquals(Arrays.toString(gt.getPL()),"[0]");
Assert.assertNotEquals(Arrays.toString(gt.getPL()), "[0]");
}
return gt;
}

private Genotype makeG(final String sample, final Allele a1, final Allele a2) {
return GenotypeBuilder.create(sample, Arrays.asList(a1, a2));
}

private Genotype makeG(final String sample, final Allele a1, final Allele a2, final int... pls) {
return new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make();
}

//NOTE: for deletions use the method makeDeletionVC so stop position validates
private VariantContext makeVC(final String source, final List<Allele> alleles, final Genotype... genotypes) {
final int start = 10;
final int stop = start;
return new VariantContextBuilder(source, "1", start, stop, alleles).genotypes(Arrays.asList(genotypes)).filters((String)null).make();
}

private VariantContext makeDeletionVC(final String source, final List<Allele> alleles, final int refLength, final Genotype... genotypes) {
final int start = 10;
final int stop = start+refLength-1;
Expand Down

0 comments on commit b909de3

Please sign in to comment.