Beispiel #1
0
        public void GetCompressedSequence(IChromosome chromosome)
        {
            var indexEntry = GetIndexEntry(chromosome.EnsemblName);

            if (indexEntry == null)
            {
                return;
            }

            // jump to that offset
            _stream.Position = indexEntry.FileOffset;

            // set the data
            int numBufferBytes = CompressedSequence.GetNumBufferBytes(indexEntry.NumBases);

            Sequence.Set(indexEntry.NumBases, _reader.ReadBytes(numBufferBytes), indexEntry.MaskedEntries, indexEntry.SequenceOffset);
        }
Beispiel #2
0
        public CompressedSequenceReader(Stream stream)
        {
            _stream              = stream;
            _reader              = new ExtendedBinaryReader(stream);
            Sequence             = new CompressedSequence();
            RefNameToChromosome  = new Dictionary <string, IChromosome>();
            RefIndexToChromosome = new Dictionary <ushort, IChromosome>();

            CheckHeaderVersion();
            LoadHeader();

            // jump to the index offset
            _stream.Position = _indexOffset;

            LoadIndex();
            LoadMaskedIntervals();
            VerifyEofTag();
        }