-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmountainsort3.mlp
1 lines (1 loc) · 6.65 KB
/
mountainsort3.mlp
1
{"processing_server":"typhoon","pipelines":[{"spec":{"name":"main","description":"","inputs":[],"outputs":[],"parameters":[]},"steps":[{"step_type":"pipeline","pipeline_name":"synthesize","inputs":{},"outputs":{"raw":"raw","geom":"geom","waveforms_true":"waveforms_true","firings_true":"firings_true"},"parameters":{"duration":"600","samplerate":"30000"}},{"step_type":"pipeline","pipeline_name":"sort","inputs":{"raw":"raw","geom":"geom"},"outputs":{"firings_out":"firings","filt_out":"filt","pre_out":"pre"},"parameters":{"samplerate":"30000","detect_sign":""}},{"step_type":"pipeline","pipeline_name":"curate","inputs":{"pre":"pre","firings":"firings"},"outputs":{"curated_firings":"curated_firings"},"parameters":{"samplerate":"30000"}}],"input_files":[],"output_files":[]},{"spec":{"name":"synthesize","description":"","inputs":[],"outputs":[{"name":"raw"},{"name":"geom"},{"name":"waveforms_true"},{"name":"firings_true"}],"parameters":[{"name":"duration","description":"Durations of simulated dataset in seconds"},{"name":"samplerate"}]},"steps":[{"step_type":"processor","processor_name":"pyms.synthesize_random_waveforms","inputs":{},"outputs":{"waveforms_out":"waveforms_true","geometry_out":"geom"},"parameters":{"upsamplefac":"13"}},{"step_type":"processor","processor_name":"pyms.synthesize_random_firings","inputs":{},"outputs":{"firings_out":"firings_true"},"parameters":{"samplerate":"${samplerate}","duration":"${duration}"}},{"step_type":"processor","processor_name":"pyms.synthesize_timeseries","inputs":{"firings":"firings_true","waveforms":"waveforms_true"},"outputs":{"timeseries_out":"raw"},"parameters":{"duration":"${duration}","waveform_upsamplefac":"13"}},{"step_type":"processor","processor_name":"pyms.synthesize_random_firings","inputs":{},"outputs":{"firings_out":"test_firings","console_out":"test_cons"},"parameters":{"duration":"310"}}],"input_files":[],"output_files":[]},{"name":"sort","script":"/* Define the spec */\ninputs_opt('raw','filt','pre','geom');\noutputs('firings_out');\noutputs_opt('filt_out','pre_out','firings_original_out');\nparam('samplerate',30000);\nparam('freq_min',300);\nparam('freq_max',6000);\nparam('freq_wid',1000);\nparam('whiten','true');\nparam('detect_threshold',3);\nparam('detect_sign',0);\nparam('adjacency_radius',-1);\n\nparam('curate','false');\n \n\n_Pipeline.run=function(X) {\n var pp=X.parameters;\n \n var pre='pre';\n if (!X.hasInput('pre')) {\n \n var filt='filt';\n if (!X.hasInput('filt')) {\n if (!X.hasInput('raw')) {\n console.error('Missing input: raw, filt or pre');\n return -1;\n }\n X.runProcess('ms3.bandpass_filter',\n {timeseries:'raw'},\n {timeseries_out:'filt_out'},\n {samplerate:pp.samplerate,freq_min:pp.freq_min,freq_max:pp.freq_max,freq_wid:pp.freq_wid}\n );\n filt='filt_out';\n }\n \n \n if (pp.whiten=='true') {\n X.runProcess('ms3.whiten',\n {timeseries:filt},\n {timeseries_out:'pre_out'},\n {}\n );\n }\n else {\n X.runProcess('pyms.normalize_channels',\n {timeseries:'filt'},\n {timeseries_out:'pre_out'},\n {}\n );\n }\n pre='pre_out';\n }\n \n \n var curate=(pp.curate=='true');\n var firings1='firings_out';\n if (curate) firings1='firings_original_out';\n \n var p={\n detect_threshold:pp.detect_threshold,\n detect_sign:pp.detect_sign,\n adjacency_radius:pp.adjacency_radius\n };\n var inputs={timeseries:pre};\n if (X.hasInput('geom')) {\n inputs.geom='geom';\n }\n X.runProcess('mountainsortalg.ms3',\n inputs,\n {firings_out:firings1},\n p);\n \n if (curate) {\n X.runPipeline('curate',\n {pre:pre,firings:firings1},\n {curated_firings:'firings_out'},\n {samplerate:pp.samplerate});\n }\n \n};\n\n/////////////////////////////////////////////////////////////////////\n\n\nfunction param(str,val) {\n if (val===undefined) {\n _Pipeline.spec.parameters.push({name:str});\n }\n else {\n _Pipeline.spec.parameters.push({name:str,optional:true,default_value:val});\n }\n}\n \nfunction inputs(str1,str2,str3,str4) {\n if (str1) _Pipeline.spec.inputs.push({name:str1});\n if (str2) _Pipeline.spec.inputs.push({name:str2});\n if (str3) _Pipeline.spec.inputs.push({name:str3});\n if (str4) _Pipeline.spec.inputs.push({name:str4});\n}\n\nfunction inputs_opt(str1,str2,str3,str4) {\n if (str1) _Pipeline.spec.inputs.push({name:str1,optional:true});\n if (str2) _Pipeline.spec.inputs.push({name:str2,optional:true});\n if (str3) _Pipeline.spec.inputs.push({name:str3,optional:true});\n if (str4) _Pipeline.spec.inputs.push({name:str4,optional:true});\n}\n\nfunction outputs(str1,str2,str3,str4) {\n if (str1) _Pipeline.spec.outputs.push({name:str1});\n if (str2) _Pipeline.spec.outputs.push({name:str2});\n if (str3) _Pipeline.spec.outputs.push({name:str3});\n if (str4) _Pipeline.spec.outputs.push({name:str4});\n}\n\nfunction outputs_opt(str1,str2,str3,str4) {\n if (str1) _Pipeline.spec.outputs.push({name:str1,optional:true});\n if (str2) _Pipeline.spec.outputs.push({name:str2,optional:true});\n if (str3) _Pipeline.spec.outputs.push({name:str3,optional:true});\n if (str4) _Pipeline.spec.outputs.push({name:str4,optional:true});\n}","steps":[],"spec":{"name":"","description":"","inputs":[],"outputs":[],"parameters":[]},"export":true},{"spec":{"name":"curate","description":"","inputs":[{"name":"pre"},{"name":"firings"}],"outputs":[{"name":"curated_firings"}],"parameters":[{"name":"samplerate"}]},"steps":[{"step_type":"processor","processor_name":"ms3.cluster_metrics","inputs":{"timeseries":"pre","firings":"firings"},"outputs":{"cluster_metrics_out":"metrics1"},"parameters":{"samplerate":"${samplerate}"}},{"step_type":"processor","processor_name":"ms3.isolation_metrics","inputs":{"timeseries":"pre","firings":"firings"},"outputs":{"metrics_out":"metrics2"},"parameters":{"compute_bursting_parents":"true"}},{"step_type":"processor","processor_name":"ms3.combine_cluster_metrics","inputs":{"metrics_list":["metrics1","metrics2"]},"outputs":{"metrics_out":"metrics"},"parameters":{}},{"step_type":"processor","processor_name":"pyms.create_label_map","inputs":{"metrics":"metrics"},"outputs":{"label_map_out":"label_map"},"parameters":{}},{"step_type":"processor","processor_name":"pyms.apply_label_map","inputs":{"firings":"firings","label_map":"label_map"},"outputs":{"firings_out":"curated_firings"},"parameters":{}}],"input_files":[],"output_files":[]}],"input_files":[],"output_files":[],"jobs":[]}