internal PredictionWriter(StreamWriter writer, IntermediateIoHeader header, IntermediateIoCommon.FileType fileType) { _writer = writer; _writer.NewLine = "\n"; header.Write(_writer, fileType); }
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Global public static IntermediateIoHeader ReadHeader(StreamReader reader, FileType expectedType) { (string id, FileType type, IntermediateIoHeader header) = IntermediateIoHeader.Read(reader); if (id != Header || type != expectedType) { throw new InvalidDataException("Could not verify the header tag or the file type in the header."); } return(header); }
internal static (string Id, IntermediateIoCommon.FileType Type, IntermediateIoHeader Header) Read(StreamReader reader) { var cols = reader.ReadLine()?.Split('\t'); var cols2 = reader.ReadLine()?.Split('\t'); if (cols == null || cols2 == null) { throw new InvalidDataException("Found unexpected null lines when parsing the intermediate I/O file header"); } var id = cols[0]; var type = (IntermediateIoCommon.FileType) byte.Parse(cols[1]); var vepVersion = ushort.Parse(cols2[0]); var vepReleaseTicks = long.Parse(cols2[1]); var source = (Source)byte.Parse(cols2[2]); var genomeAssembly = (GenomeAssembly)byte.Parse(cols2[3]); var numRefSeqs = int.Parse(cols2[4]); var header = new IntermediateIoHeader(vepVersion, vepReleaseTicks, source, genomeAssembly, numRefSeqs); return(id, type, header); }
internal MutableTranscriptWriter(StreamWriter writer, IntermediateIoHeader header) { _writer = writer; _writer.NewLine = "\n"; header.Write(_writer, IntermediateIoCommon.FileType.Transcript); }
internal RegulatoryRegionWriter(StreamWriter writer, IntermediateIoHeader header) { _writer = writer; _writer.NewLine = "\n"; header.Write(_writer, IntermediateIoCommon.FileType.Regulatory); }
internal GenbankWriter(StreamWriter writer, IntermediateIoHeader header) { _writer = writer; _writer.NewLine = "\n"; header.Write(_writer, IntermediateIoCommon.FileType.Genbank); }
internal MutableTranscriptReader(Stream stream, IDictionary <ushort, IChromosome> refIndexToChromosome) { _refIndexToChromosome = refIndexToChromosome; _reader = FileUtilities.GetStreamReader(stream); Header = IntermediateIoCommon.ReadHeader(_reader, IntermediateIoCommon.FileType.Transcript); }