/** * Tells this builder that the resulting VariantContext should use a GenotypeContext containing genotypes * @param genotypes */ public VariantContextBuilder genotypes(final Genotype ... genotypes) { return genotypes(GenotypesContext.copy(Arrays.asList(genotypes))); }
/** * Tells this builder that the resulting <code>VariantContext</code> should use a <code>GenotypeContext</code> containing genotypes * * Note that genotypes can be <code>null</code>, meaning there are no genotypes * * @param genotypes Collection of genotypes to set as genotypes for this builder */ public VariantContextBuilder genotypes(final Collection<Genotype> genotypes) { return genotypes(GenotypesContext.copy(genotypes)); }
/** * Tells this builder that the resulting <code>VariantContext</code> should use a <code>GenotypeContext</code> containing genotypes * @param genotypes genotypes to set as genotypes for this builder */ public VariantContextBuilder genotypes(final Genotype ... genotypes) { return genotypes(GenotypesContext.copy(Arrays.asList(genotypes))); }
/** * Tells this builder that the resulting <code>VariantContext</code> should use a <code>GenotypeContext</code> containing genotypes * @param genotypes genotypes to set as genotypes for this builder */ public VariantContextBuilder genotypes(final Genotype ... genotypes) { return genotypes(GenotypesContext.copy(Arrays.asList(genotypes))); }
@Override public GenotypesContext make(final List<Genotype> initialSamples) { return GenotypesContext.copy(initialSamples); }
/** * Tells this builder that the resulting VariantContext should use a GenotypeContext containing genotypes * * Note that genotypes can be null -> meaning there are no genotypes * * @param genotypes */ public VariantContextBuilder genotypes(final Collection<Genotype> genotypes) { return genotypes(GenotypesContext.copy(genotypes)); }
/** * Tells this builder that the resulting <code>VariantContext</code> should use a <code>GenotypeContext</code> containing genotypes * * Note that genotypes can be <code>null</code>, meaning there are no genotypes * * @param genotypes Collection of genotypes to set as genotypes for this builder */ public VariantContextBuilder genotypes(final Collection<Genotype> genotypes) { return genotypes(GenotypesContext.copy(genotypes)); }
public GenotypesContext calculatePosteriorGLs(final VariantContext vc){ final GenotypesContext genotypesContext = GenotypesContext.copy(vc.getGenotypes()); for (final Sample sample : trios) { Genotype mother = vc.getGenotype(sample.getMaternalID()); Genotype father = vc.getGenotype(sample.getPaternalID()); Genotype child = vc.getGenotype(sample.getID()); //Keep only trios and parent/child pairs if(mother == null && father == null || child == null) { logger.warn("Null genotypes in variant: "+vc.toStringDecodeGenotypes()); continue; } final ArrayList<Genotype> trioGenotypes = new ArrayList<>(3); updateFamilyGenotypes(vc, mother, father, child, trioGenotypes); //replace uses sample names to match genotypes, so order doesn't matter if (!trioGenotypes.isEmpty()) { genotypesContext.replace(trioGenotypes.get(0)); genotypesContext.replace(trioGenotypes.get(1)); genotypesContext.replace(trioGenotypes.get(2)); } } return genotypesContext; }
public VariantContext toVariantContext() { GenotypesContext gc = GenotypesContext.copy(this.genotypes.values()); return new VariantContextBuilder(name, contig, start, stop, alleles).id(id) .genotypes(gc).log10PError(log10PError).filters(filters).attributes(attributes).make(); }
@Override public LazyGenotypesContext.LazyData parse(final Object data) { GenotypesContext gc = GenotypesContext.copy((List<Genotype>)data); gc.ensureSampleNameMap(); gc.ensureSampleOrdering(); return new LazyGenotypesContext.LazyData(gc.notToBeDirectlyAccessedGenotypes, gc.sampleNamesInOrder, gc.sampleNameToOffset); }
if ( cfg.samples.contains(g3.getSampleName()) ) expectedGenotypes.add(g3); if ( cfg.samples.contains(g4.getSampleName()) ) expectedGenotypes.add(g4); GenotypesContext expectedGC = GenotypesContext.copy(expectedGenotypes);
final GenotypesContext genotypesContext = GenotypesContext.copy(vc.getGenotypes()); for (Sample sample : trios) { Genotype mother = vc.getGenotype(sample.getMaternalID());