Refine search
protected static Genotype create(final String sampleName, final List<Allele> alleles, final double[] gls) { return new GenotypeBuilder(sampleName, alleles).PL(gls).make(); }
public static Genotype create(final String sampleName, final List<Allele> alleles, final Map<String, Object> attributes) { return new GenotypeBuilder(sampleName, alleles).attributes(attributes).make(); }
protected static Genotype create(final String sampleName, final List<Allele> alleles, final double[] gls) { return new GenotypeBuilder(sampleName, alleles).PL(gls).make(); }
public static Genotype create(final String sampleName, final List<Allele> alleles, final Map<String, Object> attributes) { return new GenotypeBuilder(sampleName, alleles).attributes(attributes).make(); }
protected static Genotype create(final String sampleName, final List<Allele> alleles, final double[] gls) { return new GenotypeBuilder(sampleName, alleles).PL(gls).make(); }
private Genotype makeGenotype(final List<Allele> alleles, boolean phase) { final GenotypeBuilder gb = new GenotypeBuilder(DUMMY_NAME, alleles); gb.phased(phase); return gb.make(); }
public static Genotype create(final String sampleName, final List<Allele> alleles, final Map<String, Object> attributes) { return new GenotypeBuilder(sampleName, alleles).attributes(attributes).make(); }
public Genotype makePL(final List<Allele> expectedGT, int ... pls) { GenotypeBuilder gb = new GenotypeBuilder("sample" + sampleNameCounter++); gb.alleles(expectedGT); gb.PL(pls); return gb.make(); }
/** Augment genotype with the given filters and return modified GenotypeBuilder */ public Genotype gtWithAppliedFilters(Genotype gt) { GenotypeBuilder gtBuilder = new GenotypeBuilder(gt); ArrayList<String> filters = new ArrayList<>(); if (gt.isFiltered()) filters.add(gt.getFilters()); filters.addAll(getFiltersFor(gt)); gtBuilder.filters(filters); return gtBuilder.make(); }
private final Genotype fullyDecodeGenotypes(final Genotype g, final VCFHeader header) { final Map<String, Object> map = fullyDecodeAttributes(g.getExtendedAttributes(), header, true); return new GenotypeBuilder(g).attributes(map).make(); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testIncrementChromosomeCountsInfoCalledAltAllelesException() { int calledAlleles = 0; final Genotype genotype = new GenotypeBuilder().make(); calledAlleles = GATKVariantContextUtils.incrementChromosomeCountsInfo(null, calledAlleles, genotype); }
private static Genotype createGenotype(String name, double[] gls, int ploidy) { Allele[] alleles = new Allele[ploidy]; for (int i=0; i < ploidy; i++) alleles[i] = Allele.NO_CALL; return new GenotypeBuilder(name, Arrays.asList(alleles)).PL(gls).make(); }
private static Genotype attr(final String name, final Allele ref, final String key, final Object ... value) { if ( value.length == 0 ) return GenotypeBuilder.create(name, Arrays.asList(ref, ref)); else { final Object toAdd = value.length == 1 ? value[0] : Arrays.asList(value); return new GenotypeBuilder(name, Arrays.asList(ref, ref)).attribute(key, toAdd).make(); } }
@Test(expectedExceptions = UserException.class) public void testGetIndexesOfRelevantAllelesWithNoALT() { final List<Allele> alleles1 = new ArrayList<>(1); alleles1.add(Allele.create("A", true)); final List<Allele> alleles2 = new ArrayList<>(1); alleles2.add(Allele.create("A", true)); GenotypeBuilder builder = new GenotypeBuilder(); ReferenceConfidenceVariantContextMerger.getIndexesOfRelevantAlleles(alleles1, alleles2, -1, builder.make()); Assert.fail("We should have thrown an exception because the <ALT> allele was not present"); }
protected static Genotype makePL(final List<Allele> expectedGT, int ... pls) { GenotypeBuilder gb = new GenotypeBuilder("sample" + sampleNameCounter++); gb.alleles(expectedGT); gb.PL(pls); return gb.make(); }
private Genotype makeGwithPLs(String sample, Allele a1, Allele a2, double[] pls) { Genotype gt = new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make(); if ( pls != null && pls.length > 0 ) { Assert.assertNotNull(gt.getPL()); Assert.assertTrue(gt.getPL().length > 0); for ( int i : gt.getPL() ) { Assert.assertTrue(i >= 0); } Assert.assertNotEquals(Arrays.toString(gt.getPL()),"[0]"); } return gt; }
private Genotype makeGwithPLs(String sample, Allele a1, Allele a2, double[] pls) { Genotype gt = new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make(); if ( pls != null && pls.length > 0 ) { Assert.assertNotNull(gt.getPL()); Assert.assertTrue(gt.getPL().length > 0); for ( int i : gt.getPL() ) { Assert.assertTrue(i >= 0); } Assert.assertNotEquals(Arrays.toString(gt.getPL()),"[0]"); } return gt; }
private Genotype makeGwithPLs(String sample, Allele a1, Allele a2, double[] pls) { Genotype gt = new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make(); if (pls != null && pls.length > 0) { Assert.assertNotNull(gt.getPL()); Assert.assertTrue(gt.getPL().length > 0); for (int i : gt.getPL()) { Assert.assertTrue(i >= 0); } Assert.assertNotEquals(Arrays.toString(gt.getPL()), "[0]"); } return gt; }
private Genotype makeGwithPLs(String sample, Allele a1, Allele a2, double[] pls) { Genotype gt = new GenotypeBuilder(sample, Arrays.asList(a1, a2)).PL(pls).make(); if ( pls != null && pls.length > 0 ) { Assert.assertNotNull(gt.getPL()); Assert.assertTrue(gt.getPL().length > 0); for ( int i : gt.getPL() ) { Assert.assertTrue(i >= 0); } Assert.assertNotEquals(Arrays.toString(gt.getPL()),"[0]"); } return gt; }
@Requires("originalGenotypes != null && alleleMapper != null") protected static GenotypesContext updateGenotypesWithMappedAlleles(final GenotypesContext originalGenotypes, final AlleleMapper alleleMapper) { final GenotypesContext updatedGenotypes = GenotypesContext.create(originalGenotypes.size()); for ( final Genotype genotype : originalGenotypes ) { final List<Allele> updatedAlleles = alleleMapper.remap(genotype.getAlleles()); updatedGenotypes.add(new GenotypeBuilder(genotype).alleles(updatedAlleles).make()); } return updatedGenotypes; }