Beispiel #1
0
        /// <summary>
        /// Creates BAMIndex object from the specified BAM file and writes to specified BAMIndex file.
        /// </summary>
        /// <param name="compressedBAMStream"></param>
        /// <param name="indexFile"></param>
        private static void CreateIndexFile(Stream compressedBAMStream, BAMIndexFile indexFile)
        {
            BAMParser parser = new BAMParser();
            BAMIndex  bamIndex;

            try
            {
                bamIndex = parser.GetIndexFromBAMFile(compressedBAMStream);
            }
            finally
            {
                parser.Dispose();
            }

            parser = null;

            indexFile.Write(bamIndex);
        }
Beispiel #2
0
 public void InvalidateGetIndexFromBAMFileUsingStream()
 {
     // Create BAM Parser object
     using (var bamParserObj = new BAMParser())
     {
         try
         {
             bamParserObj.GetIndexFromBAMFile(null as Stream);
             Assert.Fail();
         }
         catch (ArgumentNullException ex)
         {
             string exceptionMessage = ex.Message;
             ApplicationLog.WriteLine(string.Format(null,
                                                    "BAM Parser P2 : Validated Exception {0} successfully",
                                                    exceptionMessage));
         }
     }
 }