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

Plotting Bug fixes and new features #75

Merged
merged 7 commits into from
Jan 16, 2024
Merged

Plotting Bug fixes and new features #75

merged 7 commits into from
Jan 16, 2024

Conversation

jcharkow
Copy link
Collaborator

While making figures fixed the following bugs and added these features

Features

  1. Optional Add labels to TransitionFeatureGroup labels added with add_peak_boundaries() to put in the legend
  2. Equalization and Gaussian smoothing in 2D heatmaps

Bug fixes

  1. Fix error when try to filter heatmaps to only MS1 or only MS2

@jcharkow jcharkow requested a review from singjc January 11, 2024 20:19
Copy link
Collaborator

@singjc singjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I like the legends for the peak boundaries and the normalization of the 2D plots.

I just made a suggestion to make a method for the equalization code and place it in the dataProcessing/transformations.py file

I think it would be good to add 2D gaussian smoothing to the heatmaps. Maybe @alhigaylan has already done this in a separate branch?

Can be merged when ready.

Comment on lines 213 to 219
hist, bins = np.histogram(arr.flatten(), self.config.normalization_dict['bins'], density=True)
cdf = hist.cumsum() # cumulative distribution function
cdf = (self.config.normalization_dict['bins']-1) * cdf / cdf[-1] # normalize

# use linear interpolation of cdf to find new pixel values
image_equalized = np.interp(arr.flatten(), bins[:-1], cdf)
arr = image_equalized.reshape(arr.shape)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this as a method to the dataProcessing/transformations.py file?

@jcharkow
Copy link
Collaborator Author

I was talking with @alhigaylan and he said he did 1D gauss smoothing and not 2D maybe they can be combined once everything is merged.

@singjc
Copy link
Collaborator

singjc commented Jan 12, 2024

I was talking with @alhigaylan and he said he did 1D gauss smoothing and not 2D maybe they can be combined once everything is merged.

Sounds good, we can merge for now, and then integrate once they're all merged together.

@jcharkow jcharkow merged commit 71a0d28 into dev Jan 16, 2024
@jcharkow jcharkow deleted the patch/smooth_2d branch January 16, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants