GenotypeCollection renamed to GenotypesContext

This commit is contained in:
Mark DePristo 2011-11-16 16:24:05 -05:00
parent 974daaca4d
commit aa0610ea92
33 changed files with 124 additions and 129 deletions

View File

@ -10,8 +10,6 @@ import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.classloader.PluginManager;
import org.broadinstitute.sting.utils.codecs.hapmap.RawHapMapFeature;
import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants;
import org.broadinstitute.sting.utils.codecs.vcf.VCFHeader;
import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLine;
import org.broadinstitute.sting.utils.variantcontext.*;
import java.util.*;
@ -195,7 +193,7 @@ public class VariantContextAdaptors {
return null; // we weren't given enough reference context to create the VariantContext
Byte refBaseForIndel = new Byte(ref.getBases()[index]);
GenotypeCollection genotypes = null;
GenotypesContext genotypes = null;
VariantContext vc = new VariantContext(name, dbsnp.getRsID(), dbsnp.getChr(), dbsnp.getStart() - (sawNullAllele ? 1 : 0), dbsnp.getEnd() - (refAllele.isNull() ? 1 : 0), alleles, genotypes, VariantContext.NO_NEG_LOG_10PERROR, null, attributes, refBaseForIndel);
return vc;
} else
@ -316,7 +314,7 @@ public class VariantContextAdaptors {
String[] samples = hapmap.getSampleIDs();
String[] genotypeStrings = hapmap.getGenotypes();
GenotypeCollection genotypes = GenotypeCollection.create(samples.length);
GenotypesContext genotypes = GenotypesContext.create(samples.length);
for ( int i = 0; i < samples.length; i++ ) {
// ignore bad genotypes
if ( genotypeStrings[i].contains("N") )

View File

@ -35,7 +35,7 @@ import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType;
import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine;
import org.broadinstitute.sting.utils.pileup.ReadBackedExtendedEventPileup;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.Arrays;
@ -55,7 +55,7 @@ public class AlleleBalance extends InfoFieldAnnotation {
if ( !vc.isBiallelic() )
return null;
final GenotypeCollection genotypes = vc.getGenotypes();
final GenotypesContext genotypes = vc.getGenotypes();
if ( !vc.hasGenotypes() )
return null;

View File

@ -11,7 +11,7 @@ import org.broadinstitute.sting.utils.QualityUtils;
import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType;
import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.Arrays;
@ -31,7 +31,7 @@ public class HardyWeinberg extends InfoFieldAnnotation implements WorkInProgress
public Map<String, Object> annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
final GenotypeCollection genotypes = vc.getGenotypes();
final GenotypesContext genotypes = vc.getGenotypes();
if ( genotypes == null || genotypes.size() < MIN_SAMPLES )
return null;

View File

@ -10,7 +10,7 @@ import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType;
import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.Arrays;
@ -33,7 +33,7 @@ public class InbreedingCoeff extends InfoFieldAnnotation implements StandardAnno
public Map<String, Object> annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
final GenotypeCollection genotypes = vc.getGenotypes();
final GenotypesContext genotypes = vc.getGenotypes();
if ( genotypes == null || genotypes.size() < MIN_SAMPLES )
return null;

View File

@ -9,7 +9,7 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnota
import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType;
import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.Arrays;
@ -29,7 +29,7 @@ public class QualByDepth extends InfoFieldAnnotation implements StandardAnnotati
if ( stratifiedContexts.size() == 0 )
return null;
final GenotypeCollection genotypes = vc.getGenotypes();
final GenotypesContext genotypes = vc.getGenotypes();
if ( genotypes == null || genotypes.size() == 0 )
return null;

View File

@ -13,7 +13,7 @@ import org.broadinstitute.sting.utils.collections.Pair;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.ArrayList;
@ -33,7 +33,7 @@ public abstract class RankSumTest extends InfoFieldAnnotation implements Standar
if ( stratifiedContexts.size() == 0 )
return null;
final GenotypeCollection genotypes = vc.getGenotypes();
final GenotypesContext genotypes = vc.getGenotypes();
if ( genotypes == null || genotypes.size() == 0 )
return null;

View File

@ -34,7 +34,7 @@ import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.*;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.*;
@ -225,11 +225,11 @@ public class VariantAnnotatorEngine {
}
}
private GenotypeCollection annotateGenotypes(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
private GenotypesContext annotateGenotypes(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
if ( requestedGenotypeAnnotations.size() == 0 )
return vc.getGenotypes();
GenotypeCollection genotypes = GenotypeCollection.create(vc.getNSamples());
GenotypesContext genotypes = GenotypesContext.create(vc.getNSamples());
for ( final Genotype genotype : vc.getGenotypes() ) {
AlignmentContext context = stratifiedContexts.get(genotype.getSampleName());
if ( context == null ) {

View File

@ -187,7 +187,7 @@ public class BeagleOutputToVCFWalker extends RodWalker<Integer, Integer> {
byte refByte = ref.getBase();
// make new Genotypes based on Beagle results
GenotypeCollection genotypes = GenotypeCollection.create(vc_input.getGenotypes().size());
GenotypesContext genotypes = GenotypesContext.create(vc_input.getGenotypes().size());
// for each genotype, create a new object with Beagle information on it
@ -196,7 +196,7 @@ public class BeagleOutputToVCFWalker extends RodWalker<Integer, Integer> {
Double alleleFrequencyH = 0.0;
int beagleVarCounts = 0;
GenotypeCollection hapmapGenotypes = null;
GenotypesContext hapmapGenotypes = null;
if (vc_comp != null) {
hapmapGenotypes = vc_comp.getGenotypes();

View File

@ -242,8 +242,8 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
}
if ( markers != null ) markers.append("\n");
GenotypeCollection preferredGenotypes = preferredVC.getGenotypes();
GenotypeCollection otherGenotypes = goodSite(otherVC) ? otherVC.getGenotypes() : null;
GenotypesContext preferredGenotypes = preferredVC.getGenotypes();
GenotypesContext otherGenotypes = goodSite(otherVC) ? otherVC.getGenotypes() : null;
for ( String sample : samples ) {
boolean isMaleOnChrX = CHECK_IS_MALE_ON_CHR_X && getSample(sample).getGender() == Gender.MALE;

View File

@ -37,7 +37,7 @@ import org.broadinstitute.sting.utils.SampleUtils;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContextUtils;
@ -283,11 +283,11 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
VariantContext vc = context.getVariantContext();
// make new Genotypes based on filters
GenotypeCollection genotypes;
GenotypesContext genotypes;
if ( genotypeFilterExps.size() == 0 ) {
genotypes = null;
} else {
genotypes = GenotypeCollection.create(vc.getGenotypes().size());
genotypes = GenotypesContext.create(vc.getGenotypes().size());
// for each genotype, check filters then create a new object
for ( final Genotype g : vc.getGenotypes() ) {

View File

@ -27,13 +27,11 @@ package org.broadinstitute.sting.gatk.walkers.genotyper;
import org.apache.log4j.Logger;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.PrintStream;
import java.util.List;
import java.util.Map;
/**
@ -69,7 +67,7 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable {
* @param log10AlleleFrequencyPriors priors
* @param log10AlleleFrequencyPosteriors array (pre-allocated) to store results
*/
protected abstract void getLog10PNonRef(GenotypeCollection GLs, List<Allele> Alleles,
protected abstract void getLog10PNonRef(GenotypesContext GLs, List<Allele> Alleles,
double[] log10AlleleFrequencyPriors,
double[] log10AlleleFrequencyPosteriors);
@ -81,7 +79,7 @@ public abstract class AlleleFrequencyCalculationModel implements Cloneable {
*
* @return calls
*/
protected abstract GenotypeCollection assignGenotypes(VariantContext vc,
protected abstract GenotypesContext assignGenotypes(VariantContext vc,
double[] log10AlleleFrequencyPosteriors,
int AFofMaxLikelihood);
}

View File

@ -31,7 +31,7 @@ import org.broadinstitute.sting.utils.Utils;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.PrintStream;
@ -50,7 +50,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
super(UAC, N, logger, verboseWriter);
}
public void getLog10PNonRef(GenotypeCollection GLs, List<Allele> alleles,
public void getLog10PNonRef(GenotypesContext GLs, List<Allele> alleles,
double[] log10AlleleFrequencyPriors,
double[] log10AlleleFrequencyPosteriors) {
final int numAlleles = alleles.size();
@ -94,7 +94,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
}
}
private static final ArrayList<double[]> getGLs(GenotypeCollection GLs) {
private static final ArrayList<double[]> getGLs(GenotypesContext GLs) {
ArrayList<double[]> genotypeLikelihoods = new ArrayList<double[]>();
genotypeLikelihoods.add(new double[]{0.0,0.0,0.0}); // dummy
@ -154,7 +154,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
}
}
public int linearExact(GenotypeCollection GLs,
public int linearExact(GenotypesContext GLs,
double[] log10AlleleFrequencyPriors,
double[] log10AlleleFrequencyPosteriors, int idxAA, int idxAB, int idxBB) {
final ArrayList<double[]> genotypeLikelihoods = getGLs(GLs);
@ -267,14 +267,14 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
*
* @return calls
*/
public GenotypeCollection assignGenotypes(VariantContext vc,
public GenotypesContext assignGenotypes(VariantContext vc,
double[] log10AlleleFrequencyPosteriors,
int AFofMaxLikelihood) {
if ( !vc.isVariant() )
throw new UserException("The VCF record passed in does not contain an ALT allele at " + vc.getChr() + ":" + vc.getStart());
GenotypeCollection GLs = vc.getGenotypes();
GenotypesContext GLs = vc.getGenotypes();
double[][] pathMetricArray = new double[GLs.size()+1][AFofMaxLikelihood+1];
int[][] tracebackArray = new int[GLs.size()+1][AFofMaxLikelihood+1];
@ -341,7 +341,7 @@ public class ExactAFCalculationModel extends AlleleFrequencyCalculationModel {
}
}
GenotypeCollection calls = GenotypeCollection.create();
GenotypesContext calls = GenotypesContext.create();
int startIdx = AFofMaxLikelihood;
for (int k = sampleIdx; k > 0; k--) {

View File

@ -36,7 +36,7 @@ import org.broadinstitute.sting.utils.SampleUtils;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContextUtils;
@ -129,7 +129,7 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
return null;
VariantContext variantVC = null;
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
for ( VariantContext vc : VCs ) {
if ( variantVC == null && vc.isVariant() )
variantVC = vc;
@ -143,8 +143,8 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
return new VariantContext("VCwithGLs", VCFConstants.EMPTY_ID_FIELD, variantVC.getChr(), variantVC.getStart(), variantVC.getEnd(), variantVC.getAlleles(), genotypes, VariantContext.NO_NEG_LOG_10PERROR, null, null);
}
private static GenotypeCollection getGenotypesWithGLs(GenotypeCollection genotypes) {
GenotypeCollection genotypesWithGLs = GenotypeCollection.create(genotypes.size());
private static GenotypesContext getGenotypesWithGLs(GenotypesContext genotypes) {
GenotypesContext genotypesWithGLs = GenotypesContext.create(genotypes.size());
for ( final Genotype g : genotypes ) {
if ( g.hasLikelihoods() && g.getLikelihoods().getAsVector() != null )
genotypesWithGLs.add(g);

View File

@ -265,7 +265,7 @@ public class UnifiedGenotyperEngine {
alleles.add(refAllele);
boolean addedAltAlleles = false;
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
for ( MultiallelicGenotypeLikelihoods GL : GLs.values() ) {
if ( !addedAltAlleles ) {
addedAltAlleles = true;
@ -354,7 +354,7 @@ public class UnifiedGenotyperEngine {
}
// create the genotypes
GenotypeCollection genotypes = afcm.get().assignGenotypes(vc, log10AlleleFrequencyPosteriors.get(), bestAFguess);
GenotypesContext genotypes = afcm.get().assignGenotypes(vc, log10AlleleFrequencyPosteriors.get(), bestAFguess);
// print out stats if we have a writer
if ( verboseWriter != null )
@ -491,7 +491,7 @@ public class UnifiedGenotyperEngine {
}
// create the genotypes
GenotypeCollection genotypes = afcm.get().assignGenotypes(vc, log10AlleleFrequencyPosteriors.get(), bestAFguess);
GenotypesContext genotypes = afcm.get().assignGenotypes(vc, log10AlleleFrequencyPosteriors.get(), bestAFguess);
// *** note that calculating strand bias involves overwriting data structures, so we do that last
HashMap<String, Object> attributes = new HashMap<String, Object>();

View File

@ -60,7 +60,7 @@ import org.broadinstitute.sting.utils.sam.AlignmentUtils;
import org.broadinstitute.sting.utils.sam.GATKSAMRecord;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.*;
@ -1058,7 +1058,7 @@ public class SomaticIndelDetectorWalker extends ReadWalker<Integer,Integer> {
stop += event_length;
}
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
for ( String sample : normalSamples ) {
Map<String,Object> attrs = call.makeStatsAttributes(null);
@ -1147,7 +1147,7 @@ public class SomaticIndelDetectorWalker extends ReadWalker<Integer,Integer> {
homRefAlleles.add( alleles.get(0));
homRefAlleles.add( alleles.get(0));
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
for ( String sample : normalSamples ) {
genotypes.add(new Genotype(sample, homRefN ? homRefAlleles : alleles,Genotype.NO_NEG_LOG_10PERROR,null,attrsNormal,false));

View File

@ -293,7 +293,7 @@ public class PhaseByTransmission extends RodWalker<Integer, Integer> {
if (tracker != null) {
VariantContext vc = tracker.getFirstValue(variantCollection.variants, context.getLocation());
GenotypeCollection genotypeCollection = GenotypeCollection.create(vc.getGenotypes().size());
GenotypesContext genotypesContext = GenotypesContext.create(vc.getGenotypes().size());
for (Trio trio : trios) {
Genotype mother = vc.getGenotype(trio.getMother());
@ -306,10 +306,10 @@ public class PhaseByTransmission extends RodWalker<Integer, Integer> {
Genotype phasedFather = trioGenotypes.get(1);
Genotype phasedChild = trioGenotypes.get(2);
genotypeCollection.add(phasedMother, phasedFather, phasedChild);
genotypesContext.add(phasedMother, phasedFather, phasedChild);
}
VariantContext newvc = VariantContext.modifyGenotypes(vc, genotypeCollection);
VariantContext newvc = VariantContext.modifyGenotypes(vc, genotypesContext);
vcfWriter.add(newvc);
}

View File

@ -88,7 +88,7 @@ class PhasingUtils {
}
MergedAllelesData mergeData = new MergedAllelesData(intermediateBases, vc1, vc2); // ensures that the reference allele is added
GenotypeCollection mergedGenotypes = GenotypeCollection.create();
GenotypesContext mergedGenotypes = GenotypesContext.create();
for (final Genotype gt1 : vc1.getGenotypes()) {
Genotype gt2 = vc2.getGenotype(gt1.getSampleName());

View File

@ -352,7 +352,7 @@ public class ReadBackedPhasingWalker extends RodWalker<PhasingStatsAndOutput, Ph
UnfinishedVariantContext uvc = uvr.unfinishedVariant;
// Perform per-sample phasing:
GenotypeCollection sampGenotypes = vc.getGenotypes();
GenotypesContext sampGenotypes = vc.getGenotypes();
Map<String, PhaseCounts> samplePhaseStats = new TreeMap<String, PhaseCounts>();
for (final Genotype gt : sampGenotypes) {
String samp = gt.getSampleName();
@ -1122,7 +1122,7 @@ public class ReadBackedPhasingWalker extends RodWalker<PhasingStatsAndOutput, Ph
private int start;
private int stop;
private Collection<Allele> alleles;
private GenotypeCollection genotypes;
private GenotypesContext genotypes;
private double negLog10PError;
private Set<String> filters;
private Map<String, Object> attributes;
@ -1135,7 +1135,7 @@ public class ReadBackedPhasingWalker extends RodWalker<PhasingStatsAndOutput, Ph
this.start = vc.getStart();
this.stop = vc.getEnd();
this.alleles = vc.getAlleles();
this.genotypes = GenotypeCollection.copy(vc.getGenotypes()); // since vc.getGenotypes() is unmodifiable
this.genotypes = GenotypesContext.copy(vc.getGenotypes()); // since vc.getGenotypes() is unmodifiable
this.negLog10PError = vc.getNegLog10PError();
this.filters = vc.filtersWereApplied() ? vc.getFilters() : null;
this.attributes = new HashMap<String, Object>(vc.getAttributes());

View File

@ -14,7 +14,7 @@ import org.broadinstitute.sting.gatk.walkers.varianteval.util.TableType;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.HashMap;
@ -92,13 +92,13 @@ public class GenotypePhasingEvaluator extends VariantEvaluator {
Set<String> allSamples = new HashSet<String>();
GenotypeCollection compSampGenotypes = null;
GenotypesContext compSampGenotypes = null;
if (isRelevantToPhasing(comp)) {
allSamples.addAll(comp.getSampleNames());
compSampGenotypes = comp.getGenotypes();
}
GenotypeCollection evalSampGenotypes = null;
GenotypesContext evalSampGenotypes = null;
if (isRelevantToPhasing(eval)) {
allSamples.addAll(eval.getSampleNames());
evalSampGenotypes = eval.getGenotypes();

View File

@ -40,7 +40,7 @@ import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.sam.AlignmentUtils;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.*;
@ -211,7 +211,7 @@ public class LeftAlignVariants extends RodWalker<Integer, Integer> {
}
// create new Genotype objects
GenotypeCollection newGenotypes = GenotypeCollection.create(vc.getNSamples());
GenotypesContext newGenotypes = GenotypesContext.create(vc.getNSamples());
for ( final Genotype genotype : vc.getGenotypes() ) {
List<Allele> newAlleles = new ArrayList<Allele>();
for ( Allele allele : genotype.getAlleles() ) {

View File

@ -556,7 +556,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
return (compVCs == null || compVCs.isEmpty());
// check if we find it in the variant rod
GenotypeCollection genotypes = vc.getGenotypes(samples);
GenotypesContext genotypes = vc.getGenotypes(samples);
for (final Genotype g : genotypes) {
if (sampleHasVariant(g)) {
// There is a variant called (or filtered with not exclude filtered option set) that is not HomRef for at least one of the samples.

View File

@ -128,7 +128,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
// set the appropriate sample name if necessary
if ( sampleName != null && vc.hasGenotypes() && vc.hasGenotype(variants.getName()) ) {
Genotype g = Genotype.modifyName(vc.getGenotype(variants.getName()), sampleName);
GenotypeCollection genotypes = GenotypeCollection.create(g);
GenotypesContext genotypes = GenotypesContext.create(g);
vc = VariantContext.modifyGenotypes(vc, genotypes);
}

View File

@ -11,7 +11,7 @@ import org.broad.tribble.util.ParsingUtils;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.*;
@ -76,7 +76,7 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec,
* @param pos position
* @return a mapping of sample name to genotype object
*/
public abstract GenotypeCollection createGenotypeMap(String str, List<Allele> alleles, String chr, int pos);
public abstract GenotypesContext createGenotypeMap(String str, List<Allele> alleles, String chr, int pos);
/**

View File

@ -5,7 +5,7 @@ import org.broad.tribble.readers.LineReader;
import org.broad.tribble.util.ParsingUtils;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.File;
@ -118,13 +118,13 @@ public class VCF3Codec extends AbstractVCFCodec {
* @param pos position
* @return a mapping of sample name to genotype object
*/
public GenotypeCollection createGenotypeMap(String str, List<Allele> alleles, String chr, int pos) {
public GenotypesContext createGenotypeMap(String str, List<Allele> alleles, String chr, int pos) {
if (genotypeParts == null)
genotypeParts = new String[header.getColumnCount() - NUM_STANDARD_FIELDS];
int nParts = ParsingUtils.split(str, genotypeParts, VCFConstants.FIELD_SEPARATOR_CHAR);
GenotypeCollection genotypes = GenotypeCollection.create(nParts);
GenotypesContext genotypes = GenotypesContext.create(nParts);
// get the format keys
int nGTKeys = ParsingUtils.split(genotypeParts[0], genotypeKeyArray, VCFConstants.GENOTYPE_FIELD_SEPARATOR_CHAR);

View File

@ -5,7 +5,7 @@ import org.broad.tribble.readers.LineReader;
import org.broad.tribble.util.ParsingUtils;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.File;
@ -145,13 +145,13 @@ public class VCFCodec extends AbstractVCFCodec {
* @param alleles the list of alleles
* @return a mapping of sample name to genotype object
*/
public GenotypeCollection createGenotypeMap(String str, List<Allele> alleles, String chr, int pos) {
public GenotypesContext createGenotypeMap(String str, List<Allele> alleles, String chr, int pos) {
if (genotypeParts == null)
genotypeParts = new String[header.getColumnCount() - NUM_STANDARD_FIELDS];
int nParts = ParsingUtils.split(str, genotypeParts, VCFConstants.FIELD_SEPARATOR_CHAR);
GenotypeCollection genotypes = GenotypeCollection.create(nParts);
GenotypesContext genotypes = GenotypesContext.create(nParts);
// get the format keys
int nGTKeys = ParsingUtils.split(genotypeParts[0], genotypeKeyArray, VCFConstants.GENOTYPE_FIELD_SEPARATOR_CHAR);

View File

@ -1,7 +1,7 @@
package org.broadinstitute.sting.utils.codecs.vcf;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import java.util.List;
@ -19,6 +19,6 @@ public interface VCFParser {
* @param pos position
* @return a mapping of sample name to genotype object
*/
public GenotypeCollection createGenotypeMap(String str, List<Allele> alleles, String chr, int pos);
public GenotypesContext createGenotypeMap(String str, List<Allele> alleles, String chr, int pos);
}

View File

@ -29,7 +29,7 @@ import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.*;
@ -147,16 +147,16 @@ public class GCF {
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("INFO", info);
Byte refPadByte = refPad == 0 ? null : refPad;
GenotypeCollection genotypes = decodeGenotypes(header);
GenotypesContext genotypes = decodeGenotypes(header);
return new VariantContext(source, VCFConstants.EMPTY_ID_FIELD, contig, start, stop, alleleMap, genotypes, negLog10PError, filters, attributes, refPadByte);
}
private GenotypeCollection decodeGenotypes(final GCFHeader header) {
private GenotypesContext decodeGenotypes(final GCFHeader header) {
if ( genotypes.isEmpty() )
return VariantContext.NO_GENOTYPES;
else {
GenotypeCollection map = GenotypeCollection.create(genotypes.size());
GenotypesContext map = GenotypesContext.create(genotypes.size());
for ( int i = 0; i < genotypes.size(); i++ ) {
final String sampleName = header.getSample(i);

View File

@ -29,9 +29,9 @@ import java.util.*;
/**
*
*/
public class GenotypeCollection implements List<Genotype> {
public final static GenotypeCollection NO_GENOTYPES =
new GenotypeCollection(new ArrayList<Genotype>(0), new HashMap<String, Integer>(0), new HashSet<String>(0), true);
public class GenotypesContext implements List<Genotype> {
public final static GenotypesContext NO_GENOTYPES =
new GenotypesContext(new ArrayList<Genotype>(0), new HashMap<String, Integer>(0), new HashSet<String>(0), true);
Set<String> sampleNamesInOrder = null;
Map<String, Integer> sampleNameToOffset = null;
@ -45,25 +45,25 @@ public class GenotypeCollection implements List<Genotype> {
//
// ---------------------------------------------------------------------------
private GenotypeCollection() {
private GenotypesContext() {
this(10, false);
}
private GenotypeCollection(final int n, final boolean immutable) {
private GenotypesContext(final int n, final boolean immutable) {
this(new ArrayList<Genotype>(n), immutable);
}
private GenotypeCollection(final ArrayList<Genotype> genotypes, final boolean immutable) {
private GenotypesContext(final ArrayList<Genotype> genotypes, final boolean immutable) {
this.genotypes = genotypes;
this.immutable = immutable;
this.sampleNameToOffset = null;
this.cacheIsInvalid = true;
}
private GenotypeCollection(final ArrayList<Genotype> genotypes,
final Map<String, Integer> sampleNameToOffset,
final Set<String> sampleNamesInOrder,
final boolean immutable) {
private GenotypesContext(final ArrayList<Genotype> genotypes,
final Map<String, Integer> sampleNameToOffset,
final Set<String> sampleNamesInOrder,
final boolean immutable) {
this.genotypes = genotypes;
this.immutable = immutable;
this.sampleNameToOffset = sampleNameToOffset;
@ -77,27 +77,27 @@ public class GenotypeCollection implements List<Genotype> {
//
// ---------------------------------------------------------------------------
public static final GenotypeCollection create() {
return new GenotypeCollection();
public static final GenotypesContext create() {
return new GenotypesContext();
}
public static final GenotypeCollection create(final int nGenotypes) {
return new GenotypeCollection(nGenotypes, false);
public static final GenotypesContext create(final int nGenotypes) {
return new GenotypesContext(nGenotypes, false);
}
public static final GenotypeCollection create(final ArrayList<Genotype> genotypes) {
return genotypes == null ? NO_GENOTYPES : new GenotypeCollection(genotypes, false);
public static final GenotypesContext create(final ArrayList<Genotype> genotypes) {
return genotypes == null ? NO_GENOTYPES : new GenotypesContext(genotypes, false);
}
public static final GenotypeCollection create(final Genotype... genotypes) {
return new GenotypeCollection(new ArrayList<Genotype>(Arrays.asList(genotypes)), false);
public static final GenotypesContext create(final Genotype... genotypes) {
return new GenotypesContext(new ArrayList<Genotype>(Arrays.asList(genotypes)), false);
}
public static final GenotypeCollection copy(final GenotypeCollection toCopy) {
public static final GenotypesContext copy(final GenotypesContext toCopy) {
return create(new ArrayList<Genotype>(toCopy.genotypes));
}
public static final GenotypeCollection copy(final Collection<Genotype> toCopy) {
public static final GenotypesContext copy(final Collection<Genotype> toCopy) {
return toCopy == null ? NO_GENOTYPES : create(new ArrayList<Genotype>(toCopy));
}
@ -123,7 +123,7 @@ public class GenotypeCollection implements List<Genotype> {
//
// ---------------------------------------------------------------------------
public final GenotypeCollection immutable() {
public final GenotypesContext immutable() {
this.genotypes = Collections.unmodifiableList(genotypes);
immutable = true;
return this;
@ -369,17 +369,17 @@ public class GenotypeCollection implements List<Genotype> {
return getSampleNames().containsAll(samples);
}
public GenotypeCollection subsetToSamples( final Collection<String> samples ) {
public GenotypesContext subsetToSamples( final Collection<String> samples ) {
return subsetToSamples(new HashSet<String>(samples));
}
public GenotypeCollection subsetToSamples( final Set<String> samples ) {
public GenotypesContext subsetToSamples( final Set<String> samples ) {
if ( samples.size() == genotypes.size() )
return this;
else if ( samples.isEmpty() )
return NO_GENOTYPES;
else {
GenotypeCollection subset = create(samples.size());
GenotypesContext subset = create(samples.size());
for ( final Genotype g : genotypes ) {
if ( samples.contains(g.getSampleName()) ) {
subset.add(g);

View File

@ -7,7 +7,6 @@ import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants;
import org.broadinstitute.sting.utils.codecs.vcf.VCFParser;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import java.lang.reflect.Array;
import java.util.*;
/**
@ -188,12 +187,12 @@ public class VariantContext implements Feature { // to enable tribble intergrati
final protected List<Allele> alleles;
/** A mapping from sampleName -> genotype objects for all genotypes associated with this context */
protected GenotypeCollection genotypes = null;
protected GenotypesContext genotypes = null;
/** Counts for each of the possible Genotype types in this context */
protected int[] genotypeCounts = null;
public final static GenotypeCollection NO_GENOTYPES = GenotypeCollection.NO_GENOTYPES;
public final static GenotypesContext NO_GENOTYPES = GenotypesContext.NO_GENOTYPES;
// a fast cached access point to the ref / alt alleles for biallelic case
private Allele REF = null;
@ -226,12 +225,12 @@ public class VariantContext implements Feature { // to enable tribble intergrati
* @param attributes attributes
* @param referenceBaseForIndel padded reference base
*/
public VariantContext(String source, String ID, String contig, long start, long stop, Collection<Allele> alleles, GenotypeCollection genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes, Byte referenceBaseForIndel) {
public VariantContext(String source, String ID, String contig, long start, long stop, Collection<Allele> alleles, GenotypesContext genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes, Byte referenceBaseForIndel) {
this(source, ID, contig, start, stop, alleles, genotypes, negLog10PError, filters, attributes, referenceBaseForIndel, false, true);
}
@Deprecated
public VariantContext(String source, String contig, long start, long stop, Collection<Allele> alleles, GenotypeCollection genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes, Byte referenceBaseForIndel) {
public VariantContext(String source, String contig, long start, long stop, Collection<Allele> alleles, GenotypesContext genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes, Byte referenceBaseForIndel) {
this(source, VCFConstants.EMPTY_ID_FIELD, contig, start, stop, alleles, genotypes, negLog10PError, filters, attributes, referenceBaseForIndel);
}
@ -249,12 +248,12 @@ public class VariantContext implements Feature { // to enable tribble intergrati
* @param filters filters: use null for unfiltered and empty set for passes filters
* @param attributes attributes
*/
public VariantContext(String source, String ID, String contig, long start, long stop, Collection<Allele> alleles, GenotypeCollection genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
public VariantContext(String source, String ID, String contig, long start, long stop, Collection<Allele> alleles, GenotypesContext genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
this(source, ID, contig, start, stop, alleles, genotypes, negLog10PError, filters, attributes, null, false, true);
}
@Deprecated
public VariantContext(String source, String contig, long start, long stop, Collection<Allele> alleles, GenotypeCollection genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
public VariantContext(String source, String contig, long start, long stop, Collection<Allele> alleles, GenotypesContext genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
this(source, VCFConstants.EMPTY_ID_FIELD, contig, start, stop, alleles, genotypes, negLog10PError, filters, attributes);
}
@ -299,14 +298,14 @@ public class VariantContext implements Feature { // to enable tribble intergrati
*/
public VariantContext(String source, String ID, String contig, long start, long stop, Collection<Allele> alleles, Collection<Genotype> genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
this(source, ID, contig, start, stop, alleles,
GenotypeCollection.copy(genotypes),
GenotypesContext.copy(genotypes),
negLog10PError, filters, attributes, null, false, true);
}
@Deprecated
public VariantContext(String source, String contig, long start, long stop, Collection<Allele> alleles, Collection<Genotype> genotypes, double negLog10PError, Set<String> filters, Map<String, Object> attributes) {
this(source, VCFConstants.EMPTY_ID_FIELD, contig, start, stop, alleles,
GenotypeCollection.copy(genotypes),
GenotypesContext.copy(genotypes),
negLog10PError, filters, attributes);
}
@ -374,7 +373,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
*/
private VariantContext(String source, String ID,
String contig, long start, long stop,
Collection<Allele> alleles, GenotypeCollection genotypes,
Collection<Allele> alleles, GenotypesContext genotypes,
double negLog10PError, Set<String> filters, Map<String, Object> attributes,
Byte referenceBaseForIndel, boolean genotypesAreUnparsed,
boolean performValidation ) {
@ -445,7 +444,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
//
// ---------------------------------------------------------------------------------------------------------
public static VariantContext modifyGenotypes(VariantContext vc, GenotypeCollection genotypes) {
public static VariantContext modifyGenotypes(VariantContext vc, GenotypesContext genotypes) {
VariantContext modifiedVC = new VariantContext(vc.getSource(), vc.getID(), vc.getChr(), vc.getStart(), vc.getEnd(), vc.getAlleles(), genotypes, vc.getNegLog10PError(), vc.filtersWereApplied() ? vc.getFilters() : null, vc.getAttributes(), vc.getReferenceBaseForIndel(), false, false);
modifiedVC.validateGenotypes();
return modifiedVC;
@ -544,7 +543,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
public VariantContext subContextFromSamples(Set<String> sampleNames, Collection<Allele> alleles) {
loadGenotypes();
GenotypeCollection newGenotypes = genotypes.subsetToSamples(sampleNames);
GenotypesContext newGenotypes = genotypes.subsetToSamples(sampleNames);
return new VariantContext(getSource(), getID(), contig, start, stop, alleles,
newGenotypes,
getNegLog10PError(),
@ -555,7 +554,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
public VariantContext subContextFromSamples(Set<String> sampleNames) {
loadGenotypes();
GenotypeCollection newGenotypes = genotypes.subsetToSamples(sampleNames);
GenotypesContext newGenotypes = genotypes.subsetToSamples(sampleNames);
return new VariantContext(getSource(), getID(), contig, start, stop, allelesOfGenotypes(newGenotypes),
newGenotypes,
getNegLog10PError(),
@ -981,7 +980,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
/**
* @return set of all Genotypes associated with this context
*/
public GenotypeCollection getGenotypes() {
public GenotypesContext getGenotypes() {
loadGenotypes();
return genotypes;
}
@ -999,7 +998,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
* @return
* @throws IllegalArgumentException if sampleName isn't bound to a genotype
*/
public GenotypeCollection getGenotypes(String sampleName) {
public GenotypesContext getGenotypes(String sampleName) {
return getGenotypes(Arrays.asList(sampleName));
}
@ -1011,11 +1010,11 @@ public class VariantContext implements Feature { // to enable tribble intergrati
* @return
* @throws IllegalArgumentException if sampleName isn't bound to a genotype
*/
public GenotypeCollection getGenotypes(Collection<String> sampleNames) {
public GenotypesContext getGenotypes(Collection<String> sampleNames) {
return getGenotypes().subsetToSamples(sampleNames);
}
public GenotypeCollection getGenotypes(Set<String> sampleNames) {
public GenotypesContext getGenotypes(Set<String> sampleNames) {
return getGenotypes().subsetToSamples(sampleNames);
}
@ -1567,7 +1566,7 @@ public class VariantContext implements Feature { // to enable tribble intergrati
}
// now we can recreate new genotypes with trimmed alleles
GenotypeCollection genotypes = GenotypeCollection.create(inputVC.getNSamples());
GenotypesContext genotypes = GenotypesContext.create(inputVC.getNSamples());
for (final Genotype g : inputVC.getGenotypes() ) {
List<Allele> inAlleles = g.getAlleles();
List<Allele> newGenotypeAlleles = new ArrayList<Allele>(g.getAlleles().size());

View File

@ -294,7 +294,7 @@ public class VariantContextUtils {
final Map<String, Object> attributes = subsetAttributes(vc.commonInfo, keysToPreserve);
// Genotypes
final GenotypeCollection genotypes = GenotypeCollection.create(vc.getNSamples());
final GenotypesContext genotypes = GenotypesContext.create(vc.getNSamples());
for ( final Genotype g : vc.getGenotypes() ) {
Map<String, Object> genotypeAttributes = subsetAttributes(g.commonInfo, keysToPreserve);
genotypes.add(new Genotype(g.getSampleName(), g.getAlleles(), g.getNegLog10PError(), g.getFilters(),
@ -402,7 +402,7 @@ public class VariantContextUtils {
double negLog10PError = -1;
VariantContext vcWithMaxAC = null;
Set<String> addedSamples = new HashSet<String>(first.getNSamples());
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
// counting the number of filtered and variant VCs
int nFiltered = 0;
@ -590,7 +590,7 @@ public class VariantContextUtils {
// nothing to do if we don't need to trim bases
if (trimVC) {
List<Allele> alleles = new ArrayList<Allele>();
GenotypeCollection genotypes = GenotypeCollection.create();
GenotypesContext genotypes = GenotypesContext.create();
// set the reference base for indels in the attributes
Map<String,Object> attributes = new TreeMap<String,Object>(inputVC.getAttributes());
@ -644,8 +644,8 @@ public class VariantContextUtils {
return inputVC;
}
public static GenotypeCollection stripPLs(GenotypeCollection genotypes) {
GenotypeCollection newGs = GenotypeCollection.create(genotypes.size());
public static GenotypesContext stripPLs(GenotypesContext genotypes) {
GenotypesContext newGs = GenotypesContext.create(genotypes.size());
for ( final Genotype g : genotypes ) {
newGs.add(g.hasLikelihoods() ? removePLs(g) : g);
@ -825,7 +825,7 @@ public class VariantContextUtils {
}
}
private static void mergeGenotypes(GenotypeCollection mergedGenotypes, Set<String> addedSamples, VariantContext oneVC, AlleleMapper alleleMapping, boolean uniqifySamples) {
private static void mergeGenotypes(GenotypesContext mergedGenotypes, Set<String> addedSamples, VariantContext oneVC, AlleleMapper alleleMapping, boolean uniqifySamples) {
for ( Genotype g : oneVC.getGenotypes() ) {
String name = mergedSampleName(oneVC.getSource(), g.getSampleName(), uniqifySamples);
if ( ! addedSamples.contains(name) ) {
@ -866,7 +866,7 @@ public class VariantContextUtils {
}
// create new Genotype objects
GenotypeCollection newGenotypes = GenotypeCollection.create(vc.getNSamples());
GenotypesContext newGenotypes = GenotypesContext.create(vc.getNSamples());
for ( final Genotype genotype : vc.getGenotypes() ) {
List<Allele> newAlleles = new ArrayList<Allele>();
for ( Allele allele : genotype.getAlleles() ) {
@ -886,7 +886,7 @@ public class VariantContextUtils {
if ( allowedAttributes == null )
return vc;
GenotypeCollection newGenotypes = GenotypeCollection.create(vc.getNSamples());
GenotypesContext newGenotypes = GenotypesContext.create(vc.getNSamples());
for ( final Genotype genotype : vc.getGenotypes() ) {
Map<String, Object> attrs = new HashMap<String, Object>();
for ( Map.Entry<String, Object> attr : genotype.getAttributes().entrySet() ) {

View File

@ -4,7 +4,7 @@ import org.broad.tribble.Tribble;
import org.broad.tribble.readers.AsciiLineReader;
import org.broadinstitute.sting.utils.variantcontext.Allele;
import org.broadinstitute.sting.utils.variantcontext.Genotype;
import org.broadinstitute.sting.utils.variantcontext.GenotypeCollection;
import org.broadinstitute.sting.utils.variantcontext.GenotypesContext;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
@ -122,7 +122,7 @@ public class VCFWriterUnitTest extends BaseTest {
List<Allele> alleles = new ArrayList<Allele>();
Set<String> filters = null;
Map<String, Object> attributes = new HashMap<String,Object>();
GenotypeCollection genotypes = GenotypeCollection.create(header.getGenotypeSamples().size());
GenotypesContext genotypes = GenotypesContext.create(header.getGenotypeSamples().size());
alleles.add(Allele.create("-",true));
alleles.add(Allele.create("CC",false));

View File

@ -226,7 +226,7 @@ public class VariantContextBenchmark extends SimpleBenchmark {
List<VariantContext> toMerge = new ArrayList<VariantContext>();
for ( int i = 0; i < dupsToMerge; i++ ) {
GenotypeCollection gc = GenotypeCollection.create(vc.getNSamples());
GenotypesContext gc = GenotypesContext.create(vc.getNSamples());
for ( final Genotype g : vc.getGenotypes() ) {
gc.add(new Genotype(g.getSampleName()+"_"+i, g));
}

View File

@ -100,7 +100,7 @@ public class VariantContextUtilsUnitTest extends BaseTest {
int start = 10;
int stop = start; // alleles.contains(ATC) ? start + 3 : start;
return new VariantContext(source, VCFConstants.EMPTY_ID_FIELD, "1", start, stop, alleles,
GenotypeCollection.copy(genotypes), 1.0, filters, null, Cref.getBases()[0]);
GenotypesContext.copy(genotypes), 1.0, filters, null, Cref.getBases()[0]);
}
// --------------------------------------------------------------------------------
@ -508,7 +508,7 @@ public class VariantContextUtilsUnitTest extends BaseTest {
}
// necessary to not overload equals for genotypes
private void assertGenotypesAreMostlyEqual(GenotypeCollection actual, GenotypeCollection expected) {
private void assertGenotypesAreMostlyEqual(GenotypesContext actual, GenotypesContext expected) {
if (actual == expected) {
return;
}