Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix how spot_ids are handled by build_traces_sequential and Label._assign() #1872

Merged
merged 2 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion starfish/core/spots/AssignTargets/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def _assign(
selectors['z'] = in_bbox.z
in_mask = mask.sel(**selectors)
spot_ids = in_bbox[Features.SPOT_ID][in_mask.values]
decoded_intensities[Features.CELL_ID].loc[spot_ids] = mask.name
decoded_intensities[Features.CELL_ID].loc[
decoded_intensities[Features.SPOT_ID].isin(spot_ids)] = mask.name

return decoded_intensities

Expand Down
5 changes: 4 additions & 1 deletion starfish/core/spots/DecodeSpots/trace_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ def build_traces_sequential(spot_results: SpotFindingResults, **kwargs) -> Inten

"""

all_spots = pd.concat([sa.spot_attrs.data for sa in spot_results.values()], sort=True)
all_spots = pd.concat([sa.spot_attrs.data for sa in spot_results.values()],
ignore_index=True, sort=True)
# reassign spot_ids to index number so they are unique
all_spots['spot_id'] = all_spots.index

intensity_table = IntensityTable.zeros(
spot_attributes=SpotAttributes(all_spots),
Expand Down