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()); run.extraction_metric_set().rebuild_index(); parameters run_param = new parameters(); Assert.AreEqual(run_param.version(), 0); Assert.AreEqual(run.extraction_metric_set().max_cycle(), 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(2, 2, 2, 16), reads )); run.legacy_channel_update(instrument_type.HiSeq); imaging_column_vector columnVector = new imaging_column_vector(); c_csharp_table.create_imaging_table_columns(run, columnVector); map_id_offset rowOffsets = new map_id_offset(); c_csharp_table.count_table_rows(run, rowOffsets); uint columnCount = c_csharp_table.count_table_columns(columnVector); float[] data = new float[rowOffsets.Count * columnCount]; c_csharp_table.populate_imaging_table_data(run, columnVector, rowOffsets, data, (uint)data.Length); Assert.AreEqual(rowOffsets.Count, 3); Assert.AreEqual(data[0], 7); }
public void TestDispose() { run_metrics tmp = new run_metrics(); using (var set = tmp.extraction_metric_set()) { ushort_vector tmp1 = new ushort_vector(); float_vector tmp2 = new float_vector(); set.insert(new extraction_metric(1, 1, 1, tmp1, tmp2)); } using (var set = tmp.extraction_metric_set()) { Assert.AreEqual((int)set.size(), 1); } using (var set = tmp.extraction_metric_set()) { Assert.AreEqual((int)set.at(0).lane(), 1); } }
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); }
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); }
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()); run.extraction_metric_set().rebuild_index(); parameters 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(new flowcell_layout(2, 2, 2, 16), 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); }
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); }
public void PopulateTableTest() { 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.extraction_metric_set().rebuild_index(); parameters run_param = new parameters(); Assert.AreEqual(run_param.version(), 0); Assert.AreEqual(run.extraction_metric_set().max_cycle(), 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(2, 2, 2, 16), reads )); run.legacy_channel_update(instrument_type.HiSeq); imaging_table table = new imaging_table(); c_csharp_table.create_imaging_table(run, table); Assert.AreEqual(table.row_count(), 3); Assert.AreEqual(table.at(0u, (column_id)0), 7); }
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()); }
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()); }