public void Add(string chr, int start, int end, long fileLoc) { if (!_chrIndices.ContainsKey(chr)) { _chrIndices[chr] = new JasixChrIndex(chr); } _chrIndices[chr].Add(start, end, fileLoc); }
public void Add(string chr, int start, int end, long fileLoc, string chrSynonym = null) { if (!string.IsNullOrEmpty(chrSynonym)) { _synonymToChrName[chrSynonym] = chr; } if (_chrIndices.TryGetValue(chr, out var chrIndex)) { chrIndex.Add(start, end, fileLoc); } else { _chrIndices[chr] = new JasixChrIndex(chr); _chrIndices[chr].Add(start, end, fileLoc); } }
private JasixIndex(IExtendedBinaryReader reader) : this() { var version = reader.ReadOptInt32(); if (version != JasixCommons.Version) { throw new InvalidDataException($"Invalid Jasix version: Observed {version}, expected{JasixCommons.Version}"); } HeaderLine = reader.ReadAsciiString(); var count = reader.ReadOptInt32(); for (var i = 0; i < count; i++) { var chrIndex = new JasixChrIndex(reader); _chrIndices[chrIndex.ReferenceSequence] = chrIndex; } }
public JasixIndex(Stream stream) : this() { _stream = stream; using (var reader = new ExtendedBinaryReader(stream)) { int version = reader.ReadOptInt32(); if (version != JasixCommons.Version) { throw new InvalidDataException($"Invalid Jasix version: Observed {version}, expected{JasixCommons.Version}"); } int count = reader.ReadOptInt32(); for (var i = 0; i < count; i++) { var chrIndex = new JasixChrIndex(reader); _chrIndices[chrIndex.ReferenceSequence] = chrIndex; } int synonymCount = reader.ReadOptInt32(); for (var i = 0; i < synonymCount; i++) { string synonym = reader.ReadAsciiString(); string indexName = reader.ReadAsciiString(); _synonymToChrName[synonym] = indexName; } int sectionCount = reader.ReadOptInt32(); for (var i = 0; i < sectionCount; i++) { string sectionName = reader.ReadAsciiString(); long begin = reader.ReadOptInt64(); long end = reader.ReadOptInt64(); _sectionRanges[sectionName] = new FileRange(begin, end); } } }