/** * Overrides the genotypes accessor. If we haven't already, decode the genotypes data * and store the decoded results in the appropriate variables. Otherwise we just * returned the decoded result directly. Note some care needs to be taken here as * the value in notToBeDirectlyAccessedGenotypes may diverge from what would be produced * by decode, if after the first decode the genotypes themselves are replaced * @return */ @Override protected ArrayList<Genotype> getGenotypes() { decode(); return notToBeDirectlyAccessedGenotypes; }
/** * Overrides the genotypes accessor. If we haven't already, decode the genotypes data * and store the decoded results in the appropriate variables. Otherwise we just * returned the decoded result directly. Note some care needs to be taken here as * the value in notToBeDirectlyAccessedGenotypes may diverge from what would be produced * by decode, if after the first decode the genotypes themselves are replaced * @return */ @Override protected ArrayList<Genotype> getGenotypes() { decode(); return notToBeDirectlyAccessedGenotypes; }
/** * Custom serialization routine. Needed to ensure that we decode any lazily-decoded data * before serialization. * * @param out stream to which to serialize this object */ private void writeObject(ObjectOutputStream out) throws IOException { // If we're a LazyGenotypesContext, decode the genotype data before serialization. // // Ugly, but we can't do this in LazyGenotypesContext.writeObject(), since // by the time that's called we'll already have serialized the superclass // data in GenotypesContext, and we need to make sure that we decode any lazy // data BEFORE serializing the fields in GenotypesContext. if ( getClass() == LazyGenotypesContext.class ) { ((LazyGenotypesContext)this).decode(); } out.defaultWriteObject(); }
@Override protected synchronized void ensureSampleOrdering() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleOrdering(); } }
/** * Overrides the ensure* functionality. If the data hasn't been loaded * yet and we want to build the cache, just decode it and we're done. If we've * already decoded the data, though, go through the super class */ @Override protected synchronized void ensureSampleNameMap() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleNameMap(); } }
@Override protected synchronized void ensureSampleOrdering() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleOrdering(); } }
@Override protected void invalidateSampleOrdering() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleOrdering(); }
@Override protected synchronized void ensureSampleOrdering() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleOrdering(); } }
@Override protected void invalidateSampleNameMap() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleNameMap(); }
@Override protected void invalidateSampleOrdering() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleOrdering(); }
/** * Overrides the ensure* functionality. If the data hasn't been loaded * yet and we want to build the cache, just decode it and we're done. If we've * already decoded the data, though, go through the super class */ @Override protected synchronized void ensureSampleNameMap() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleNameMap(); } }
@Override protected void invalidateSampleNameMap() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleNameMap(); }
@Override protected void invalidateSampleNameMap() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleNameMap(); }
@Override protected void invalidateSampleOrdering() { // if the cache is invalidated, and we haven't loaded our data yet, do so if ( ! loaded ) decode(); super.invalidateSampleOrdering(); }
/** * Overrides the ensure* functionality. If the data hasn't been loaded * yet and we want to build the cache, just decode it and we're done. If we've * already decoded the data, though, go through the super class */ @Override protected synchronized void ensureSampleNameMap() { if ( ! loaded ) { decode(); // will load up all of the necessary data } else { super.ensureSampleNameMap(); } }
/** * Overrides the genotypes accessor. If we haven't already, decode the genotypes data * and store the decoded results in the appropriate variables. Otherwise we just * returned the decoded result directly. Note some care needs to be taken here as * the value in notToBeDirectlyAccessedGenotypes may diverge from what would be produced * by decode, if after the first decode the genotypes themselves are replaced * @return */ @Override @Ensures("result != null") protected ArrayList<Genotype> getGenotypes() { decode(); return notToBeDirectlyAccessedGenotypes; }
public List<VariantContext> convert(List<CharBuffer> block) { int size = block.size(); List<VariantContext> varList = new ArrayList<>(size); for (CharBuffer buff : block) { VariantContext ctx = convert(buff); if (decodeGenotypes) { if (ctx.getGenotypes().isLazyWithData()) { ((LazyGenotypesContext) ctx.getGenotypes()).decode(); } } varList.add(ctx); } return varList; }
private BCF2Codec.LazyData getLazyData(final VariantContext vc) { if ( vc.getGenotypes().isLazyWithData() ) { final LazyGenotypesContext lgc = (LazyGenotypesContext)vc.getGenotypes(); if ( lgc.getUnparsedGenotypeData() instanceof BCF2Codec.LazyData && canSafelyWriteRawGenotypesBytes((BCF2Codec.LazyData) lgc.getUnparsedGenotypeData())) { return (BCF2Codec.LazyData)lgc.getUnparsedGenotypeData(); } else { lgc.decode(); // WARNING -- required to avoid keeping around bad lazy data for too long } } return null; }
private BCF2Codec.LazyData getLazyData(final VariantContext vc) { if ( vc.getGenotypes().isLazyWithData() ) { final LazyGenotypesContext lgc = (LazyGenotypesContext)vc.getGenotypes(); if ( lgc.getUnparsedGenotypeData() instanceof BCF2Codec.LazyData && canSafelyWriteRawGenotypesBytes((BCF2Codec.LazyData) lgc.getUnparsedGenotypeData())) { return (BCF2Codec.LazyData)lgc.getUnparsedGenotypeData(); } else { lgc.decode(); // WARNING -- required to avoid keeping around bad lazy data for too long } } return null; }
private BCF2Codec.LazyData getLazyData(final VariantContext vc) { if ( vc.getGenotypes().isLazyWithData() ) { final LazyGenotypesContext lgc = (LazyGenotypesContext)vc.getGenotypes(); if ( lgc.getUnparsedGenotypeData() instanceof BCF2Codec.LazyData && canSafelyWriteRawGenotypesBytes((BCF2Codec.LazyData) lgc.getUnparsedGenotypeData())) { return (BCF2Codec.LazyData)lgc.getUnparsedGenotypeData(); } else { lgc.decode(); // WARNING -- required to avoid keeping around bad lazy data for too long } } return null; }