Closed Kdreval closed 6 months ago
This is now fixed with the introduction of an optional argument hide_annotations_tracks
which will also hide these tracks. Default is FALSE to respect the current behaviour but can also accept TRUE to hide these tracks.
Test cases:
This code will remove the color paleette from the legend, but will still display the annotation track:
prettyOncoplot(
maf_df = maf_data,
genes = genes,
these_samples_metadata = maf_metadata,
splitGeneGroups = gene_groups,
keepGeneOrder = TRUE,
splitColumnName = "pathology",
metadataBarHeight = 5,
metadataBarFontsize = 8,
legend_row = 2,
fontSizeGene = 11,
metadataColumns = c("pathology", "lymphgen", "sex", "EBV_status_inf", "cohort"),
sortByColumns = c("pathology", "lymphgen", "sex", "EBV_status_inf", "cohort"),
hide_annotations = "cohort")
And this is the plot:
Now we can also drop that track from the annotation while still keeping it in metadata:
prettyOncoplot(
maf_df = maf_data,
genes = genes,
these_samples_metadata = maf_metadata,
splitGeneGroups = gene_groups,
keepGeneOrder = TRUE,
splitColumnName = "pathology",
metadataBarHeight = 5,
metadataBarFontsize = 8,
legend_row = 2,
fontSizeGene = 11,
metadataColumns = c("pathology", "lymphgen", "sex", "EBV_status_inf", "cohort"),
sortByColumns = c("pathology", "lymphgen", "sex", "EBV_status_inf", "cohort"),
hide_annotations = "cohort",
hide_annotations_tracks = TRUE
)
And this generates this plot:
The fix is in the PR #29
When prettyOncoplot is supplied with
hide_annotations
, the color legend is hidden but the track itself is still shown. This should become optional and if user wants to do so, the metadata track should be hidden as well. This is important when you want to force ordering on some column but not show it in the track below the oncoplot.