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

gradient heatmap #9

Open
hjack123 opened this issue Jan 12, 2023 · 2 comments
Open

gradient heatmap #9

hjack123 opened this issue Jan 12, 2023 · 2 comments

Comments

@hjack123
Copy link

hjack123 commented Jan 12, 2023

Is there a way to plot gradient heatmap for the clinical annotation

@pjb7687
Copy link
Member

pjb7687 commented Jan 13, 2023

Please leave an example here, and I will try to add it.

@hjack123
Copy link
Author

df_stagecode = df_all_annotations[df_all_annotations.index == 'American Joint Committee on Cancer Tumor Stage Code']
uniq_annots = sorted(pd.unique(df_stagecode.values.ravel()))
annotations['American Joint Committee on Cancer Tumor Stage Code'] = {
'annotations': df_stagecode,
'colors': {k: v for k, v in zip(uniq_annots, cmap(np.linspace(0, 1, len(uniq_annots), dtype=float)))},
'order': 2
}

take your code for example: df_stagecode.values will be np.array([1,1.1,1.2,1.3,nan]) and uses 'Reds' or 'Greys' as color, and leave nan as white or grey. This could be dosages used for patients and annotated on the top of the oncoprint for each pt

@pjb7687 pjb7687 changed the title legend overlaps gradient hieatmap Jan 15, 2023
@pjb7687 pjb7687 changed the title gradient hieatmap gradient heatmap Jan 15, 2023
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

No branches or pull requests

2 participants