final IntGenotypeFieldAccessors.Accessor accessor = GENOTYPE_FIELD_ACCESSORS.getAccessor(field); if (accessor != null) { final int[] intValues = accessor.getValues(g); if (intValues == null) outputValue = VCFConstants.MISSING_VALUE_v4;
final IntGenotypeFieldAccessors.Accessor accessor = GENOTYPE_FIELD_ACCESSORS.getAccessor(field); if (accessor != null) { final int[] intValues = accessor.getValues(g); if (intValues == null) outputValue = VCFConstants.MISSING_VALUE_v4;
final IntGenotypeFieldAccessors.Accessor accessor = GENOTYPE_FIELD_ACCESSORS.getAccessor(field); if ( accessor != null ) { final int[] intValues = accessor.getValues(g); if ( intValues == null ) outputValue = VCFConstants.MISSING_VALUE_v4;
private static boolean parseInlineGenotypeFields(String field, VariantCall.Builder vcBuilder, ListValue.Builder lvBuilder, IntGenotypeFieldAccessors.Accessor accessor, Genotype g) { final int[] intValues = accessor.getValues(g); if (intValues == null || intValues.length == 0) { return false; } if (field.equals(VCFConstants.GENOTYPE_PL_KEY)) { // HTSJDK folds GL's into PL's. We only use PL's to store genotype likelihood. for (int i = 0; i < intValues.length; i++) { // We add 0.0 to remove the possiblity of getting -0.0. vcBuilder.addGenotypeLikelihood(-(double) intValues[i] / 10.0 + 0.0); } return false; } for (int i = 0; i < intValues.length; i++) { lvBuilder.addValues(Value.newBuilder().setNumberValue(intValues[i])); } return true; }
@Override public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // TODO // TODO this piece of code consumes like 10% of the runtime alone because fo the vc.getGenotypes() iteration // TODO encodingType = BCF2Type.INT8; for ( final Genotype g : vc.getGenotypes() ) { final int[] pls = ige.getValues(g); final BCF2Type plsType = getFieldEncoder().getType(pls); encodingType = BCF2Utils.maxIntegerType(encodingType, plsType); if ( encodingType == BCF2Type.INT32 ) break; // stop early } super.start(encoder, vc); }
@Override public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // TODO // TODO this piece of code consumes like 10% of the runtime alone because fo the vc.getGenotypes() iteration // TODO encodingType = BCF2Type.INT8; for ( final Genotype g : vc.getGenotypes() ) { final int[] pls = ige.getValues(g); final BCF2Type plsType = getFieldEncoder().getType(pls); encodingType = BCF2Utils.maxIntegerType(encodingType, plsType); if ( encodingType == BCF2Type.INT32 ) break; // stop early } super.start(encoder, vc); }
@Override public void start(final BCF2Encoder encoder, final VariantContext vc) throws IOException { // TODO // TODO this piece of code consumes like 10% of the runtime alone because fo the vc.getGenotypes() iteration // TODO encodingType = BCF2Type.INT8; for ( final Genotype g : vc.getGenotypes() ) { final int[] pls = ige.getValues(g); final BCF2Type plsType = getFieldEncoder().getType(pls); encodingType = BCF2Utils.maxIntegerType(encodingType, plsType); if ( encodingType == BCF2Type.INT32 ) break; // stop early } super.start(encoder, vc); }
@Override public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { getFieldEncoder().encodeValue(encoder, ige.getValues(g), encodingType, nValuesPerGenotype); }
@Override public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { getFieldEncoder().encodeValue(encoder, ige.getValues(g), encodingType, nValuesPerGenotype); }
@Override public void addGenotype(final BCF2Encoder encoder, final VariantContext vc, final Genotype g) throws IOException { getFieldEncoder().encodeValue(encoder, ige.getValues(g), encodingType, nValuesPerGenotype); }
public final int getSize(final Genotype g) { final int[] v = getValues(g); return v == null ? 0 : v.length; } }
@Override protected int numElements(final VariantContext vc, final Genotype g) { return ige.getSize(g); } }
public final int getSize(final Genotype g) { final int[] v = getValues(g); return v == null ? 0 : v.length; } }
public final int getSize(final Genotype g) { final int[] v = getValues(g); return v == null ? 0 : v.length; } }
@Override protected int numElements(final VariantContext vc, final Genotype g) { return ige.getSize(g); } }
@Override protected int numElements(final VariantContext vc, final Genotype g) { return ige.getSize(g); } }