def invalid_analyte_set(): pool1 = fake_analyte("cont-id1", "art-id1", ["sample1", "sample2"], "pool1", "B:5", False, requested_concentration_nm=100, requested_volume=20) return [ (fake_analyte("cont-id1", "art-id1", "sample1", "art-name1", "D:5", True, concentration_nm=0, volume=100), pool1), (fake_analyte("cont-id1", "art-id1", "sample2", "art-name1", "D:5", True, concentration_nm=100, volume=20), pool1), ]
def two_identical_analytes(): return [ fake_analyte("cont-id1", "art-id1", "sample1", "art-name1", "D:5", True, concentration=100, volume=20), fake_analyte("cont-id1", "art-id2", "sample1", "art-name2", "D:6", True, concentration=100, volume=20) ]
def invalid_analyte_set(): pool1 = fake_analyte("cont-id1", "art-id1", ["sample1", "sample2"], "pool1", "B:5", False, requested_concentration_nm=100, requested_volume=20) return [ (fake_analyte("cont-id1", "art-id1", "sample1", "art-name1", "D:5", True, concentration_nm=100), pool1), (fake_analyte("cont-id1", "art-id1", "sample2", "art-name1", "D:5", True, concentration_nm=100, volume=20), pool1), ]
def two_pool_analyte_set(): samples = ["sample1", "sample2", "sample3"] pool1 = fake_analyte("cont2", "art4", samples, "Pool1", "B:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) samples = ["sample4", "sample5", "sample6"] pool2 = fake_analyte("cont2", "art5", samples, "Pool2", "C:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) return [ (fake_analyte("cont1", "art1", "sample1", "analyte1", "A:1", is_input=True, concentration_nm=10.0, volume=300.0), pool1), (fake_analyte("cont1", "art4", "sample4", "analyte4", "A:2", is_input=True, concentration_nm=10.0, volume=300.0), pool2), (fake_analyte("cont1", "art2", "sample2", "analyte2", "B:1", is_input=True, concentration_nm=25.0, volume=300.0), pool1), (fake_analyte("cont1", "art3", "sample3", "analyte3", "C:1", is_input=True, concentration_nm=30.0, volume=300.0), pool1), (fake_analyte("cont1", "art5", "sample5", "analyte5", "B:2", is_input=True, concentration_nm=25.0, volume=300.0), pool2), (fake_analyte("cont1", "art6", "sample6", "analyte6", "C:2", is_input=True, concentration_nm=30.0, volume=300.0), pool2), ]
def pooled_analyte_set(): samples = ["sample1", "sample2", "sample3"] pool = fake_analyte("cont2", "art4", samples, "Pool1", "B:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) return [ (fake_analyte("cont1", "art1", "sample1", "analyte1", "A:1", is_input=True, concentration_nm=10.0, volume=300.0), pool), (fake_analyte("cont1", "art2", "sample2", "analyte2", "A:2", is_input=True, concentration_nm=25.0, volume=300.0), pool), (fake_analyte("cont1", "art3", "sample3", "analyte3", "A:3", is_input=True, concentration_nm=30.0, volume=300.0), pool), ]
def test_create_from_rest_analyte(self): udfs = {"Some udf": 10} api_resource = MagicMock() api_resource.udf = udfs api_resource.location = [None, "B:2"] sample = MagicMock() sample.id = "sample1" api_resource.samples = [sample] api_resource.id = "art1" api_resource.name = "sample1" container_repo = MagicMock() container = fake_container("cont1") container_repo.get_container.return_value = container clarity_mapper = ClarityMapper() analyte = clarity_mapper.analyte_create_object( api_resource, is_input=True, container_repo=container_repo, process_type=MagicMock()) expected_analyte = fake_analyte(container_id="cont1", artifact_id="art1", sample_ids=["sample1"], analyte_name="sample1", well_key="B:2", is_input=True, requested_volume=10, udfs=udfs) self.assertEqual(expected_analyte.udf_some_udf, analyte.udf_some_udf) self.assertEqual(expected_analyte.id, analyte.id) self.assertEqual(expected_analyte.name, analyte.name) self.assertEqual(expected_analyte.well.__repr__(), analyte.well.__repr__()) self.assertEqual(expected_analyte.well.artifact.name, analyte.well.artifact.name)
def pooled_analyte_set(): samples = ["sample1", "sample2", "sample3"] pool = fake_analyte("cont2", "art4", samples, "Pool1", "B:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) return [ (fake_analyte("cont1", "art1", "sample1", "analyte1", "A:1", is_input=True, concentration_nm=10.0, volume=300.0), pool), (fake_analyte("cont1", "art2", "sample2", "analyte2", "A:2", is_input=True, concentration_nm=25.0, volume=300.0), pool), (fake_analyte("cont1", "art3", "sample3", "analyte3", "A:3", is_input=True, concentration_nm=30.0, volume=300.0), pool), ]
def two_pool_analyte_set(): samples = ["sample1", "sample2", "sample3"] pool1 = fake_analyte("cont2", "art4", samples, "Pool1", "B:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) samples = ["sample4", "sample5", "sample6"] pool2 = fake_analyte("cont2", "art5", samples, "Pool2", "C:4", is_input=False, requested_concentration_nm=15.0, requested_volume=40.0) return [ (fake_analyte("cont1", "art1", "sample1", "analyte1", "A:1", is_input=True, concentration_nm=10.0, volume=300.0), pool1), (fake_analyte("cont1", "art4", "sample4", "analyte4", "A:2", is_input=True, concentration_nm=10.0, volume=300.0), pool2), (fake_analyte("cont1", "art2", "sample2", "analyte2", "B:1", is_input=True, concentration_nm=25.0, volume=300.0), pool1), (fake_analyte("cont1", "art3", "sample3", "analyte3", "C:1", is_input=True, concentration_nm=30.0, volume=300.0), pool1), (fake_analyte("cont1", "art5", "sample5", "analyte5", "B:2", is_input=True, concentration_nm=25.0, volume=300.0), pool2), (fake_analyte("cont1", "art6", "sample6", "analyte6", "C:2", is_input=True, concentration_nm=30.0, volume=300.0), pool2), ]