Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test():
# access to the merlin executive
from merlin import merlin
# get the curator
curator = merlin.curator
# create a project description object
project = merlin.newProject(name="test")
# archive it
curator.saveProject(project)
# refresh the folder
merlin.pfs['project'].discover()
# and load it back in
project = curator.loadProject()
# check the name
assert project.name == "test"
# and return
return project
def test():
# access to the merlin executive
from merlin import merlin
# get the spellbook
spellbook = merlin.spellbook
# ask it to find a spell
spell = spellbook.resolve(plexus=merlin, spec="sample")
# and return
return spell
def test():
# access to the merlin executive
from merlin import merlin
# get the package manager
packages = merlin.pyre_host.packager
# check it is accessible
assert packages
# and return
return packages
def test():
# access to the merlin executive
from merlin import merlin
# get the spellbook
spellbook = merlin.spellbook
# ask it to find a spell
spell = spellbook.resolve(plexus=merlin, spec="sample")
# and return
return spell
def test_cellpose_2d_local(simple_merfish_data):
with open(os.sep.join([merlin.ANALYSIS_PARAMETERS_HOME,
'test_analysis_segmentation_cellpose.json']), 'r') as f:
snakefilePath = m.generate_analysis_tasks_and_snakefile(
simple_merfish_data, f)
m.run_with_snakemake(simple_merfish_data, snakefilePath, 5)
def test_cv2_2d_local(simple_merfish_data):
with open(os.sep.join([merlin.ANALYSIS_PARAMETERS_HOME,
'test_analysis_segmentation_cv2.json']), 'r') as f:
snakefilePath = m.generate_analysis_tasks_and_snakefile(
simple_merfish_data, f)
m.run_with_snakemake(simple_merfish_data, snakefilePath, 5)
# debug:
# merlin.vfs.dump()
# merlin.nameserver.dump('merlin')
# retrieve project directory
project = merlin.vfs['/project']
# check it
assert str(project.uri) == os.getcwd()
# retrieve the location of the merlin settings
cfg = merlin.vfs['/merlin/project']
# check it
assert str(cfg.uri) == os.path.join(os.getcwd(), '.merlin')
# verify that it is accessible through the {pfs]
assert cfg is merlin.pfs['/project']
# and return
return
def test_merfish_2d_full_local(simple_merfish_data):
with open(os.sep.join([merlin.ANALYSIS_PARAMETERS_HOME,
'test_analysis_parameters.json']), 'r') as f:
snakefilePath = m.generate_analysis_tasks_and_snakefile(
simple_merfish_data, f)
m.run_with_snakemake(simple_merfish_data, snakefilePath, 5)
def test_cv2_2d_local(simple_merfish_data):
with open(os.sep.join([merlin.ANALYSIS_PARAMETERS_HOME,
'test_analysis_segmentation_cv2.json']), 'r') as f:
snakefilePath = m.generate_analysis_tasks_and_snakefile(
simple_merfish_data, f)
m.run_with_snakemake(simple_merfish_data, snakefilePath, 5)
def configure_environment():
dataHome = _get_input_path('DATA_HOME=')
analysisHome = _get_input_path('ANALYSIS_HOME=')
parametersHome = _get_input_path('PARAMETERS_HOME=')
m.store_env(dataHome, analysisHome, parametersHome)