예제 #1
0
        /// <summary>
        /// create the info string; assumes that no values are null
        /// </summary>
        /// <param name="infoFields"> a map of info fields </param>
        /// <exception cref="IOException"> for writer </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void writeInfoString(Map<String, String> infoFields) throws IOException
        private void writeInfoString(IDictionary <string, string> infoFields)
        {
            if (infoFields.Count == 0)
            {
                write(VCFConstants.EMPTY_INFO_FIELD);
                return;
            }

            bool isFirst = true;

            foreach (KeyValuePair <string, string> entry in infoFields)
            {
                if (isFirst)
                {
                    isFirst = false;
                }
                else
                {
                    write(VCFConstants.INFO_FIELD_SEPARATOR);
                }

                string key = entry.Key;
                write(key);

                if (!entry.Value.Equals(""))
                {
                    VCFInfoHeaderLine metaData = mHeader.getInfoHeaderLine(key);
                    if (metaData == null || metaData.CountType != VCFHeaderLineCount.INTEGER || metaData.Count != 0)
                    {
                        write("=");
                        write(entry.Value);
                    }
                }
            }
        }
예제 #2
0
        // -----------------------------------------------------------------
        //
        // Master routine to look at the header, a specific line, and
        // build an appropriate SiteWriter for that header element
        //
        // -----------------------------------------------------------------

//JAVA TO C# CONVERTER WARNING: 'final' parameters are not allowed in .NET:
//ORIGINAL LINE: private BCF2FieldWriter.SiteWriter createInfoWriter(final VCFHeader header, final VCFInfoHeaderLine line, final BCF2Encoder encoder, final java.util.Map<String, Integer> dict)
        private BCF2FieldWriter.SiteWriter createInfoWriter(VCFHeader header, VCFInfoHeaderLine line, BCF2Encoder encoder, IDictionary <string, int?> dict)
        {
            return(new BCF2FieldWriter.GenericSiteWriter(header, createFieldEncoder(line, encoder, dict, false)));
        }