Skip to content

Commit

Permalink
Don't output concat correlations if "all" not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 20, 2024
1 parent 253ca7e commit ff1308f
Showing 1 changed file with 44 additions and 43 deletions.
87 changes: 44 additions & 43 deletions xcp_d/workflows/bold/concatenation.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,52 +362,53 @@ def init_concatenate_data_wf(TR, head_radius, name='concatenate_data_wf'):
(make_timeseries_dict, ds_timeseries, [('metadata', 'meta_dict')]),
]) # fmt:skip

correlate_timeseries = pe.MapNode(
TSVConnect(),
run_without_submitting=True,
mem_gb=1,
name='correlate_timeseries',
iterfield=['timeseries'],
)
workflow.connect([
(concatenate_inputs, correlate_timeseries, [
('timeseries', 'timeseries'),
('temporal_mask', 'temporal_mask'),
]),
]) # fmt:skip
if 'all' in config.workflow.correlation_lengths:
correlate_timeseries = pe.MapNode(

Check warning on line 366 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L366

Added line #L366 was not covered by tests
TSVConnect(),
run_without_submitting=True,
mem_gb=1,
name='correlate_timeseries',
iterfield=['timeseries'],
)
workflow.connect([

Check warning on line 373 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L373

Added line #L373 was not covered by tests
(concatenate_inputs, correlate_timeseries, [
('timeseries', 'timeseries'),
('temporal_mask', 'temporal_mask'),
]),
]) # fmt:skip

make_correlations_dict = pe.MapNode(
BIDSURI(
numinputs=1,
dataset_links=config.execution.dataset_links,
out_dir=str(output_dir),
),
run_without_submitting=True,
mem_gb=1,
name='make_correlations_dict',
iterfield=['in1'],
)
workflow.connect([(ds_timeseries, make_correlations_dict, [('out_file', 'in1')])])
make_correlations_dict = pe.MapNode(

Check warning on line 380 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L380

Added line #L380 was not covered by tests
BIDSURI(
numinputs=1,
dataset_links=config.execution.dataset_links,
out_dir=str(output_dir),
),
run_without_submitting=True,
mem_gb=1,
name='make_correlations_dict',
iterfield=['in1'],
)
workflow.connect([(ds_timeseries, make_correlations_dict, [('out_file', 'in1')])])

Check warning on line 391 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L391

Added line #L391 was not covered by tests

ds_correlations = pe.MapNode(
DerivativesDataSink(
dismiss_entities=['desc'],
statistic='pearsoncorrelation',
suffix='relmat',
extension='.tsv',
),
name='ds_correlations',
run_without_submitting=True,
mem_gb=1,
iterfield=['segmentation', 'in_file', 'meta_dict'],
)
ds_correlations.inputs.segmentation = atlases
ds_correlations = pe.MapNode(

Check warning on line 393 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L393

Added line #L393 was not covered by tests
DerivativesDataSink(
dismiss_entities=['desc'],
statistic='pearsoncorrelation',
suffix='relmat',
extension='.tsv',
),
name='ds_correlations',
run_without_submitting=True,
mem_gb=1,
iterfield=['segmentation', 'in_file', 'meta_dict'],
)
ds_correlations.inputs.segmentation = atlases

Check warning on line 405 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L405

Added line #L405 was not covered by tests

workflow.connect([
(clean_name_source, ds_correlations, [('name_source', 'source_file')]),
(correlate_timeseries, ds_correlations, [('correlations', 'in_file')]),
(make_correlations_dict, ds_correlations, [('metadata', 'meta_dict')]),
]) # fmt:skip
workflow.connect([

Check warning on line 407 in xcp_d/workflows/bold/concatenation.py

View check run for this annotation

Codecov / codecov/patch

xcp_d/workflows/bold/concatenation.py#L407

Added line #L407 was not covered by tests
(clean_name_source, ds_correlations, [('name_source', 'source_file')]),
(correlate_timeseries, ds_correlations, [('correlations', 'in_file')]),
(make_correlations_dict, ds_correlations, [('metadata', 'meta_dict')]),
]) # fmt:skip

if file_format == 'cifti':
cifti_ts_src = pe.MapNode(
Expand Down

0 comments on commit ff1308f

Please sign in to comment.