Exemple #1
0
        public CompressedSequenceWriter(Stream stream, IReadOnlyCollection <ReferenceMetadata> referenceMetadataList,
                                        ISerializable genomeCytobands, GenomeAssembly genomeAssembly)
        {
            _stream                = stream;
            _writer                = new ExtendedBinaryWriter(_stream);
            _refSeqNames           = new List <string>();
            _refSeqIndex           = new List <SequenceIndexEntry>();
            _twoBitSequence        = new TwoBitSequence();
            _sequenceCompressor    = new SequenceCompressor();
            _refSeqMaskedIntervals = new List <List <MaskedEntry> >();

            WriteHeader(referenceMetadataList, genomeCytobands, genomeAssembly);
        }
Exemple #2
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                WriteReferenceSequenceIndex();
                WriteMaskedIntervals();
                WriteEofTag();
                _stream.Dispose();
            }

            _refSeqIndex           = null;
            _refSeqMaskedIntervals = null;
            _twoBitSequence        = null;
            _sequenceCompressor    = null;

            _headerDataOffset      = 0L;
            _indexOffset           = 0L;
            _maskedIntervalsOffset = 0L;
        }