Esempio 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(
                             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);
        }
Esempio n. 2
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);

		}
Esempio n. 3
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);
		}
Esempio n. 4
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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
		}
Esempio n. 7
0
        public void Test_invalid_filter_option()
        {
            info           run_info = new info();
            filter_options options  = new filter_options(tile_naming_method.FourDigit);

            try{
                options.validate(metric_type.Intensity, run_info);
                Assert.Fail("No exception thrown!");
            }catch (Illumina.InterOp.Plot.invalid_filter_option) {}
        }
        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);
        }
Esempio n. 9
0
        public void TestInvalidFilterOption()
        {
            run_metrics    metrics = new run_metrics();
            filter_options options = new filter_options(tile_naming_method.FourDigit);

            metrics.extraction_metric_set().insert(new extraction_metric(1, 1101, 1, new ushort_vector(), new float_vector()));
            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);
        }
Esempio n. 10
0
        public void Test_invalid_metric_type_for_plot_flowcell_map()
        {
            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);
            run_metrics    run     = new run_metrics();
            flowcell_data  data    = new flowcell_data();

            try{
                c_csharp_plot.plot_flowcell_map(run, "NoMetric", options, data);
                Assert.Fail("No exception thrown!");
            }catch (Illumina.InterOp.RunMetrics.invalid_metric_type) {}
        }
Esempio n. 11
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));
                }
            }
        }
Esempio n. 12
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);

		}
Esempio n. 13
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));
                }
            }

		}
Esempio n. 14
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);
        }
Esempio n. 15
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().max_cycle(), 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);
        }
Esempio n. 16
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);
		}
Esempio n. 17
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);

		}