You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm writing because I think there is a bug in the argument that specifies point colors in plotSmoothers. I have checked to make sure I am running the most up-to-date version of TradeSeq.
Here is my code:
#accessing lineage info for cells
lincells<-sce@colData@listData$tradeSeq$dm
#Creating a vector to hold the lineage assignments for each cell
vector<-as.data.frame.numeric(rep("0",nrow(lincells)))
for (a in 1:nrow(lincells)) {
if (lincells[a,4]==1) {
vector[a,1]<-"1"
} else if (lincells[a,6]==1) {
vector[a,1]<-"2"
} else if (lincells[a,8]==1) {
vector[a,1]<-"3"
} else if (lincells[a,10]==1) {
vector[a,1]<-"4"
} else if (lincells[a,12]==1) {
vector[a,1]<-"5"
}
}
# adding vector of lineage assignments to the prior object
newlincells<-cbind(lincells,vector)
colnames(newlincells)[ncol(newlincells)]<-"lineage"
#custom color palette to test
colsTS=c("magenta","darkgrey" ,"blue", "red", "green")
#plot with new colors
c<-plotSmoothers(sce, counts, gene=gene_name,pointCol=colsTS[as.numeric(newlincells$lineage)],curvesCols=colsTS)+#labs(title=paste(gene_name))+
theme(plot.title = element_text(hjust = 0.5))
#plot with default viridis
d<-plotSmoothers(sce, counts, gene=gene_name)+#labs(title=paste(gene_name))+
theme(plot.title = element_text(hjust = 0.5))
#comparison
plot_grid(c,d)
This produces the following plot:
You can see that the curves are successfully colored with colors from the custom palette, but the dots are not. Puzzlingly, there are colors in the dots (and in the legend) that are not in the color palette I provided. I tried again using hex codes instead, and got a similar result:
For the developers: the problem of "pointCol" not working as intended, when provided "a vector of length equal to the number of cells" as documentation suggests, seems to be real. I have provided both character and numeric vectors that don't throw errors, but the color scheme of the points seems to be picked without regard for what the input actually says (e.g. hex codes, color names).
Hello, I'm writing because I think there is a bug in the argument that specifies point colors in plotSmoothers. I have checked to make sure I am running the most up-to-date version of TradeSeq.
Here is my code:
This produces the following plot:
You can see that the curves are successfully colored with colors from the custom palette, but the dots are not. Puzzlingly, there are colors in the dots (and in the legend) that are not in the color palette I provided. I tried again using hex codes instead, and got a similar result:
colsTS=c("#FF00FF","#999999" ,"#0000FF", "#FF0000", "#66FF33")
The text was updated successfully, but these errors were encountered: