Exemplo n.º 1
0
        public void GetChromosomeList()
        {
            var readStream  = new BlockGZipStream(ResourceUtilities.GetReadStream(Resources.TopPath("Clinvar20150901.json.gz")), CompressionMode.Decompress);
            var indexStream = ResourceUtilities.GetReadStream(Resources.TopPath("Clinvar20150901.json.gz.jsi"));

            var outStream = new MemoryStream();

            using (var writer = new StreamWriter(outStream, Encoding.UTF8, 512, true))
                using (var qp = new QueryProcessor(new StreamReader(readStream), indexStream, writer))
                {
                    writer.NewLine = "\r\n";
                    qp.ListChromosomesAndSections();
                }

            Assert.NotEqual(0, outStream.Length);
            outStream.Position = 0;

            using (var reader = new StreamReader(outStream))
            {
                string chromList = reader.ReadToEnd();
                Assert.Equal("1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n15\r\n16\r\n17\r\n18\r\n19\r\n20\r\n21\r\nX\r\nY\r\nheader\r\npositions\r\ngenes\r\n", chromList);
            }
        }