Вопрос: Oncoprint: определить ошибку функции graphi c в R - PullRequest
0 голосов
/ 06 марта 2020

Я получаю ошибку:

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

Я не уверен как это исправить. Код ниже:

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"), h*0.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"), h*0.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))  
    }

)
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)

# To remove empty columns and rows
oncoPrint(data2,
    alter_fun = alter_fun, col = col, 
    remove_empty_columns = TRUE, remove_empty_rows = TRUE,
    column_title = column_title, heatmap_legend_param = heatmap_legend_param)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...