Ejemplo n.º 1
0
		public void Histogram()
		{

			int[] tmp = new int[]{
                6,34,1,7,2,10,20,25,30,35,40,9,19,24,29,34,39,40,2,14,21,27,32,36,40
                ,7,0,90,4,1,0,0,0,0,0,-70,22,4,0,-81,-49,1,0,-68,16,0,0,78,-86,42,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,2,0,0,0,0,0,75,-81,3,0,-96,-81,0,0,76,4,0,0,112,62,44,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,3,0,0,0,0,0,-80,60,3,0,-74,-46,0,0,-85,1,0,0,-106,-112,44,0,0,0,0,0,0,0,0,0
			};
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.q_metric_set());

            filter_options options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(8, 2, 2, 36, 1, 1, new string_vector(), tile_naming_method.FourDigit),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);
            run.finalize_after_load();

            bar_plot_data data = new bar_plot_data();
            c_csharp_plot.plot_qscore_histogram(run, options, data);
            Assert.AreEqual(data.size(), 1);

		}
Ejemplo n.º 2
0
        public void TestBadMetricException()
        {
            int[] tmp = new int[] {
                6, 34, 1, 7, 2, 10, 20, 25, 30, 35, 40, 9, 19, 24, 29, 34, 39, 40, 2, 14, 21, 27, 32, 36, 40
                , 7, 0, 90, 4, 1, 0, 0, 0, 0, 0, -70, 22, 4, 0, -81, -49, 1, 0, -68, 16, 0, 0, 78, -86, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0
                , 7, 0, 90, 4, 2, 0, 0, 0, 0, 0, 75, -81, 3, 0, -96, -81, 0, 0, 76, 4, 0, 0, 112, 62, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0
                , 7, 0, 90, 4, 3, 0, 0, 0, 0, 0, -80, 60, 3, 0, -74, -46, 0, 0, -85, 1, 0, 0, -106, -112, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for (int i = 0; i < expected_binary_data.Length; i++)
            {
                expected_binary_data[i] = (byte)tmp[i];
            }
            run_metrics run = new run_metrics();

            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.q_metric_set());
            uint             ALL_IDS = (uint)filter_options.UseAll.ALL_IDS;
            filter_options   options = new filter_options(tile_naming_method.FourDigit, ALL_IDS, 0, dna_bases.A, ALL_IDS, 1, 1);
            read_info_vector reads   = new read_info_vector();

            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                             new flowcell_layout(8, 2, 2, 36, 1, 1, new string_vector(), tile_naming_method.FourDigit),
                             reads
                             ));
            run.legacy_channel_update(instrument_type.HiSeq);
            run.finalize_after_load();

            flowcell_data data = new flowcell_data();

            c_csharp_plot.plot_flowcell_map(run, "NoMetric", options, data);
        }
Ejemplo n.º 3
0
        public void TestListErrorMetricFilenames()
        {
            run_metrics run = new run_metrics();

            read_info_vector reads = new read_info_vector();

            reads.Add(new read_info(1, 1, 3));
            run.run_info(new info(
                             "",
                             "",
                             1,
                             new flowcell_layout(2, 2, 2, 16),
                             new string_vector(),
                             new image_dimensions(),
                             reads
                             ));
            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);

            string_vector filenames = new string_vector();

            run.list_error_metric_filenames(filenames, "RunFolder");
            Assert.AreEqual(filenames.Count, 1);
            Assert.AreEqual(filenames[0], Path.Combine("RunFolder", "InterOp", "ErrorMetricsOut.bin"));
        }
Ejemplo n.º 4
0
		public void TestInvalidMetricName()
		{
            run_metrics metrics = new run_metrics();
            filter_options options = new filter_options(tile_naming_method.FourDigit);
            candle_stick_plot_data data = new candle_stick_plot_data();
            c_csharp_plot.plot_by_cycle(metrics, "NoMetric", options, data);
		}
Ejemplo n.º 5
0
        public void Histogram()
        {
            int[] tmp = new int[] {
                6, 34, 1, 7, 2, 10, 20, 25, 30, 35, 40, 9, 19, 24, 29, 34, 39, 40, 2, 14, 21, 27, 32, 36, 40
                , 7, 0, 90, 4, 1, 0, 0, 0, 0, 0, -70, 22, 4, 0, -81, -49, 1, 0, -68, 16, 0, 0, 78, -86, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0
                , 7, 0, 90, 4, 2, 0, 0, 0, 0, 0, 75, -81, 3, 0, -96, -81, 0, 0, 76, 4, 0, 0, 112, 62, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0
                , 7, 0, 90, 4, 3, 0, 0, 0, 0, 0, -80, 60, 3, 0, -74, -46, 0, 0, -85, 1, 0, 0, -106, -112, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for (int i = 0; i < expected_binary_data.Length; i++)
            {
                expected_binary_data[i] = (byte)tmp[i];
            }
            run_metrics run = new run_metrics();

            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.q_metric_set());

            filter_options   options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads   = new read_info_vector();

            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                             new flowcell_layout(8, 2, 2, 36, 1, 1, new string_vector(), tile_naming_method.FourDigit),
                             reads
                             ));
            run.legacy_channel_update(instrument_type.HiSeq);
            run.finalize_after_load();

            bar_plot_data data = new bar_plot_data();

            c_csharp_plot.plot_qscore_histogram(run, options, data);
            Assert.AreEqual(data.size(), 1);
        }
Ejemplo n.º 6
0
        public void TestListErrorMetricFilenames()
        {
            run_metrics run = new run_metrics();

            read_info_vector reads = new read_info_vector();

            reads.Add(new read_info(1, 1, 3));
            run.run_info(new info(new flowcell_layout(2, 2, 2, 16),
                                  reads
                                  ));
            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);

            string_vector filenames = new string_vector();

            run.list_filenames(metric_group.Error, filenames, "RunFolder");
            Assert.AreEqual(filenames.Count, 4);
            string interopFolder       = Path.Combine("RunFolder", "InterOp");
            string interopFolderCycle1 = Path.Combine(interopFolder, "C1.1");
            string interopFolderCycle2 = Path.Combine(interopFolder, "C2.1");
            string interopFolderCycle3 = Path.Combine(interopFolder, "C3.1");

            Assert.AreEqual(filenames[0], Path.Combine(interopFolder, "ErrorMetricsOut.bin"));
            Assert.AreEqual(filenames[1], Path.Combine(interopFolderCycle1, "ErrorMetricsOut.bin"));
            Assert.AreEqual(filenames[2], Path.Combine(interopFolderCycle2, "ErrorMetricsOut.bin"));
            Assert.AreEqual(filenames[3], Path.Combine(interopFolderCycle3, "ErrorMetricsOut.bin"));
        }
Ejemplo n.º 7
0
    static int Main(string[] args)
    {
        if (args.Length != 1)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("No run folder");
            }
            else
            {
                Console.WriteLine("Too many arguments");
            }
            return(1);
        }

        run_metrics metrics = new run_metrics();

        metrics.read(args[0]);


        run_summary summary = new run_summary();

        c_csharp_summary.summarize_run_metrics(metrics, summary);


        Console.WriteLine("Yield: {0}", summary.total_summary().yield_g());
        return(0);
    }
Ejemplo n.º 8
0
    static int Main(string[] args)
    {
        if (args.Length != 1)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("No run folder");
            }
            else
            {
                Console.WriteLine("Too many arguments");
            }
            return(1);
        }

// @ [Reading only metrics required by the Imaging Tab]
        run_metrics  metrics        = new run_metrics();
        uchar_vector interopsToLoad = new uchar_vector();

        // Load only the metrics required by imaging table
        c_csharp_table.list_imaging_table_metrics_to_load(interopsToLoad);
        metrics.read(args[0], interopsToLoad);
// @ [Reading only metrics required by the Imaging Tab]


        imaging_column_vector columnVector = new imaging_column_vector();
        map_id_offset         rowOffsets   = new map_id_offset();

        c_csharp_table.create_imaging_table_columns(metrics, columnVector);
        c_csharp_table.count_table_rows(metrics, rowOffsets);
        int rowCount    = rowOffsets.Count;
        int columnCount = (int)c_csharp_table.count_table_columns(columnVector);

        float[] data = new float[rowCount * columnCount];

        c_csharp_table.populate_imaging_table_data(metrics, columnVector, rowOffsets, data, (uint)data.Length);

        for (int rowIndex = 0; rowIndex < rowCount; ++rowIndex)
        {
            for (int groupIndex = 0; groupIndex < columnVector.Count; ++groupIndex)
            {
                if (columnVector[groupIndex].has_children())
                {
                    for (int subColumnIndex = 0; subColumnIndex < columnVector[groupIndex].subcolumns().Count; ++subColumnIndex)
                    {
                        int columnIndex = (int)(columnVector[groupIndex].offset() + subColumnIndex);
                        Console.Write("{0},", data[rowIndex * columnCount + columnIndex]);
                    }
                }
                else
                {
                    int columnIndex = (int)(columnVector[groupIndex].offset());
                    Console.Write("{0},", data[rowIndex * columnCount + columnIndex]);
                }
            }
            Console.WriteLine();
        }
        return(0);
    }
Ejemplo n.º 9
0
 public static void plot_run_diagnostics_flowcell_map(run_metrics metrics, string metric_name, filter_options options, flowcell_data data)
 {
     c_csharp_plotPINVOKE.plot_run_diagnostics_flowcell_map__SWIG_5(run_metrics.getCPtr(metrics), metric_name, filter_options.getCPtr(options), flowcell_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 10
0
 public static void plot_run_diagnostics_by_cycle(run_metrics metrics, filter_options options, candle_stick_plot_data data)
 {
     c_csharp_plotPINVOKE.plot_run_diagnostics_by_cycle(run_metrics.getCPtr(metrics), filter_options.getCPtr(options), candle_stick_plot_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 11
0
 public static void plot_event_by_event_type(run_metrics metrics, filter_options options, candle_stick_plot_data data, bool save_outliers)
 {
     c_csharp_plotPINVOKE.plot_event_by_event_type__SWIG_0(run_metrics.getCPtr(metrics), filter_options.getCPtr(options), candle_stick_plot_data.getCPtr(data), save_outliers);
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 12
0
 public static void plot_distortion(run_metrics metrics, filter_options options, uint distortion_curve_index, candle_stick_plot_data data)
 {
     c_csharp_plotPINVOKE.plot_distortion(run_metrics.getCPtr(metrics), filter_options.getCPtr(options), distortion_curve_index, candle_stick_plot_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 13
0
 public static void summarize_compass_run_metrics(run_metrics metrics, run_summary summary, bool skip_median, bool clear)
 {
     c_csharp_summaryPINVOKE.summarize_compass_run_metrics__SWIG_0(run_metrics.getCPtr(metrics), run_summary.getCPtr(summary), skip_median, clear);
     if (c_csharp_summaryPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_summaryPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 14
0
 public static void plot_sample_qc(run_metrics metrics, uint lane, bar_plot_data data)
 {
     c_csharp_plotPINVOKE.plot_sample_qc(run_metrics.getCPtr(metrics), lane, bar_plot_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 15
0
 public static void plot_by_cycle(run_metrics metrics, string metric_name, filter_options options, candle_stick_plot_data data, bool skip_empty)
 {
     c_csharp_plotPINVOKE.plot_by_cycle__SWIG_2(run_metrics.getCPtr(metrics), metric_name, filter_options.getCPtr(options), candle_stick_plot_data.getCPtr(data), skip_empty);
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 16
0
 public static void plot_qscore_heatmap(run_metrics metrics, filter_options options, heatmap_data data)
 {
     c_csharp_plotPINVOKE.plot_qscore_heatmap__SWIG_2(run_metrics.getCPtr(metrics), filter_options.getCPtr(options), heatmap_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 17
0
 public static void plot_qscore_histogram(run_metrics metrics, filter_options options, bar_plot_data data, uint boundary)
 {
     c_csharp_plotPINVOKE.plot_qscore_histogram__SWIG_0(run_metrics.getCPtr(metrics), filter_options.getCPtr(options), bar_plot_data.getCPtr(data), boundary);
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 18
0
        public void TestInvalidMetricName()
        {
            run_metrics            metrics = new run_metrics();
            filter_options         options = new filter_options(tile_naming_method.FourDigit);
            candle_stick_plot_data data    = new candle_stick_plot_data();

            c_csharp_plot.plot_by_cycle(metrics, "NoMetric", options, data);
        }
Ejemplo n.º 19
0
 public static void plot_subtile_map(run_metrics metrics, metric_type type, filter_options options, subtile_data data)
 {
     c_csharp_plotPINVOKE.plot_subtile_map__SWIG_2(run_metrics.getCPtr(metrics), (int)type, filter_options.getCPtr(options), subtile_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 20
0
		public void TestInvalidFilterOption()
		{
            run_metrics metrics = new run_metrics();
            filter_options options = new filter_options(tile_naming_method.FourDigit);
            candle_stick_plot_data data = new candle_stick_plot_data();
            options.cycle(1);
            c_csharp_plot.plot_by_cycle(metrics, metric_type.Intensity, options, data);
		}
Ejemplo n.º 21
0
 public static void summarize_compass_cycle_metrics(run_metrics metrics, compass_cycle_table table)
 {
     c_csharp_summaryPINVOKE.summarize_compass_cycle_metrics(run_metrics.getCPtr(metrics), compass_cycle_table.getCPtr(table));
     if (c_csharp_summaryPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_summaryPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 22
0
 public static void list_subtile_metrics(run_metrics metrics, metric_type_description_vector types)
 {
     c_csharp_plotPINVOKE.list_subtile_metrics__SWIG_1(run_metrics.getCPtr(metrics), metric_type_description_vector.getCPtr(types));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 23
0
 public static void summarize_compass_run_metrics(run_metrics metrics, run_summary summary)
 {
     c_csharp_summaryPINVOKE.summarize_compass_run_metrics__SWIG_2(run_metrics.getCPtr(metrics), run_summary.getCPtr(summary));
     if (c_csharp_summaryPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_summaryPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 24
0
 public static void plot_subtile_aggregate(run_metrics metrics, string metric_name, filter_options options, candle_stick_plot_data data_x, candle_stick_plot_data data_y)
 {
     c_csharp_plotPINVOKE.plot_subtile_aggregate__SWIG_1(run_metrics.getCPtr(metrics), metric_name, filter_options.getCPtr(options), candle_stick_plot_data.getCPtr(data_x), candle_stick_plot_data.getCPtr(data_y));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 25
0
 public static void plot_by_lane(run_metrics metrics, metric_type type, filter_options options, candle_stick_plot_data data)
 {
     c_csharp_plotPINVOKE.plot_by_lane__SWIG_1(run_metrics.getCPtr(metrics), (int)type, filter_options.getCPtr(options), candle_stick_plot_data.getCPtr(data));
     if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 26
0
 public static void count_table_rows(run_metrics metrics, map_id_offset row_offset)
 {
     c_csharp_tablePINVOKE.count_table_rows(run_metrics.getCPtr(metrics), map_id_offset.getCPtr(row_offset));
     if (c_csharp_tablePINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_tablePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 27
0
 public static void create_imaging_table(run_metrics metrics, imaging_table table)
 {
     c_csharp_tablePINVOKE.create_imaging_table(run_metrics.getCPtr(metrics), imaging_table.getCPtr(table));
     if (c_csharp_tablePINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_tablePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 28
0
 public static void summarize_index_metrics(run_metrics metrics, uint lane, index_lane_summary summary)
 {
     c_csharp_summaryPINVOKE.summarize_index_metrics__SWIG_0(run_metrics.getCPtr(metrics), lane, index_lane_summary.getCPtr(summary));
     if (c_csharp_summaryPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_summaryPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 29
0
 public static void create_run_diagnostics_table_columns(run_metrics metrics, run_diagnostics_column_vector columns)
 {
     c_csharp_tablePINVOKE.create_run_diagnostics_table_columns__SWIG_1(run_metrics.getCPtr(metrics), run_diagnostics_column_vector.getCPtr(columns));
     if (c_csharp_tablePINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_tablePINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 30
0
        public void ListAvailablePlotMetrics()
        {
            run_metrics run = new run_metrics();
            metric_type_description_vector metricTypeList = new metric_type_description_vector();

            c_csharp_plot.list_available_plot_metrics(run, metricTypeList);
            Assert.AreEqual(0, metricTypeList.Count);
        }
Ejemplo n.º 31
0
        public void Test_invalid_channel_exception()
        {
            run_metrics metrics = new run_metrics();

            try{
                metrics.finalize_after_load();
                Assert.Fail("No exception thrown!");
            }catch (Illumina.InterOp.RunMetrics.invalid_channel_exception) {}
        }
Ejemplo n.º 32
0
        public void TestFileNotFoundException()
        {
            run_metrics metrics = new run_metrics();

            try{
                metrics.read("/NO/FILE/EXISTS");
            }
            catch (Exception) {}
        }
Ejemplo n.º 33
0
        public static uint calculate_run_diagnostics_flowcell_buffer_size(run_metrics metrics, filter_options options)
        {
            uint ret = c_csharp_plotPINVOKE.calculate_run_diagnostics_flowcell_buffer_size(run_metrics.getCPtr(metrics), filter_options.getCPtr(options));

            if (c_csharp_plotPINVOKE.SWIGPendingException.Pending)
            {
                throw c_csharp_plotPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Ejemplo n.º 34
0
		public void IntensityTest()
		{
            int[] tmp = new int[]{2,10
                        ,7,0,90,4,100,0,-67,-66,15,74
                        ,7,0,90,4,102,0,74,122,-59,74
                        ,7,0,90,4,101,0,12,94,-115,73
                        ,7,0,90,4,103,0,16,54,66,74
                        ,7,0,90,4,-56,0,82,-11,80,58
                        ,7,0,90,4,-55,0,-62,42,-99,58
                        ,7,0,90,4,44,1,-102,113,39,64
                        ,7,0,-66,4,100,0,-67,-66,15,74
                        ,7,0,-66,4,102,0,74,122,-59,74
                        ,7,0,-66,4,101,0,46,103,-113,73
                        ,7,0,-66,4,103,0,0,2,69,74
                        ,7,0,-66,4,-56,0,21,111,-87,58
                        ,7,0,-66,4,-55,0,-86,29,-79,58
                        ,7,0,-66,4,44,1,6,-42,39,64
                        ,7,0,66,8,100,0,-67,-66,15,74
                        ,7,0,66,8,102,0,74,122,-59,74
                        ,7,0,66,8,101,0,67,-26,-109,73
                        ,7,0,66,8,103,0,92,47,75,74
                        ,7,0,66,8,-56,0,123,22,-100,58
                        ,7,0,66,8,-55,0,85,6,115,58
                        ,7,0,66,8,44,1,57,97,31,64
            			};
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.tile_metric_set());

            filter_options options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);

            candle_stick_plot_data data = new candle_stick_plot_data();
            c_csharp_plot.plot_by_lane(run, metric_type.ClusterCountPF, options, data);
            Assert.AreEqual(data.size(), 1);

		}
Ejemplo n.º 35
0
		public void Heatmap()
		{
			int[] tmp = new int[]{
                6,34,1,7,2,10,20,25,30,35,40,9,19,24,29,34,39,40,2,14,21,27,32,36,40
                ,7,0,90,4,1,0,0,0,0,0,-70,22,4,0,-81,-49,1,0,-68,16,0,0,78,-86,42,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,2,0,0,0,0,0,75,-81,3,0,-96,-81,0,0,76,4,0,0,112,62,44,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,3,0,0,0,0,0,-80,60,3,0,-74,-46,0,0,-85,1,0,0,-106,-112,44,0,0,0,0,0,0,0,0,0
			};
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.q_metric_set());

            filter_options options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(8, 2, 2, 36, 1, 1, new string_vector(), tile_naming_method.FourDigit),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);
            run.finalize_after_load();

            uint row_count = c_csharp_plot.count_rows_for_heatmap(run);
            uint col_count = c_csharp_plot.count_columns_for_heatmap(run);
            var buffer = new float[row_count*col_count];
            heatmap_data data = new heatmap_data();
            c_csharp_plot.plot_qscore_heatmap(run, options, data, buffer);
            Assert.AreEqual(data.row_count(), 3);
            Assert.AreEqual(data.column_count(), 40);
            heatmap_data data2 = new heatmap_data();
            c_csharp_plot.plot_qscore_heatmap(run, options, data2);
            for(uint row=0;row<data.row_count();row++)
            {
                for(uint col=0;col<data.column_count();col++)
                {
                    Assert.AreEqual(buffer[row*data.column_count()+col], data2.at(row,col));
                }
            }

		}
Ejemplo n.º 36
0
		public void PopulateFloatBackedTableTest()
		{
            int[] tmp = new int[]{
                 2,38
                 ,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
                 ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
                 ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.extraction_metric_set());

            var run_param = new parameters();
            Assert.AreEqual(run_param.version(), 0);
            Assert.AreEqual(run.extraction_metric_set().MaxCycle, 1);

            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);

            imaging_column_vector columnVector = new imaging_column_vector();
            c_csharp_imaging.create_imaging_table_columns(run, columnVector);
            map_id_offset rowOffsets = new map_id_offset();
            c_csharp_imaging.count_table_rows(run, rowOffsets);
            uint columnCount = c_csharp_imaging.count_table_columns(columnVector);
            var data = new float[rowOffsets.Count*columnCount];
            c_csharp_imaging.populate_imaging_table_data(run, columnVector, rowOffsets, data, (uint)data.Length);
            Assert.AreEqual(rowOffsets.Count, 3);
            Assert.AreEqual(data[0], 7);

		}
Ejemplo n.º 37
0
		public void ClearTest()
        {
            int[] tmp = new int[]{
                 2,38
                 ,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
                 ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
                 ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.extraction_metric_set());


            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);
            run.clear();

            Assert.IsTrue(run.empty());

        }
Ejemplo n.º 38
0
		public void PlotFlowcellMap()
		{
			int[] tmp = new int[]{
                6,34,1,7,2,10,20,25,30,35,40,9,19,24,29,34,39,40,2,14,21,27,32,36,40
                ,7,0,90,4,1,0,0,0,0,0,-70,22,4,0,-81,-49,1,0,-68,16,0,0,78,-86,42,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,2,0,0,0,0,0,75,-81,3,0,-96,-81,0,0,76,4,0,0,112,62,44,0,0,0,0,0,0,0,0,0
                ,7,0,90,4,3,0,0,0,0,0,-80,60,3,0,-74,-46,0,0,-85,1,0,0,-106,-112,44,0,0,0,0,0,0,0,0,0
			};
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.q_metric_set());
            uint ALL_IDS = (uint)filter_options.UseAll.ALL_IDS;
            filter_options options = new filter_options(tile_naming_method.FourDigit, ALL_IDS, 0, dna_bases.A, ALL_IDS, 1, 1);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(8, 2, 2, 36, 1, 1, new string_vector(), tile_naming_method.FourDigit),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);
            run.finalize_after_load();

            var layout = run.run_info().flowcell();
            uint lane_count = layout.lane_count();
            uint swath_count = layout.total_swaths(layout.surface_count() > 1 && !options.is_specific_surface());
            uint tile_count = layout.tiles_per_lane();
            float[] data_buffer = new float[lane_count*swath_count*tile_count];
            uint[] tile_buffer  = new uint[lane_count*swath_count*tile_count];
            flowcell_data data = new flowcell_data();
            c_csharp_plot.plot_flowcell_map(run,  metric_type.QScore, options, data, data_buffer, tile_buffer);
            Assert.AreEqual(data.row_count(), 8);
		}
Ejemplo n.º 39
0
	static int Main(string[] args)
	{
		if (args.Length != 1)
		{
			if (args.Length < 1)
				Console.WriteLine ("No run folder");
			else
				Console.WriteLine ("Too many arguments");
			return 1;
		}

		run_metrics metrics = new run_metrics();
		metrics.read(args[0]);


        run_summary summary = new run_summary();
        c_csharp_summary.summarize_run_metrics(metrics, summary);


		Console.WriteLine("Yield: {0}", summary.total_summary().yield_g());
		return 0;
	}
Ejemplo n.º 40
0
		public void IntensityTest()
		{
            int[] tmp = new int[]{
                 2,38
                 ,7,0,90,4,1,0,-12,-56,15,64,-98,35,12,64,0,0,0,0,0,0,0,0,46,1,17,1,0,0,0,0,96,-41,-104,36,122,-86,-46,-120
                 ,7,0,-66,4,1,0,96,-43,14,64,-63,49,13,64,0,0,0,0,0,0,0,0,56,1,17,1,0,0,0,0,112,125,77,38,122,-86,-46,-120
                 ,7,0,66,8,1,0,74,-68,6,64,-118,-7,8,64,0,0,0,0,0,0,0,0,93,1,46,1,0,0,0,0,-47,-104,2,40,122,-86,-46,-120
            };
            byte[] expected_binary_data = new byte[tmp.Length];
            for(int i=0;i<expected_binary_data.Length;i++) expected_binary_data[i] = (byte)tmp[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data, (uint)expected_binary_data.Length, run.extraction_metric_set());

            var run_param = new parameters();
            Assert.AreEqual(run_param.version(), 0);
            Assert.AreEqual(run.extraction_metric_set().MaxCycle, 1);

            filter_options options = new filter_options(tile_naming_method.FourDigit);
            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.set_naming_method(tile_naming_method.FourDigit);
            run.legacy_channel_update(instrument_type.HiSeq);

            candle_stick_plot_data data = new candle_stick_plot_data();
            c_csharp_plot.plot_by_cycle(run, metric_type.Intensity, options, data);
            Assert.AreEqual(data.size(), 4);

		}
Ejemplo n.º 41
0
		public void TestXMLFileNotFoundException()
		{
            run_metrics metrics = new run_metrics();
            metrics.read("/nofilecanexist/test/seef");
		}
Ejemplo n.º 42
0
		public void ReadsIdentified()
		{

			int[] tmp1 = new int[]{1
                          ,1,0,74,47,3,0
                          ,17,0,65,84,67,65,67,71,65,67,45,65,65,71,71,84,84,67,65,218,17,0,0,1,0,49,11,0,84,83,67,65,73,110
                          ,100,101,120,101,115
                          ,2,0,74,47,3,0 // changed to lane 2
                          ,17,0,65,67,65,71,84,71,71,84,45,65,65,71,71,84,84,67,65,125,17,0,0,1,0,50,11,0,84,83,67,65,73,110
                          ,100,101,120,101,115
                          ,3,0,74,47,3,0 // changed to lane 3
                          ,17,0,67,65,71,65,84,67,67,65,45,65,65,71,71,84,84,67,65,226,17,0,0,1,0,51,11,0,84,83,67,65,73,110
                          ,100,101,120,101,115
            			};
            int[] tmp2 = new int[]{2,10
                        ,7,0,90,4,100,0,-67,-66,15,74
                        ,7,0,90,4,102,0,74,122,-59,74
                        ,7,0,90,4,101,0,12,94,-115,73
                        ,7,0,90,4,103,0,16,54,66,74
                        ,7,0,90,4,-56,0,82,-11,80,58
                        ,7,0,90,4,-55,0,-62,42,-99,58
                        ,7,0,90,4,44,1,-102,113,39,64
                        ,7,0,-66,4,100,0,-67,-66,15,74
                        ,7,0,-66,4,102,0,74,122,-59,74
                        ,7,0,-66,4,101,0,46,103,-113,73
                        ,7,0,-66,4,103,0,0,2,69,74
                        ,7,0,-66,4,-56,0,21,111,-87,58
                        ,7,0,-66,4,-55,0,-86,29,-79,58
                        ,7,0,-66,4,44,1,6,-42,39,64
                        ,7,0,66,8,100,0,-67,-66,15,74
                        ,7,0,66,8,102,0,74,122,-59,74
                        ,7,0,66,8,101,0,67,-26,-109,73
                        ,7,0,66,8,103,0,92,47,75,74
                        ,7,0,66,8,-56,0,123,22,-100,58
                        ,7,0,66,8,-55,0,85,6,115,58
                        ,7,0,66,8,44,1,57,97,31,64
                        };
            byte[] expected_binary_data1 = new byte[tmp1.Length];
            for(int i=0;i<expected_binary_data1.Length;i++) expected_binary_data1[i] = (byte)tmp1[i];
            byte[] expected_binary_data2 = new byte[tmp2.Length];
            for(int i=0;i<expected_binary_data2.Length;i++) expected_binary_data2[i] = (byte)tmp2[i];
            run_metrics run = new run_metrics();
            c_csharp_comm.read_interop_from_buffer(expected_binary_data1, (uint)expected_binary_data1.Length, run.index_metric_set());
            c_csharp_comm.read_interop_from_buffer(expected_binary_data2, (uint)expected_binary_data2.Length, run.tile_metric_set());

            read_info_vector reads = new read_info_vector();
            reads.Add(new read_info(1, 1, 26));
            reads.Add(new read_info(2, 27, 76));
            run.run_info(new info(
                    "",
                    "",
                    1,
                    new flowcell_layout(2, 2, 2, 16),
                    new string_vector(),
                    new image_dimensions(),
                    reads
            ));
            run.legacy_channel_update(instrument_type.HiSeq);

            bar_plot_data data = new bar_plot_data();
            c_csharp_plot.plot_sample_qc(run, 1, data);
            Assert.AreEqual(data.size(), 1);

		}