-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow users to run subsequent rounds of Rosetta for specific channels #318
Comments
@HPiyadasa has approved this. @ngreenwald any additional comments before I begin? |
4 and 5 look like they are in disagreement. Will the source images be added or not? Since the user is almost never going to change gaus_rad or norm_const, why do these need to be added to the first part of the notebook? |
Ah yes, the classic "I accidentally updated previous information in a new bullet point, and forgot to delete the old one". Fixed. I thought it might be easier for users to have @ngreenwald let me know if this looks good, or if you think there's anything else we can avoid explicitly setting. |
Looks good |
@HPiyadasa I talked with @ngreenwald at pipeline and we agree that it's best to have the Rosetta V2 as a separate notebook. In that way, after setting parameters, we allow the user to run all cells seamlessly without needing to backtrack or stop before a certain point. I will update the design doc accordingly then tag you both on a review of it. The functionality will be the same, just that the flow will be different. |
@ngreenwald @HPiyadasa let me know if this updated design doc looks good or if anything else needs to be changed to accommodate the new notebook. |
This design doc is now a bit too long. The goal is to be able to easily read through the whole thing and identify potential issues. Given that you updated it after you'd already make progress, it makes sense that there are more details than normal, but at this point there's not much of an advantage to reading this versus just looking at the PR itself. |
Relevant background
For specific channel crosstalk smoothing, Rosetta will need to be run subsequently after the first round. We'll refer to this as Rosetta V2, and the first round as Rosetta V1.
Rosetta V2 will need additional custom logic to accommodate this.
Design overview
Note that this process will be run using the original test set from V1.
The following accommodations will need to be made for V2:
ark
).Code mockup
4a_compensate_image_data.ipynb
This notebook should now remain mostly unchanged.
The only addition to this notebook will be to allow the user to list all of the runs in
extracted_imgs_dir
for testing. We can copy the logic contained in section 3 of this notebook to this section:This addresses point 5 of the design overview.
V2 functionality will be moved over to a new notebook. At the end of this notebook, add a link that directs the user to the round 2 notebook.
We can probably leave this notebook mostly as is. There's just one thing we may need to change:The structure of this notebook will need to be modified to accommodate V2.While certain changes will need to be made, a lot of the underlying logic will remain the same. In section 2, either inside or directly underneath the cell that sets the channel name, multipliers, and folder name, we should allow the user to specify the following:output_channels
(defaults toNone
)rosetta_sub_folder
(defaults to''
)skip_source_norm
(defaults toFalse
, this will be explained inrosetta.add_source_channel_to_tiled_image
)In this way, we can explicitly pass these arguments to their respective functions so that Rosetta V2 can run seamlessly. We should guide the users toward the values they need to set for V2 in the documentation.When listing out the run names, the default should now be to useos.listdir(path/to/run/folders)
, although we can provide a comment describing how the user can manually set this if needed.Because V2 may require changinggaus_rad
andnorm_const
, we'll list these out in their respective function calls so the user can change them if need be. They'll be preset to their current defaults inrosetta.py
.4a_compensate_image_data_round2.ipynb
Accepting better names for this notebook!
This notebook will allow the user to run Rosetta V2. The structure will mostly remain the same as
4a_compensate_image_data.ipynb
with a few changes.we should now use
This will address point 1 in the design overview.
needs to change to:
This addresses point 2 in the design overview.
The variable
rosetta_mat_path
will need to be changed torosetta_mat_path = os.path.join(rosetta_testing_dir, cohort_name, 'commercial_rosetta_matrix_v2.csv')
. This will distinguish from the existing V1 matrix copied into this folder in the4a_compensate_image_data.ipynb
.The call to
rosetta.generate_rosetta_test_imgs
needs to be updated to:This addresses points 2 and 3 in the design overview.
rosetta.generate_rosetta_test_imgs
will need to be updated to takegaus_rad
andnorm_const
as parameters, this will be described later.rosetta.create_tiled_comparison
needs to be changed to:This addresses point 2 in the design overview.
create_tiled_comparison
will need to handle bothNone
and explicit lists foroutput_channel_names
, this will be described later.rosetta.add_source_channel_to_tiled_image
needs to be changed to:This addresses point 4 in the design overview.
add_source_channel_to_tiled_image
will need to handlepercent_norm=None
to skip normalization of the source row, this will be described later.rosetta.compensante_image_data
needs to be changed to:This addresses points 3 and 6 in the design overview.
rosetta.add_source_channel_to_tiled_image
This function should add control flow logic that skips the source row normalization steps on V2. Allow the parameter
percent_norm
to takeNone
as a value.Add a param calledskip_source_norm
(analogous toskip_source_norm
set in notebook 4a), and add a check prior to the normalization step:The function will now be changed to:
rosetta.generate_rosetta_test_imgs
This function now needs to explicitly receive
gaus_rad
andnorm_const
params so it can pass them tocompensate_image_data
.rosetta.create_tiled_comparison
To support explicit channel lists passed into this function, we need to add the custom logic for setting
channels
:Testing
This should remain the same, as we're not changing the underlying functionality of Rosetta, just utilizing parameters that have otherwise been for niche use cases.
Required inputs
For V2, the user will need to explicitly specify the parameters defined in the
Code mockup
section (output_channels
,rosetta_sub_folder
, andskip_source_norm
).Output files
Same as before.
Timeline
Give a rough estimate for how long you think the project will take. In general, it's better to be too conservative rather than too optimistic.
Estimated date when a fully implemented version will be ready for review:
02/25/23
Estimated date when the finalized project will be merged in:
03/02/23
The text was updated successfully, but these errors were encountered: