/// <summary> /// Writes delta for query sequences. /// </summary> /// <param name="delta">The Deltas.</param> /// <param name="sorter">Sorter instance.</param> private static void WriteUnsortedDelta(IEnumerable <DeltaAlignment> delta, DeltaAlignmentSorter sorter) { using (var writer = new StreamWriter(UnsortedDeltaFile)) { long deltaPositionInFile = 0; foreach (DeltaAlignment deltaAlignment in delta) { deltaAlignment.Id = deltaPositionInFile; string deltaString = Helper.GetString(deltaAlignment); deltaPositionInFile += deltaString.Length; writer.Write(deltaString); sorter.Add(deltaAlignment.Id, deltaAlignment.FirstSequenceStart); } } }
/// <summary> /// Writes delta for query sequences. /// </summary> /// <param name="delta">The Deltas.</param> /// <param name="sorter">Sorter instance.</param> /// <param name="outputStream">Output file name.</param> public static void WriteUnsortedDelta(IEnumerable <DeltaAlignment> delta, DeltaAlignmentSorter sorter, Stream outputStream) { using (StreamWriter writer = new StreamWriter(outputStream)) { long deltaPositionInFile = 0; foreach (DeltaAlignment deltaAlignment in delta) { deltaAlignment.Id = deltaPositionInFile; string deltaString = Helper.GetString(deltaAlignment); deltaPositionInFile += deltaString.Length; writer.Write(deltaString); sorter.Add(deltaAlignment.Id, deltaAlignment.FirstSequenceStart); } writer.Flush(); } }
/// <summary> /// Writes delta for query sequences. /// </summary> /// <param name="deltaAlignments">Delta alignments to write.</param> /// <param name="filename">File name to write.</param> private static void WriteDelta(IEnumerable <DeltaAlignment> deltaAlignments, DeltaAlignmentSorter sorter, string filename) { using (StreamWriter writer = new StreamWriter(filename)) { long deltaPositionInFile = 0; foreach (DeltaAlignment deltaAlignment in deltaAlignments) { deltaAlignment.Id = deltaPositionInFile; string deltaString = Helper.GetString(deltaAlignment); deltaPositionInFile += deltaString.Length; writer.Write(deltaString); sorter.Add(deltaAlignment.Id, deltaAlignment.FirstSequenceStart); } writer.Flush(); } }