Skip to content

Commit e551be8

Browse files
committed
do not assign intensities if not needed
1 parent bbe0676 commit e551be8

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

main.nf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ workflow {
712712
}
713713

714714
def assign_spots_inputs_for_fixed = expected_assign_spots
715-
| filter { it[6] == it[7] } | map {
715+
| filter { it[6] == it[7] }
716+
| map {
716717
def fixed_acq = it[6]
717718
def spots_file = file(it[5])
718719
def assign_spots_output_dir = get_step_output_dir(
@@ -721,7 +722,9 @@ workflow {
721722
)
722723
log.debug "Assign spots output for ${fixed_acq} -> ${assign_spots_output_dir}"
723724
[ spots_file.parent, assign_spots_output_dir] // [ spots_dir, assigned_dir ]
724-
} | combine(labeled_acquisitions) | map {
725+
}
726+
| combine(labeled_acquisitions)
727+
| map {
725728
def r = [
726729
it[3], it[0], it[1]
727730
]
@@ -730,7 +733,8 @@ workflow {
730733
} // [ label, spots_dir, assigned_dir ]
731734

732735
def expected_assign_spots_for_moving = expected_assign_spots
733-
| filter { it[6] != it[7] } | map { it[0..5] }
736+
| filter { it[6] != it[7] }
737+
| map { it[0..5] }
734738

735739
def assign_spots_inputs = warp_spots_inputs
736740
| map {
@@ -743,13 +747,23 @@ workflow {
743747
it[4] // transform path
744748
]
745749
}
750+
| filter {
751+
def (warped_spots_output_name,
752+
fixed_acq,
753+
fixed_subpath,
754+
moving_acq,
755+
moving_subpath) = it
756+
assign_spots_acq_names.contains(fixed_acq) ||
757+
assign_spots_acq_names.contains(moving_acq)
758+
}
746759
| combine(warp_spots_results, by:0)
747760
| map {
748761
// swap again the fixed input in order
749762
// to combine it with segmentation results which are done only for fixed image
750763
it[1..5] + [ it[0] ]
751764
}
752-
| concat(expected_assign_spots_for_moving) | unique {
765+
| concat(expected_assign_spots_for_moving)
766+
| unique {
753767
it.collect { "$it" }
754768
}
755769
| combine(labeled_acquisitions, by:0) | map {

0 commit comments

Comments
 (0)