This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Oncoprint unused argument error!~

Hi, I don't know anywhere around this error for Oncoprint!

Error in oncoprint(mat, alter_fun = alter_fun, col = col, remove_empty_columns = TRUE,  : 
  unused arguments (alter_fun = alter_fun, col = col, remove_empty_columns = TRUE, remove_empty_rows = TRUE, column_title = column_title, heatmap_legend_param = heatmap_legend_param)

I have included the code up till the error appeared below. Please help!

Thanks.

mat = read.table("alterations_across_samples.tsv", 
    header = TRUE, stringsAsFactors = FALSE, sep = "\t")
mat[mat=="no alteration"]<- ""
#rownames(mat) = make.names(mat[, 1], unique = TRUE)
rownames(mat) = mat[, 2]
mat = mat[, -(1:4)]
mat=  mat[, -ncol(mat)]
mat = t(as.matrix(mat))
mat[1:3, 1:3]

col = c("HOMDEL" = "blue", "AMP" = "red", "MUT" = "#008000")
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
    HOMDEL = function(x, y, w, h) {
        grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"), 
            gp = gpar(fill = col["HOMDEL"], col = NA))
    },
    # bug red
    AMP = function(x, y, w, h) {
        grid.rect(x, y, w-unit(0.5, "mm"), h-unit(0.5, "mm"), 
            gp = gpar(fill = col["AMP"], col = NA))
    },
    # small green
    MUT = function(x, y, w, h) {
        grid.rect(x, y, w-unit(0.5, "mm"), h*0.33, 
            gp = gpar(fill = col["MUT"], col = NA))

library(oncoprint)
column_title = "OncoPrint for TCGA Lung Adenocarcinoma, genes in Ras Raf MEK JNK signalling"
heatmap_legend_param = list(title = "Alternations", at = c("HOMDEL", "AMP", "MUT"), 
        labels = c("Deep deletion", "Amplification", "Mutation"))
oncoprint(mat,
    alter_fun = alter_fun, col = col, 
    remove_empty_columns = TRUE, remove_empty_rows = TRUE,
    column_title = column_title, heatmap_legend_param = heatmap_legend_param)
```
r genome gene oncoprint

1 answer

It is stating that these arguments are not recognised by the function:

alter_fun
col
remove_empty_columns
remove_empty_rows
column_title
heatmap_legend_param

These are parameters that are recognised by ComplexHeatmap::oncoPrint(). However, in your code, you are trying to load a package called oncoprint, and then run a function called oncoprint(). Please load ComplexHeatmap correctly, and then use ComplexHeatmap::oncoPrint(...) to generate the print.

Kevin

Log in to answer this question.