def test_dask_local_name(self): self.assertEqual(MPControl.name(), self.client_name)
def test_mp_sync(self): self.assertTrue(MPControl.sync_processes())
def setUpClass(cls): cls.tempdir = tempfile.mkdtemp() MPControl.shutdown() MPControl.set_multiprocess_engine(cls.name) MPControl.connect(local_dir=cls.tempdir, n_workers=0)
def tearDownClass(cls): MPControl.shutdown() MPControl.set_multiprocess_engine("local") MPControl.connect()
def start_mpcontrol_dask(n_cores=N_CORES): MPControl.set_multiprocess_engine("dask-cluster") MPControl.client.use_default_configuration("rusty_ccb", n_jobs=2) MPControl.client.add_worker_conda( "source /mnt/ceph/users/sysbio/.anaconda3/bin/activate inferelator") MPControl.connect()
def test_dask_cluster_map(self): with self.assertRaises(NotImplementedError): MPControl.map(math_function, *self.map_test_data)
def setUpClass(cls): MPControl.shutdown() MPControl.set_multiprocess_engine(cls.name) MPControl.connect()
def setUpClass(cls): cls.temp_dir = tempfile.mkdtemp() cls.server = kvsstcp.KVSServer("", 0) MPControl.shutdown() MPControl.set_multiprocess_engine(cls.name) MPControl.connect(host=cls.server.cinfo[0], port=cls.server.cinfo[1])
def test_kvs_map_distribute(self): test_result = MPControl.map(math_function, *self.map_test_data, tell_children=True) self.assertListEqual(test_result, self.map_test_expect)
def test_bad_engine_II(self): with self.assertRaises(ValueError): MPControl.set_multiprocess_engine(unittest.TestCase)
def test_cant_change(self): with self.assertRaises(RuntimeError): MPControl.set_multiprocess_engine("local")
def test_bad_engine(self): with self.assertRaises(ValueError): MPControl.set_multiprocess_engine("V8")
def test_name(self): with self.assertRaises(NameError): MPControl.name()
def test_sync(self): with self.assertRaises(RuntimeError): MPControl.sync_processes()
def test_dask_local_sync(self): self.assertTrue(MPControl.sync_processes())
def test_kvs_map_by_file(self): test_result = MPControl.map(math_function, *self.map_test_data, tell_children=True, tmp_file_path=self.temp_dir) self.assertListEqual(test_result, self.map_test_expect)
def test_dask_cluster_name(self): self.assertEqual(MPControl.name(), self.client_name)
def test_kvs_sync(self): self.assertEqual(MPControl.sync_processes(), None)
def test_dask_cluster_sync(self): self.assertTrue(MPControl.sync_processes())
def test_mp_name(self): self.assertEqual(MPControl.name(), self.name)
def setUpClass(cls): MPControl.shutdown() MPControl.client = None
def test_mp_map(self): test_result = MPControl.map(math_function, *self.map_test_data) self.assertListEqual(test_result, self.map_test_expect)
def test_map(self): with self.assertRaises(RuntimeError): MPControl.map(math_function, *self.map_test_data)
DATA_FILE = "YPD_LOCAL_OPT_PV_DEXFORM.h5ad" CONDA_ACTIVATE_PATH = '~/.local/anaconda3/bin/activate' EXPRESSION_MATRIX_METADATA = ['Genotype', 'Genotype_Group', 'Replicate', 'Condition', 'tenXBarcode'] YEASTRACT_PRIOR = "YEASTRACT_20190713_BOTH.tsv" TF_NAMES = "tf_names_gold_standard.txt" YEASTRACT_TF_NAMES = "tf_names_yeastract.txt" INPUT_DIR = '/mnt/ceph/users/cjackson/inferelator/data/yeast' OUTPUT_PATH = '/mnt/ceph/users/cjackson/jackson_2019_inferelator_v050/' if __name__ == '__main__': MPControl.set_multiprocess_engine("dask-cluster") MPControl.client.use_default_configuration("rusty_preempt") MPControl.client.set_job_size_params(n_jobs=1) MPControl.client.add_worker_conda("source ~/.local/anaconda3/bin/activate inferelator") MPControl.connect() wkf = inferelator_workflow("stars", VelocityWorkflow) wkf.set_file_paths(input_dir=INPUT_DIR, output_dir=os.path.join(OUTPUT_PATH, "only_v"), gold_standard_file='gold_standard.tsv', priors_file=YEASTRACT_PRIOR, tf_names_file=YEASTRACT_TF_NAMES) wkf.set_expression_file(h5ad=DATA_FILE, h5_layer="smooth_count") wkf.set_velocity_parameters(velocity_file_name=DATA_FILE, velocity_file_type="h5ad", velocity_file_layer="pv") wkf.set_crossvalidation_parameters(split_gold_standard_for_crossvalidation=True, cv_split_ratio=0.5)