@Override @Requires({"encodingType != null", "nValuesPerGenotype >= 0 || ! getFieldEncoder().hasConstantNumElements()"}) @Ensures("nValuesPerGenotype >= 0") public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // writes the key information super.start(encoder, vc); // only update if we need to if ( ! getFieldEncoder().hasConstantNumElements() ) { if ( getFieldEncoder().hasContextDeterminedNumElements() ) // we are cheap -- just depends on genotype of allele counts nValuesPerGenotype = getFieldEncoder().numElements(vc); else // we have to go fishing through the values themselves (expensive) nValuesPerGenotype = computeMaxSizeOfGenotypeFieldFromValues(vc); } encoder.encodeType(nValuesPerGenotype, encodingType); }
@Override public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // writes the key information super.start(encoder, vc); // only update if we need to if ( ! getFieldEncoder().hasConstantNumElements() ) { if ( getFieldEncoder().hasContextDeterminedNumElements() ) // we are cheap -- just depends on genotype of allele counts nValuesPerGenotype = getFieldEncoder().numElements(vc); else // we have to go fishing through the values themselves (expensive) nValuesPerGenotype = computeMaxSizeOfGenotypeFieldFromValues(vc); } encoder.encodeType(nValuesPerGenotype, encodingType); }
@Override public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // writes the key information super.start(encoder, vc); // only update if we need to if ( ! getFieldEncoder().hasConstantNumElements() ) { if ( getFieldEncoder().hasContextDeterminedNumElements() ) // we are cheap -- just depends on genotype of allele counts nValuesPerGenotype = getFieldEncoder().numElements(vc); else // we have to go fishing through the values themselves (expensive) nValuesPerGenotype = computeMaxSizeOfGenotypeFieldFromValues(vc); } encoder.encodeType(nValuesPerGenotype, encodingType); }
public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { final Object fieldValue = g.getExtendedAttribute(getField(), null); getFieldEncoder().encodeValue(encoder, fieldValue, encodingType, nValuesPerGenotype); }
@Ensures({"result >= 0"}) protected int numElements(final VariantContext vc, final Genotype g) { return getFieldEncoder().numElements(vc, g.getExtendedAttribute(getField())); }
public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { final Object fieldValue = g.getExtendedAttribute(getField(), null); getFieldEncoder().encodeValue(encoder, fieldValue, encodingType, nValuesPerGenotype); }
@Requires({"encodingType != null", "nValuesPerGenotype >= 0"}) public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { final Object fieldValue = g.getExtendedAttribute(getField(), null); getFieldEncoder().encodeValue(encoder, fieldValue, encodingType, nValuesPerGenotype); }
protected GenotypesWriter(final VCFHeader header, final BCF2FieldEncoder fieldEncoder) { super(header, fieldEncoder); if ( fieldEncoder.hasConstantNumElements() ) { nValuesPerGenotype = getFieldEncoder().numElements(); } }
protected GenotypesWriter(final VCFHeader header, final BCF2FieldEncoder fieldEncoder) { super(header, fieldEncoder); if ( fieldEncoder.hasConstantNumElements() ) { nValuesPerGenotype = getFieldEncoder().numElements(); } }
protected int numElements(final VariantContext vc, final Genotype g) { return getFieldEncoder().numElements(vc, g.getExtendedAttribute(getField())); }
protected int numElements(final VariantContext vc, final Genotype g) { return getFieldEncoder().numElements(vc, g.getExtendedAttribute(getField())); }
protected GenotypesWriter(final VCFHeader header, final BCF2FieldEncoder fieldEncoder) { super(header, fieldEncoder); if ( fieldEncoder.hasConstantNumElements() ) { nValuesPerGenotype = getFieldEncoder().numElements(); } }