-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add Decoded Spot Table #1087
Add Decoded Spot Table #1087
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1087 +/- ##
==========================================
+ Coverage 88.8% 88.89% +0.08%
==========================================
Files 165 167 +2
Lines 6433 6481 +48
==========================================
+ Hits 5713 5761 +48
Misses 720 720
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good. Thanks!
Let's run with this and discuss with WG5 users about how to organize multi-cell assignment with probabilities within this framework. My suggestion would be further optional columns in pairs, i.e. cell_0, probability_0, cell_1, probability_1,...
. And yes, we should really be able to stop at 10!
Sounds good. I'd also be fine adding a sparse matrix and saving both tables in an archive. What would be your preferred way to proceed with WG5? CC then on this PR? email them? post this in slack? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth verifying the case where this table does not have Z-planes? I'll let you decide. :)
|
||
Implementation | ||
-------------- | ||
Starfish Implements the :py:class:`DecodedSpots` as a wrapper for the :code:`pd.DataFrame` object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starfish Implements the :py:class:`DecodedSpots` as a wrapper for the :code:`pd.DataFrame` object | |
Starfish implements the :py:class:`DecodedSpots` as a wrapper for the :code:`pd.DataFrame` object |
spot coordinates (z, y, x) and gene target. Does not contain pixel coordinates. | ||
""" | ||
if Features.TARGET not in self.coords.keys(): | ||
raise RuntimeError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise RuntimeError( | |
raise ValueError( |
|
||
# test serialization | ||
tempdir = tempfile.mkdtemp() | ||
filename = os.path.join(tempdir, 'spots.csv') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably just use: with tempfile.NamedTemporaryFile(...)
required_fields = { | ||
Coordinates.X.value, # spot x-coordinate | ||
Coordinates.Y.value, # spot y-coordinate | ||
Features.TARGET, # spot gene target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some wonky alignment going on.
Adds a
DecodedSpotTable
and some basic serialization tooling to address #1076. Users who want the underlying dataframe can get it withDecodedSpotTable.data
.See documentation included in PR for more details.
closes #1076