def build_manifest(self, file_name): '''Creation of default path specifications. Parameters ---------- file_name : string where to save it ''' manifest_builder = ManifestBuilder() manifest_builder.set_version(self.MANIFEST_VERSION) manifest_builder = self.add_manifest_paths(manifest_builder) manifest_builder.write_json_file(file_name)
def build_manifest(self, file_name): """ Construct a manifest for this Cache class and save it in a file. Parameters ---------- file_name: string File location to save the manifest. """ mb = ManifestBuilder() mb.set_version(self.MANIFEST_VERSION) mb.add_path('BASEDIR', '.') mb.add_path(self.CELLS_KEY, 'cells.json', typename='file', parent_key='BASEDIR') mb.add_path(self.EPHYS_DATA_KEY, 'specimen_%d/ephys.nwb', typename='file', parent_key='BASEDIR') mb.add_path(self.EPHYS_FEATURES_KEY, 'ephys_features.csv', typename='file', parent_key='BASEDIR') mb.add_path(self.MORPHOLOGY_FEATURES_KEY, 'morphology_features.csv', typename='file', parent_key='BASEDIR') mb.add_path(self.RECONSTRUCTION_KEY, 'specimen_%d/reconstruction.swc', typename='file', parent_key='BASEDIR') mb.add_path(self.MARKER_KEY, 'specimen_%d/reconstruction.marker', typename='file', parent_key='BASEDIR') mb.add_path(self.EPHYS_SWEEPS_KEY, 'specimen_%d/ephys_sweeps.json', typename='file', parent_key='BASEDIR') mb.write_json_file(file_name)
def build_manifest(self, file_name): manifest_builder = ManifestBuilder() manifest_builder.set_version(DummyCache.VERSION) manifest_builder.write_json_file(file_name)
def build_manifest(self, file_name): """ Construct a manifest for this Cache class and save it in a file. Parameters ---------- file_name: string File location to save the manifest. """ mb = ManifestBuilder() mb.set_version(self.MANIFEST_VERSION) mb.add_path('BASEDIR', '.') mb.add_path(self.EXPERIMENT_CONTAINERS_KEY, 'experiment_containers.json', typename='file', parent_key='BASEDIR') mb.add_path(self.EXPERIMENTS_KEY, 'ophys_experiments.json', typename='file', parent_key='BASEDIR') mb.add_path(self.EXPERIMENT_DATA_KEY, 'ophys_experiment_data/%d.nwb', typename='file', parent_key='BASEDIR') mb.add_path(self.ANALYSIS_DATA_KEY, 'ophys_experiment_analysis/%d_%s_analysis.h5', typename='file', parent_key='BASEDIR') mb.add_path(self.EVENTS_DATA_KEY, 'ophys_experiment_events/%d_events.npz', typename='file', parent_key='BASEDIR') mb.add_path(self.CELL_SPECIMENS_KEY, 'cell_specimens.json', typename='file', parent_key='BASEDIR') mb.add_path(self.STIMULUS_MAPPINGS_KEY, 'stimulus_mappings.json', typename='file', parent_key='BASEDIR') mb.add_path( self.EYE_GAZE_DATA_KEY, 'ophys_eye_gaze_mapping/%d_eyetracking_dlc_to_screen_mapping.h5', typename='file', parent_key='BASEDIR') mb.write_json_file(file_name)
def build_manifest(self, file_name): """ Construct a manifest for this Cache class and save it in a file. Parameters ---------- file_name: string File location to save the manifest. """ manifest_builder = ManifestBuilder() manifest_builder.add_path('BASEDIR', '.') manifest_builder.add_path(self.EXPERIMENTS_KEY, 'experiments.json', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.STRUCTURES_KEY, 'structures.csv', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.STRUCTURE_UNIONIZES_KEY, 'experiment_%d/structure_unionizes.csv', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.ANNOTATION_KEY, 'annotation_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.TEMPLATE_KEY, 'average_template_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.INJECTION_DENSITY_KEY, 'experiment_%d/injection_density_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.INJECTION_FRACTION_KEY, 'experiment_%d/injection_fraction_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.DATA_MASK_KEY, 'experiment_%d/data_mask_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.PROJECTION_DENSITY_KEY, 'experiment_%d/projection_density_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.add_path(self.STRUCTURE_MASK_KEY, 'structure_masks/structure_%d.nrrd', parent_key='BASEDIR', typename='file') manifest_builder.write_json_file(file_name)
def build_manifest(self, file_name): """ Construct a manifest for this Cache class and save it in a file. Parameters ---------- file_name: string File location to save the manifest. """ manifest_builder = ManifestBuilder() manifest_builder.add_path("BASEDIR", ".") manifest_builder.add_path(self.EXPERIMENTS_KEY, "experiments.json", parent_key="BASEDIR", typename="file") manifest_builder.add_path(self.STRUCTURES_KEY, "structures.csv", parent_key="BASEDIR", typename="file") manifest_builder.add_path( self.STRUCTURE_UNIONIZES_KEY, "experiment_%d/structure_unionizes.csv", parent_key="BASEDIR", typename="file" ) manifest_builder.add_path(self.CCF_VERSION_KEY, "%s", parent_key="BASEDIR", typename="dir") manifest_builder.add_path( self.ANNOTATION_KEY, "annotation_%d.nrrd", parent_key=self.CCF_VERSION_KEY, typename="file" ) manifest_builder.add_path(self.TEMPLATE_KEY, "average_template_%d.nrrd", parent_key="BASEDIR", typename="file") manifest_builder.add_path( self.INJECTION_DENSITY_KEY, "experiment_%d/injection_density_%d.nrrd", parent_key="BASEDIR", typename="file" ) manifest_builder.add_path( self.INJECTION_FRACTION_KEY, "experiment_%d/injection_fraction_%d.nrrd", parent_key="BASEDIR", typename="file", ) manifest_builder.add_path( self.DATA_MASK_KEY, "experiment_%d/data_mask_%d.nrrd", parent_key="BASEDIR", typename="file" ) manifest_builder.add_path( self.PROJECTION_DENSITY_KEY, "experiment_%d/projection_density_%d.nrrd", parent_key="BASEDIR", typename="file", ) manifest_builder.add_path( self.STRUCTURE_MASK_KEY, "structure_masks/structure_%d.nrrd", parent_key="BASEDIR", typename="file" ) manifest_builder.write_json_file(file_name)
def build_manifest(self, file_name): """ Construct a manifest for this Cache class and save it in a file. Parameters ---------- file_name: string File location to save the manifest. """ mb = ManifestBuilder() mb.add_path('BASEDIR', '.') mb.add_path(self.EXPERIMENT_CONTAINERS_KEY, 'experiment_containers.json', typename='file', parent_key='BASEDIR') mb.add_path(self.EXPERIMENTS_KEY, 'ophys_experiments.json', typename='file', parent_key='BASEDIR') mb.add_path(self.EXPERIMENT_DATA_KEY, 'ophys_experiment_data/%d.nwb', typename='file', parent_key='BASEDIR') mb.add_path(self.CELL_SPECIMENS_KEY, 'cell_specimens.json', typename='file', parent_key='BASEDIR') mb.add_path(self.STIMULUS_MAPPINGS_KEY, 'stimulus_mappings.json', typename='file', parent_key='BASEDIR') mb.write_json_file(file_name)
def builder(): b = ManifestBuilder() b.add_path('BASEDIR', '/home/username/example') return b
def to_manifest(self, manifest_path=None): b = ManifestBuilder() b.add_path('BASEDIR', os.path.realpath(os.curdir)) b.add_path('WORKDIR', os.path.realpath(os.curdir)) b.add_path('MORPHOLOGY', self.morphology_path(), typename='file') b.add_path('CODE_DIR', 'templates') b.add_path('MODFILE_DIR', 'modfiles') for modfile in self.mod_file_entries(): b.add_path('MOD_FILE_%s' % (os.path.splitext(modfile['filename'])[0]), os.path.join(modfile['storage_directory'], modfile['filename']), typename='file', format='MODFILE') b.add_path('neuronal_model_run_data', self.lims_path, typename='file') b.add_path('stimulus_path', self.stimulus_path(), typename='file', format='NWB') b.add_path('manifest', os.path.join(os.path.realpath(os.curdir), manifest_path), typename='file') neuronal_model_run_id = self.lims_data['id'] nwb_file_name, extension = \ os.path.splitext(os.path.basename(self.stimulus_path())) b.add_path('output_path', '%d_virtual_experiment%s' % (neuronal_model_run_id, extension), typename='file', parent_key='WORKDIR', format='NWB') b.add_path('fit_parameters', self.fit_parameters_path()) b.add_section( 'biophys', { "biophys": [{ "model_file": [manifest_path, self.fit_parameters_path()], "model_type": self.model_type() }] }) b.add_section( 'stimulus_conf', { "runs": [{ "neuronal_model_run_id": neuronal_model_run_id, "sweeps": self.sweep_numbers(), "sweeps_by_type": self.sweep_numbers_by_type() }] }) b.add_section( 'hoc_conf', {"neuron": [{ "hoc": ["stdgui.hoc", "import3d.hoc", "cell.hoc"] }]}) m = Manifest(config=b.path_info) if manifest_path != None: b.write_json_file(manifest_path, overwrite=True) return m
def build_manifest(self, manifest_path=None): b = ManifestBuilder() b.add_path('BASEDIR', os.path.realpath(os.curdir)) b.add_path('WORKDIR', self.output_directory()) b.add_path('MORPHOLOGY', self.morphology_path(), typename='file') b.add_path('MODFILE_DIR', 'modfiles') for modfile in self.mod_file_entries(): b.add_path('MOD_FILE_%s' % (os.path.splitext(modfile['filename'])[0]), os.path.join(modfile['storage_directory'], modfile['filename']), typename='file', format='MODFILE') b.add_path('stimulus_path', self.stimulus_path(), typename='file', format='NWB') b.add_path('manifest', os.path.join(os.path.realpath(os.curdir), manifest_path), typename='file') b.add_path('output', os.path.basename(self.stimulus_path()), typename='file', parent_key='WORKDIR', format='NWB') b.add_path('neuronal_model_data', self.lims_path, typename='file') b.add_path('upfile', 'upbase.dat', typename='file', parent_key='WORKDIR') b.add_path('downfile', 'downbase.dat', typename='file', parent_key='WORKDIR') b.add_path('passive_fit_data', 'passive_fit_data.json', typename='file', parent_key='WORKDIR') b.add_path('stage_1_jobs', 'stage_1_jobs.json', typename='file', parent_key='WORKDIR') b.add_path('fit_1_file', 'fit_1_data.json', typename='file', parent_key='WORKDIR') b.add_path('fit_2_file', 'fit_2_data.json', typename='file', parent_key='WORKDIR') b.add_path('fit_3_file', 'fit_3_data.json', typename='file', parent_key='WORKDIR') b.add_path('fit_type_path', typename='file', spec='%s', parent_key='WORKDIR') b.add_path('target_path', typename='file', spec='target.json', parent_key='WORKDIR') b.add_path('fit_config_json', typename='file', spec='%s/config.json', parent_key='WORKDIR') b.add_path('final_hof_fit', typename='file', spec='%s/s%d/final_hof_fit.txt', parent_key='WORKDIR') b.add_path('final_hof', typename='file', spec='%s/s%d/final_hof.txt', parent_key='WORKDIR') b.add_path('output_fit_file', typename='file', spec='fit_%s_%s.json') b.add_section('biophys', {"biophys": [{ "model_file": [manifest_path] }]}) b.add_section( 'stimulus_conf', { "runs": [{ "sweeps": self.sweep_numbers(), "specimen_id": self.lims_data['specimen_id'] }] }) b.add_section( 'hoc_conf', {"neuron": [{ "hoc": ["stdgui.hoc", "import3d.hoc", "cell.hoc"] }]}) return b