public int ProcessQuery(IEnumerable <string> queryStrings, bool printHeader = false)
        {
            _writer.Write("{");
            if (printHeader)
            {
                string headerString = GetHeader();
                _writer.Write(headerString + ",");
            }
            Utilities.PrintQuerySectionOpening(JasixCommons.PositionsSectionTag, _writer);

            var count = 0;

            foreach (string queryString in queryStrings)
            {
                var query = Utilities.ParseQuery(queryString);
                query.Chromosome = _jasixIndex.GetIndexChromName(query.Chromosome);
                if (!_jasixIndex.ContainsChr(query.Chromosome))
                {
                    continue;
                }

                count  = PrintLargeVariantsExtendingIntoQuery(query);
                count += PrintAllVariantsFromQueryBegin(query, count > 0);
            }

            Utilities.PrintQuerySectionClosing(_writer);
            _writer.WriteLine("}");
            return(count);
        }
Exemple #2
0
        public void ProcessQuery(IEnumerable <string> queryStrings, bool printHeader = false)
        {
            _writer.Write("{");
            if (printHeader)
            {
                var headerString = _jasixIndex.HeaderLine;
                _writer.Write(headerString + ",");
            }
            Utilities.PrintQuerySectionOpening(JasixCommons.SectionToIndex, _writer);

            foreach (var queryString in queryStrings)
            {
                var query = Utilities.ParseQuery(queryString);
                if (!_jasixIndex.ContainsChr(query.Item1))
                {
                    continue;
                }
                var needComma = PrintLargeVariantsExtendingIntoQuery(query);
                PrintAllVariantsFromQueryBegin(query, needComma);
            }

            Utilities.PrintQuerySectionClosing(_writer);
            _writer.WriteLine("}");
        }