예제 #1
0
 internal PredictionWriter(StreamWriter writer, IntermediateIoHeader header,
                           IntermediateIoCommon.FileType fileType)
 {
     _writer         = writer;
     _writer.NewLine = "\n";
     header.Write(_writer, fileType);
 }
예제 #2
0
 // 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);
 }
예제 #3
0
        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);
        }
예제 #4
0
 internal MutableTranscriptWriter(StreamWriter writer, IntermediateIoHeader header)
 {
     _writer         = writer;
     _writer.NewLine = "\n";
     header.Write(_writer, IntermediateIoCommon.FileType.Transcript);
 }
예제 #5
0
 internal RegulatoryRegionWriter(StreamWriter writer, IntermediateIoHeader header)
 {
     _writer         = writer;
     _writer.NewLine = "\n";
     header.Write(_writer, IntermediateIoCommon.FileType.Regulatory);
 }
예제 #6
0
 internal GenbankWriter(StreamWriter writer, IntermediateIoHeader header)
 {
     _writer         = writer;
     _writer.NewLine = "\n";
     header.Write(_writer, IntermediateIoCommon.FileType.Genbank);
 }
예제 #7
0
 internal MutableTranscriptReader(Stream stream, IDictionary <ushort, IChromosome> refIndexToChromosome)
 {
     _refIndexToChromosome = refIndexToChromosome;
     _reader = FileUtilities.GetStreamReader(stream);
     Header  = IntermediateIoCommon.ReadHeader(_reader, IntermediateIoCommon.FileType.Transcript);
 }