/// <summary> /// Try to get the nGenotypeFields as efficiently as possible. /// /// If this is a lazy BCF2 object just grab the field count from there, /// otherwise do the whole counting by types test in the actual data /// </summary> /// <param name="vc"> /// @return </param> //JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET: //ORIGINAL LINE: private final int getNGenotypeFormatFields(final VariantContext vc) private int getNGenotypeFormatFields(VariantContext vc) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.broadinstitute.variant.bcf2.BCF2Codec.LazyData lazyData = getLazyData(vc); BCF2Codec.LazyData lazyData = getLazyData(vc); return(lazyData != null ? lazyData.nGenotypeFields : VCFWriter.calcVCFGenotypeKeys(vc, header).Count); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: private byte[] buildSamplesData(final VariantContext vc) throws IOException //JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET: private sbyte[] buildSamplesData(VariantContext vc) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.broadinstitute.variant.bcf2.BCF2Codec.LazyData lazyData = getLazyData(vc); BCF2Codec.LazyData lazyData = getLazyData(vc); // has critical side effects if (lazyData != null) { // we never decoded any data from this BCF file, so just pass it back return(lazyData.bytes); } // we have to do work to convert the VC into a BCF2 byte stream //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final List<String> genotypeFields = VCFWriter.calcVCFGenotypeKeys(vc, header); IList <string> genotypeFields = VCFWriter.calcVCFGenotypeKeys(vc, header); foreach (String field in genotypeFields) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final BCF2FieldWriter.GenotypesWriter writer = fieldManager.getGenotypeFieldWriter(field); BCF2FieldWriter.GenotypesWriter writer = fieldManager.getGenotypeFieldWriter(field); if (writer == null) { errorUnexpectedFieldToWrite(vc, field, "FORMAT"); } Debug.Assert(writer != null); writer.start(encoder, vc); foreach (String name in sampleNames) { Genotype g = vc.getGenotype(name); if (g == null) { g = GenotypeBuilder.createMissing(name, writer.nValuesPerGenotype); } writer.addGenotype(encoder, vc, g); } writer.done(encoder, vc); } return(encoder.RecordBytes); }