Skip to content

Commit 6053c2b

Browse files
authored
General housekeeping (#114)
* Minor space formatting changes * Minor changes * Removing some commented lines in stage Snakefiles * Change in help text for arg in two stage5 blocks * Minor change in stage2 template config file * Change in help text for data arg in two stage5 blocks
1 parent d7fd961 commit 6053c2b

File tree

16 files changed

+23
-32
lines changed

16 files changed

+23
-32
lines changed

cobrawap/pipeline/stage01_data_entry/Snakefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ use rule template_all as all with:
1515
img = OUTPUT_DIR / config.DATA_NAME
1616
/ str("trace_" + config.DATA_NAME + "." + config.PLOT_FORMAT),
1717
data = OUTPUT_DIR / config.DATA_NAME
18-
/ str(config.DATA_NAME + "." + config.NEO_FORMAT),
19-
# configfile = Path('configs') / f'config_{config.PROFILE}.yaml'
18+
/ str(config.DATA_NAME + "." + config.NEO_FORMAT)
2019

2120

2221
use rule check_input as check_data_entry with:

cobrawap/pipeline/stage02_processing/Snakefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ use rule template_all as all with:
2323
input:
2424
check = OUTPUT_DIR / 'input.check',
2525
data = input_file,
26-
img = OUTPUT_DIR / str("processed_traces_%s-%ss" % (config.PLOT_TSTART,config.PLOT_TSTOP)),
27-
# configfile = Path('configs') / f'config_{PROFILE}.yaml'
26+
img = OUTPUT_DIR / str("processed_traces_%s-%ss" % (config.PLOT_TSTART,config.PLOT_TSTOP))
2827

2928
rule clear:
3029
output:

cobrawap/pipeline/stage02_processing/configs/config_template.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ PLOT_FORMAT: 'png'
2525

2626
# The block order determines which processing steps (blocks) will be applied
2727
# and in which order. Execution order is from first to last entry.
28-
# The available blocks are:
29-
# 'background_subtraction', 'frequency_filter', 'normalization', 'detrending',
30-
# 'spatial_downsampling', 'roi_selection', 'logMUA_estimation', 'phase_transform',
31-
# 'zscore', 'subsampling'
28+
# The available blocks are (in alphabetical order):
29+
# "background_subtraction", "detrending", "frequency_filter",
30+
# "logMUA_estimation", "normalization", "phase_transform", "roi_selection",
31+
# "spatial_downsampling", "subsampling", "zscore"
3232
# Default: empty list [] -> it skips any processing blocks and returns the same
3333
# as input but, different from plot obtained from stage01, here the values on
3434
# the y-scale are correctly reported

cobrawap/pipeline/stage02_processing/scripts/plot_processed_trace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
CLI = argparse.ArgumentParser()
1515
CLI.add_argument("--original_data", nargs='?', type=Path, required=True,
16-
help="path to input data in neo format")
16+
help="path to original input data in neo format")
1717
CLI.add_argument("--data", nargs='?', type=Path, required=True,
18-
help="path to input data in neo format")
18+
help="path to processed input data in neo format")
1919
CLI.add_argument("--img_dir", nargs='?', type=Path, required=True,
2020
help="path of output figure directory")
2121
CLI.add_argument("--img_name", nargs='?', type=str,

cobrawap/pipeline/stage02_processing/scripts/roi_selection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def plot_roi(img, contour):
168168
+ "{args.intensity_threshold} were discarded. "\
169169
+ "({})".format(os.path.basename(__file__))
170170
block.segments[0].analogsignals = [new_asig]
171+
# TODO: What about other analogsignals, e.g. hemodynamics_subtraction data?
172+
# Do they need to be cropped as well?
171173

172174
plot_roi(avg_img, contour)
173175
if args.output_img is not None:

cobrawap/pipeline/stage02_processing/scripts/spatial_downsampling.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@ def plot_downsampled_image(image, output_path):
6868
if args.output_img is not None:
6969
plot_downsampled_image(imgseq_reduced.as_array()[0], args.output_img)
7070

71-
new_block = neo.Block()
72-
new_segment = neo.Segment()
73-
new_block.segments.append(new_segment)
74-
new_block.segments[0].imagesequences.append(imgseq_reduced)
7571
new_asig = imagesequence_to_analogsignal(imgseq_reduced)
7672

7773
block.segments[0].analogsignals[0] = new_asig

cobrawap/pipeline/stage03_trigger_detection/Snakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def filtered_triggers(wildcards):
1818
use rule template_all as all with:
1919
input:
2020
check = OUTPUT_DIR / 'input.check',
21-
# configfile = Path('configs') / f'config_{PROFILE}.yaml',
2221
data = filtered_triggers,
2322
img = OUTPUT_DIR / 'plot_trigger_times'
2423

cobrawap/pipeline/stage04_wave_detection/Snakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use rule template_all as all with:
1313
check = OUTPUT_DIR / 'input.check',
1414
data = OUTPUT_DIR / 'merge_wave_definitions' / config.STAGE_OUTPUT,
1515
# img = OUTPUT_DIR / 'wave_plots'
16-
# configfile = Path('configs') / f'config_{PROFILE}.yaml',
1716

1817

1918
def additional_properties(wildcards):

cobrawap/pipeline/stage04_wave_detection/configs/config_template.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ METRIC: 'euclidean'
4343
NEIGHBOUR_DISTANCE: 15
4444
MIN_SAMPLES_PER_WAVE: 30
4545
# Factor from time dimension to space dimension in sampling_rate*spatial_scale
46-
TIME_SPACE_RATIO: 1 # i.e. distance between 2 frames corresponds to X pixel
46+
# i.e. distance between 2 frames corresponds to X pixel
47+
TIME_SPACE_RATIO: 1
4748

4849
# Optical Flow (Horn-Schunck algorithm)
4950
##############

cobrawap/pipeline/stage04_wave_detection/scripts/plot_waves.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
from utils.neo_utils import analogsignal_to_imagesequence
1313

1414
CLI = argparse.ArgumentParser()
15-
CLI.add_argument("--data", nargs='?', type=Path,
15+
CLI.add_argument("--data", nargs='?', type=Path, required=True,
1616
help="path to input data in neo format")
17-
CLI.add_argument("--output_dir", nargs='?', type=Path,
17+
CLI.add_argument("--output_dir", nargs='?', type=Path, required=True,
1818
help="path to output directory")
1919
CLI.add_argument("--img_name", nargs='?', type=str,
2020
help="")

0 commit comments

Comments
 (0)