Esempio n. 1
0
        /// <summary>
        /// Parsers the files binary content into a abi parser context.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static IParserContext Parse(BinaryReader reader)
        {
            var rawData = new Ab1Header(reader);
            IVersionedDataParser dataParser = DataParserFactory.GetParser(rawData.MajorVersion);
            var context = new ParserContext
            {
                Header = rawData,
                Reader = reader
            };

            dataParser.ParseData(context);

            return(context);
        }
Esempio n. 2
0
        /// <summary>
        ///     Parsers the files binary content into a abi parser context using
        ///     the specified alphabet.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="alphabet"></param>
        /// <returns></returns>
        public static IParserContext Parse(BinaryReader reader, IAlphabet alphabet)
        {
            // Default to the DNA alphabet
            if (alphabet == null)
            {
                alphabet = Alphabets.DNA;
            }

            var rawData = new Ab1Header(reader);
            IVersionedDataParser dataParser = DataParserFactory.GetParser(rawData.MajorVersion);
            var context = new ParserContext {
                Header = rawData, Reader = reader, Alphabet = alphabet,
            };

            dataParser.ParseData(context);

            return(context);
        }
Esempio n. 3
0
        /// <summary>
        ///     Parsers the files binary content into a abi parser context using
        ///     the specified alphabet.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="alphabet"></param>
        /// <returns></returns>
        public static IParserContext Parse(BinaryReader reader, IAlphabet alphabet)
        {
            // Default to the DNA alphabet
            if (alphabet == null)
            {
                alphabet = Alphabets.DNA;
            }

            var rawData = new Ab1Header(reader);
            IVersionedDataParser dataParser = DataParserFactory.GetParser(rawData.MajorVersion);
            var context = new ParserContext { Header = rawData, Reader = reader, Alphabet = alphabet, };
            dataParser.ParseData(context);

            return context;
        }