You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please provide example datasets and the code you use. It will help me to understand your problem and help you!
I have made a HeatmapAnnotation with the following code, that I show below: hm<- HeatmapAnnotation(Patient= anno_simple(info_tbl$PATIENT, pch=info_tbl$SLICE_TYPE_SYMBOL, col = patient_cols), Location= info_tbl$LOCATION_SIMPLE, Tissue= info_tbl$TYPE_OF_TISSUE, BRCAstatus= anno_simple(info_tbl$BRCA_STATUS_SIMPLE, pch= info_tbl$HRD_TEST_SYMBOL, col= brca_col), Timepoint= anno_simple(info_tbl$CLINICAL_TIMEPOINT_SPEC, pch = info_tbl$FIRST_PT_STATUS_SYMBOL, col= tmpt_col), col= list(Location= loc_cols, Tissue = tiss_cols) )
Because I have three anno_simple with symbols, I need to add those legends manually, both for the colors and the meanings of the symbols itself (similar to the reference 3.2 with the p value colors & pch legend). However, it seems because this is a HeatmapAnnotation, and not a heatmap, I cannot manually add the legend for some reason. For example, if I make a legend just for Patient colors:
I also tried to add the legend to the HeatmapAnnotation function itself, with annotation_legend_param, but I get an error for that as well, though the names clearly match:
hm<- HeatmapAnnotation(Patient= anno_simple(info_tbl$PATIENT,
pch=info_tbl$SLICE_TYPE_SYMBOL, col = patient_cols),
Location= info_tbl$LOCATION_SIMPLE,
Tissue= info_tbl$TYPE_OF_TISSUE,
BRCAstatus= anno_simple(info_tbl$BRCA_STATUS_SIMPLE,
pch= info_tbl$HRD_TEST_SYMBOL, col= brca_col),
Timepoint= anno_simple(info_tbl$CLINICAL_TIMEPOINT_SPEC,
pch = info_tbl$FIRST_PT_STATUS_SYMBOL, col= tmpt_col),
col= list(Location= loc_cols, Tissue = tiss_cols),
annotation_legend_param = list(Patient= list(
title= "Patient", legend_gp = gpar(fill =patient_cols), at= names(patient_cols)
)
)
)
Error: Some names in 'annotation_legend_param' are not in names of simple annotations.
How might I be able to add manual legends to the HeatmapAnnotation in this case? I haven't seen anything in the documentation about this being done.
The text was updated successfully, but these errors were encountered:
I have made a HeatmapAnnotation with the following code, that I show below:
![hm](https://private-user-images.githubusercontent.com/65675970/333133254-a846a3a0-76c8-4347-a951-cfccfcc993f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxMDM0MDksIm5iZiI6MTcxOTEwMzEwOSwicGF0aCI6Ii82NTY3NTk3MC8zMzMxMzMyNTQtYTg0NmEzYTAtNzZjOC00MzQ3LWE5NTEtY2ZjY2ZjYzk5M2YzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDAwMzgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmMjJjMGM3YWJmMDkyZGE2MTcwZDgyOGNiNzM0MDQ1OTcwZTg3YTg0OGE4NzFhZGM1YTIwZDFkOTFmMDhhZGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.63kfjW00qwhiBKTO5s55EpDjvB_6r8otJQ2Pws_hT_k)
hm<- HeatmapAnnotation(Patient= anno_simple(info_tbl$PATIENT, pch=info_tbl$SLICE_TYPE_SYMBOL, col = patient_cols), Location= info_tbl$LOCATION_SIMPLE, Tissue= info_tbl$TYPE_OF_TISSUE, BRCAstatus= anno_simple(info_tbl$BRCA_STATUS_SIMPLE, pch= info_tbl$HRD_TEST_SYMBOL, col= brca_col), Timepoint= anno_simple(info_tbl$CLINICAL_TIMEPOINT_SPEC, pch = info_tbl$FIRST_PT_STATUS_SYMBOL, col= tmpt_col), col= list(Location= loc_cols, Tissue = tiss_cols) )
Because I have three anno_simple with symbols, I need to add those legends manually, both for the colors and the meanings of the symbols itself (similar to the reference 3.2 with the p value colors & pch legend). However, it seems because this is a HeatmapAnnotation, and not a heatmap, I cannot manually add the legend for some reason. For example, if I make a legend just for Patient colors:
It looks fine using
draw(pat_leg)
, but I am unable to do the following:I also tried to add the legend to the HeatmapAnnotation function itself, with
annotation_legend_param
, but I get an error for that as well, though the names clearly match:How might I be able to add manual legends to the HeatmapAnnotation in this case? I haven't seen anything in the documentation about this being done.
The text was updated successfully, but these errors were encountered: