예제 #1
0
        public void IndexWriteRead()
        {
            var saIndex   = new SaIndex(3);
            var nodeCount = 3 * SaIndexNode.SaNodeWidth;

            for (uint i = 0; i < nodeCount; i++)
            {
                saIndex.Add(100 + i, 1000 + i * 19, i % 3 == 0);//every third node is ref minor
            }
            var randomPath = GetRandomPath();

            saIndex.Write(randomPath, "chr1");

            using (var reader = new ExtendedBinaryReader(FileUtilities.GetReadStream(randomPath)))
            {
                var readSaIndex = new SaIndex(reader);
                Assert.Equal(Math.Ceiling(nodeCount * 1.0 / (SaIndexNode.SaNodeWidth + 1)), readSaIndex.Count());
                Assert.Equal("chr1", readSaIndex.RefSeqName);
            }

            File.Delete(randomPath);
        }
예제 #2
0
        public void IndexCreation()
        {
            var saIndex   = new SaIndex(3);
            var nodeCount = 3 * SaIndexNode.SaNodeWidth;

            for (uint i = 0; i < nodeCount; i++)
            {
                saIndex.Add(100 + i, 1000 + i * 19, false);
            }

            Assert.Equal(Math.Ceiling(nodeCount * 1.0 / (SaIndexNode.SaNodeWidth + 1)), saIndex.Count());
        }