示例#1
0
 /// <summary>
 /// Parses the sequences from the given filename.
 /// </summary>
 /// <param name="parser">Sequence Parser</param>
 /// <param name="fileName">Filename to open/close</param>
 /// <returns>Set of parsed sequences.</returns>
 public static WiggleAnnotation ParseOne(this WiggleParser parser, string fileName)
 {
     using (FileStream fs = File.OpenRead(fileName))
     {
         return(parser.ParseOne(fs));
     }
 }
示例#2
0
 /// <summary>
 /// Parses the sequences from the given filename.
 /// </summary>
 /// <param name="parser">Sequence Parser</param>
 /// <param name="fileName">Filename to open/close</param>
 /// <returns>Set of parsed sequences.</returns>
 public static IEnumerable <WiggleAnnotation> Parse(this WiggleParser parser, string fileName)
 {
     using (FileStream fs = File.OpenRead(fileName))
     {
         foreach (var item in parser.Parse(fs))
         {
             yield return(item);
         }
     }
 }
示例#3
0
        /// <summary>
        /// Parses the sequences from the open file.
        /// </summary>
        /// <param name="parser">Sequence Parser</param>
        /// <returns>Set of parsed sequences.</returns>
        public static IEnumerable <WiggleAnnotation> Parse(this WiggleParser parser)
        {
            var fs = ParserFormatterExtensions <WiggleParser> .GetOpenStream(parser, false);

            if (fs != null)
            {
                foreach (var item in parser.Parse(fs))
                {
                    yield return(item);
                }
            }
        }
示例#4
0
 /// <summary>
 /// Closes the parser.
 /// </summary>
 /// <param name="parser">Parser</param>
 public static void Close(this WiggleParser parser)
 {
     ParserFormatterExtensions <WiggleParser> .Close(parser);
 }
示例#5
0
 /// <summary>
 /// Opens a sequence file using the parser.
 /// </summary>
 /// <param name="parser">Parser</param>
 /// <param name="filename">File to open</param>
 /// <returns>Disposable object to close the stream.</returns>
 public static IDisposable Open(this WiggleParser parser, string filename)
 {
     return(ParserFormatterExtensions <WiggleParser> .Open(parser, filename));
 }