示例#1
0
        // -----------------------------------------------------------------
        //
        // Master routine to look at the header, a specific line, and
        // build an appropriate Genotypes for that header element
        //
        // -----------------------------------------------------------------

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: private BCF2FieldWriter.GenotypesWriter createGenotypesWriter(final VCFHeader header, final VCFFormatHeaderLine line, final BCF2Encoder encoder, final java.util.Map<String, Integer> dict)
        private BCF2FieldWriter.GenotypesWriter createGenotypesWriter(VCFHeader header, VCFFormatHeaderLine line, BCF2Encoder encoder, IDictionary <string, int?> dict)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String field = line.getID();
            string field = line.ID;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final BCF2FieldEncoder fieldEncoder = createFieldEncoder(line, encoder, dict, true);
            BCF2FieldEncoder fieldEncoder = createFieldEncoder(line, encoder, dict, true);

            if (field.Equals(VCFConstants.GENOTYPE_KEY))
            {
                return(new BCF2FieldWriter.GTWriter(header, fieldEncoder));
            }
            else if (line.ID.Equals(VCFConstants.GENOTYPE_FILTER_KEY))
            {
                return(new BCF2FieldWriter.FTGenotypesWriter(header, fieldEncoder));
            }
            else if (intGenotypeFieldAccessors.getAccessor(field) != null)
            {
                return(new BCF2FieldWriter.IGFGenotypesWriter(header, fieldEncoder, intGenotypeFieldAccessors.getAccessor(field)));
            }
            else if (line.Type == VCFHeaderLineType.Integer)
            {
                return(new BCF2FieldWriter.IntegerTypeGenotypesWriter(header, fieldEncoder));
            }
            else
            {
                return(new BCF2FieldWriter.StaticallyTypeGenotypesWriter(header, fieldEncoder));
            }
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: protected GenotypesWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            protected internal GenotypesWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
                if (fieldEncoder.hasConstantNumElements())
                {
                    nValuesPerGenotype = FieldEncoder.numElements();
                }
            }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public IGFGenotypesWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder, final IntGenotypeFieldAccessors.Accessor ige)
            public IGFGenotypesWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder, IntGenotypeFieldAccessors.Accessor ige) : base(header, fieldEncoder)
            {
                this.ige = ige;

                if (!(fieldEncoder is BCF2FieldEncoder.IntArray))
                {
                    throw new System.ArgumentException("BUG: IntGenotypesWriter requires IntArray encoder for field " + Field);
                }
            }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Requires({"header != null", "fieldEncoder != null"}) protected BCF2FieldWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
        protected internal BCF2FieldWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder)
        {
            this.header       = header;
            this.fieldEncoder = fieldEncoder;
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public GTWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            public GTWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
            }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public FTGenotypesWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            public FTGenotypesWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
            }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public IntegerTypeGenotypesWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            public IntegerTypeGenotypesWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
            }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public StaticallyTypeGenotypesWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            public StaticallyTypeGenotypesWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
                encodingType = FieldEncoder.StaticType;
            }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: public GenericSiteWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            public GenericSiteWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
            }
示例#10
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: protected SiteWriter(final Bio.VCF.VCFHeader header, final BCF2FieldEncoder fieldEncoder)
            protected internal SiteWriter(VCFHeader header, BCF2FieldEncoder fieldEncoder) : base(header, fieldEncoder)
            {
            }