Exemplo n.º 1
0
        /// <summary>
        /// make a string representation of this header line </summary>
        /// <returns> a string representation </returns>
        protected internal override string toStringEncoding()
        {
            IDictionary <string, object> map = new OrderedGenericDictionary <string, object>();

            map["ID"] = name;
            object number;

            switch (countType)
            {
            case Bio.VCF.VCFHeaderLineCount.A:
                number = VCFConstants.PER_ALTERNATE_ALLELE_COUNT;
                break;

            case Bio.VCF.VCFHeaderLineCount.R:
                number = VCFConstants.PER_ALLELE_COUNT;
                break;

            case Bio.VCF.VCFHeaderLineCount.G:
                number = VCFConstants.PER_GENOTYPE_COUNT;
                break;

            case Bio.VCF.VCFHeaderLineCount.UNBOUNDED:
                number = VCFConstants.UNBOUNDED_ENCODING_v4;
                break;

            case Bio.VCF.VCFHeaderLineCount.INTEGER:
            default:
                number = count;
                break;
            }
            map["Number"]      = number;
            map["Type"]        = type;
            map["Description"] = description;
            return(lineType.ToString() + "=" + VCFHeaderLine.toStringEncoding(map));
        }
Exemplo n.º 2
0
        protected internal override string toStringEncoding()
        {
            OrderedGenericDictionary <string, string> map = new OrderedGenericDictionary <string, string>();

            map["ID"] = name;
            map.putAll(genericFields);
            return(Key + "=" + VCFHeaderLine.toStringEncoding(map));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Walks over the VCF header and repairs the standard VCF header lines in it, returning a freshly
        /// allocated VCFHeader with standard VCF header lines repaired as necessary
        /// </summary>
        /// <param name="header">
        /// @return </param>
        public static VCFHeader repairStandardHeaderLines(VCFHeader header)
        {
            ISet <VCFHeaderLine> newLines = new LinkedHashSet <VCFHeaderLine>();

            foreach (VCFHeaderLine line in header.MetaDataInInputOrder)
            {
                VCFHeaderLine cur = line;
                if (line is VCFFormatHeaderLine)
                {
                    cur = formatStandards.repair((VCFFormatHeaderLine)line);
                }
                else if (line is VCFInfoHeaderLine)
                {
                    cur = infoStandards.repair((VCFInfoHeaderLine)line);
                }

                newLines.Add(cur);
            }

            return(new VCFHeader(newLines, header.GenotypeSampleNames));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Adds a header line to the header metadata.
 /// </summary>
 /// <param name="headerLine"> Line to add to the existing metadata component. </param>
 private void addMetaDataLine(VCFHeaderLine headerLine)
 {
     mMetaData.Add(headerLine);
     loadMetaDataMaps();
 }