internal FastASequence(FastAFile owner, bool loadAllIntoMemory, string header, long startPos, int length, int firstNonGap, int count, IBioValidator validator) { Debug.Assert(header.Length > 0); string[] bits = header.Split(new[] { "::" }, StringSplitOptions.None); if (bits.Length == 3) { ScientificName = /*bits[0] +":" +*/ bits[1]; CommonName = bits[2]; } else { ScientificName = header; } Validator = validator; FirstDataColumn = firstNonGap; if (string.IsNullOrEmpty(CommonName)) { CommonName = "<Not Available>"; } if (string.IsNullOrEmpty(ScientificName)) { ScientificName = CommonName; } _dp = new FastAFileSequenceDataProvider(owner, startPos, length, count, validator); if (loadAllIntoMemory) { _alignedList = new List <IBioSymbol>(_dp.LoadRange(0, length)); _dp.Dispose(); _dp = null; } else { _alignedList = new VirtualizingList <IBioSymbol>(_dp, Math.Min(1024, length), 60); } }
public FastAFileSequenceDataProvider(FastAFile owner, long startPos, int length, int count, IBioValidator bv) { _fs = owner.MmFile.CreateViewStream(startPos, length, MemoryMappedFileAccess.Read); _count = count; _validator = bv; }