internal void ParseHeaderLines()
 {
     JsonTag = ParserUtilities.ParseTitle(_reader.ReadLine());
     _tags   = ParserUtilities.ParseTags(_reader.ReadLine(), "#geneSymbol", NumRequiredColumns, "second");
     CheckTagsAndSetJsonKeys();
     Categories   = ParserUtilities.ParseCategories(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns, _annotationValidators, "third");
     Descriptions = ParserUtilities.ParseDescriptions(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns, "forth");
     ValueTypes   = ParserUtilities.ParseTypes(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns, "fifth");
 }
Esempio n. 2
0
        internal void ParseHeaderLines()
        {
            string line;

            while ((line = _reader.ReadLine()) != null)
            {
                if (line.StartsWith("#geneSymbol"))
                {
                    break;
                }
                line = line.Trim();
                (string key, string value) = line.OptimizedKeyValue();
                switch (key)
                {
                case "#title":
                    JsonTag = value;
                    break;

                case "#version":
                    Version = value;
                    break;

                case "#description":
                    DataSourceDescription = value;
                    break;

                default:
                    var e = new UserErrorException("Unexpected header tag observed");
                    e.Data[ExitCodeUtilities.Line] = line;
                    throw e;
                }
            }
            _tags = ParserUtilities.ParseTags(line, "#geneSymbol", NumRequiredColumns);
            CheckTagsAndSetJsonKeys();
            Categories   = ParserUtilities.ParseCategories(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns, _annotationValidators);
            Descriptions = ParserUtilities.ParseDescriptions(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns);
            ValueTypes   = ParserUtilities.ParseTypes(_reader.ReadLine(), NumRequiredColumns, _numAnnotationColumns);
        }