Hi, Im not sure how to overcome this error regarding the oncoprint graphic function error.

Error: You should define graphic function for: missense_variantmissense_variant, missense_variantmissense_variantmissense_variant, stop_gainedstop_gained, missense_variantsplice_region_variant, missense_variantsplice_region_variantmissense_variant, missense_variantframeshift_variant, splice_region_variantframeshift_variant

The code is below:

col <- c("stop_gained" = "blue", "missense_variant" = "red", "inframe_deletion" = "#008000", "splice_region_variant" = "aquamarine", "frameshift_variant" = "burlywood4", "splice_acceptor_variant" = "coral",
"NA" = "gray90")
alter_fun <- list(
background = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"),
gp = gpar(fill = "#CCCCCC", col = NA))
},
# big blue
stop_gained = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"),
gp = gpar(fill = col["stop gained"], col = NA))
},
# bug red
missense_variant = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"),
gp = gpar(fill = col["missense variant"], col = NA))
},
# small green
inframe_deletion = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h0.33,
gp = gpar(fill = col["inframe deletion"], col = NA))
}
,
# aquamarine
splice_region_variant = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h
0.33,
gp = gpar(fill = col["splice region variant"], col = NA))
}
,
# burlywood4
frameshift_variant = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h0.33,
gp = gpar(fill = col["frameshift variant"], col = NA))
}
,
# coral
splice_acceptor_variant = function(x, y, w, h) {
grid.rect(x, y, w-unit(0.5, "mm"), h
0.33,
gp = gpar(fill = col["splice acceptor variant"], col = NA))
}

)
```

```{r}
column_title = "OncoPrint for P00151 Project"
heatmap_legend_param = list(title = "Alterations", at = c("stop_gained", "missense_variant", "inframe_deletion", "splice_region_variant", "frameshift_variant", "splice_acceptor_variant"),
labels = c("Stop Gained", "Missense Variant", "Inframe Deletion", "Splice Region Variant", "Frameshift Variant", "Splice Acceptor Variant"))
oncoPrint(data2,
alter_fun = alter_fun, col = col,
column_title = column_title, heatmap_legend_param = heatmap_legend_param)

Please assist!



Source link