Error in gheatmap (ggtree package): “Error: Must request at least one colour from a hue palette.”












1















The last line gives an error:



library(ggtree)
nwk <- read.tree("nwk_file")
metadata <- read.table("metadata_file", sep="t", stringsAsFactor=FALSE)
g <- ggtree(nwk)
gheatmap(g, metadata, offset=5, width=0.5, font.size=3, colnames_angle=-45,
hjust=0)


The error reads:



"Error: Must request at least one colour from a hue palette."  


I checked and the gheatmap function has default parameters for colours.



EDIT

I tried to make a reproducible example:



library(ggtree)
tree_nwk <- "(((((((A:4,B:4):6,C:5):8,D:6):3,E:21):10,
((F:4,G:12):14,H:8):13):13,((I:5,J:2):30,(K:11,L:11):2):17):4,M:56);"
write(tree_nwk, file = "data.nwk")
tree <- read.tree("data.nwk")
p <- ggtree(tree)
dd <- data.frame(taxa = LETTERS[1:13],
place = c(rep("GZ", 5), rep("HK", 3), rep("CZ", 4), NA),
value = round(abs(rnorm(13, mean=70, sd=10)), digits=1))
dd <- dd[sample(1:13, 13), ]
row.names(dd) <- NULL
write(t(dd), "test_data.txt", ncolumns = 3, append = FALSE, sep = "t")
test_table <- read.table("test_data.txt", sep="t", stringsAsFactor=F)
gheatmap(p, test_table, offset=5, width=0.5, font.size=3,
colnames_angle=-45, hjust=0)









share|improve this question




















  • 1





    Could you add a reproducible example?

    – paoloeusebi
    Nov 21 '18 at 22:04
















1















The last line gives an error:



library(ggtree)
nwk <- read.tree("nwk_file")
metadata <- read.table("metadata_file", sep="t", stringsAsFactor=FALSE)
g <- ggtree(nwk)
gheatmap(g, metadata, offset=5, width=0.5, font.size=3, colnames_angle=-45,
hjust=0)


The error reads:



"Error: Must request at least one colour from a hue palette."  


I checked and the gheatmap function has default parameters for colours.



EDIT

I tried to make a reproducible example:



library(ggtree)
tree_nwk <- "(((((((A:4,B:4):6,C:5):8,D:6):3,E:21):10,
((F:4,G:12):14,H:8):13):13,((I:5,J:2):30,(K:11,L:11):2):17):4,M:56);"
write(tree_nwk, file = "data.nwk")
tree <- read.tree("data.nwk")
p <- ggtree(tree)
dd <- data.frame(taxa = LETTERS[1:13],
place = c(rep("GZ", 5), rep("HK", 3), rep("CZ", 4), NA),
value = round(abs(rnorm(13, mean=70, sd=10)), digits=1))
dd <- dd[sample(1:13, 13), ]
row.names(dd) <- NULL
write(t(dd), "test_data.txt", ncolumns = 3, append = FALSE, sep = "t")
test_table <- read.table("test_data.txt", sep="t", stringsAsFactor=F)
gheatmap(p, test_table, offset=5, width=0.5, font.size=3,
colnames_angle=-45, hjust=0)









share|improve this question




















  • 1





    Could you add a reproducible example?

    – paoloeusebi
    Nov 21 '18 at 22:04














1












1








1








The last line gives an error:



library(ggtree)
nwk <- read.tree("nwk_file")
metadata <- read.table("metadata_file", sep="t", stringsAsFactor=FALSE)
g <- ggtree(nwk)
gheatmap(g, metadata, offset=5, width=0.5, font.size=3, colnames_angle=-45,
hjust=0)


The error reads:



"Error: Must request at least one colour from a hue palette."  


I checked and the gheatmap function has default parameters for colours.



EDIT

I tried to make a reproducible example:



library(ggtree)
tree_nwk <- "(((((((A:4,B:4):6,C:5):8,D:6):3,E:21):10,
((F:4,G:12):14,H:8):13):13,((I:5,J:2):30,(K:11,L:11):2):17):4,M:56);"
write(tree_nwk, file = "data.nwk")
tree <- read.tree("data.nwk")
p <- ggtree(tree)
dd <- data.frame(taxa = LETTERS[1:13],
place = c(rep("GZ", 5), rep("HK", 3), rep("CZ", 4), NA),
value = round(abs(rnorm(13, mean=70, sd=10)), digits=1))
dd <- dd[sample(1:13, 13), ]
row.names(dd) <- NULL
write(t(dd), "test_data.txt", ncolumns = 3, append = FALSE, sep = "t")
test_table <- read.table("test_data.txt", sep="t", stringsAsFactor=F)
gheatmap(p, test_table, offset=5, width=0.5, font.size=3,
colnames_angle=-45, hjust=0)









share|improve this question
















The last line gives an error:



library(ggtree)
nwk <- read.tree("nwk_file")
metadata <- read.table("metadata_file", sep="t", stringsAsFactor=FALSE)
g <- ggtree(nwk)
gheatmap(g, metadata, offset=5, width=0.5, font.size=3, colnames_angle=-45,
hjust=0)


The error reads:



"Error: Must request at least one colour from a hue palette."  


I checked and the gheatmap function has default parameters for colours.



EDIT

I tried to make a reproducible example:



library(ggtree)
tree_nwk <- "(((((((A:4,B:4):6,C:5):8,D:6):3,E:21):10,
((F:4,G:12):14,H:8):13):13,((I:5,J:2):30,(K:11,L:11):2):17):4,M:56);"
write(tree_nwk, file = "data.nwk")
tree <- read.tree("data.nwk")
p <- ggtree(tree)
dd <- data.frame(taxa = LETTERS[1:13],
place = c(rep("GZ", 5), rep("HK", 3), rep("CZ", 4), NA),
value = round(abs(rnorm(13, mean=70, sd=10)), digits=1))
dd <- dd[sample(1:13, 13), ]
row.names(dd) <- NULL
write(t(dd), "test_data.txt", ncolumns = 3, append = FALSE, sep = "t")
test_table <- read.table("test_data.txt", sep="t", stringsAsFactor=F)
gheatmap(p, test_table, offset=5, width=0.5, font.size=3,
colnames_angle=-45, hjust=0)






r bioconductor ggtree






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 '18 at 9:15







orenriv

















asked Nov 21 '18 at 19:04









orenrivorenriv

62




62








  • 1





    Could you add a reproducible example?

    – paoloeusebi
    Nov 21 '18 at 22:04














  • 1





    Could you add a reproducible example?

    – paoloeusebi
    Nov 21 '18 at 22:04








1




1





Could you add a reproducible example?

– paoloeusebi
Nov 21 '18 at 22:04





Could you add a reproducible example?

– paoloeusebi
Nov 21 '18 at 22:04












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418946%2ferror-in-gheatmap-ggtree-package-error-must-request-at-least-one-colour-fro%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418946%2ferror-in-gheatmap-ggtree-package-error-must-request-at-least-one-colour-fro%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin