Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpHeatmap control colors #125

Open
diyasen2021 opened this issue Jun 5, 2022 · 0 comments
Open

kpHeatmap control colors #125

diyasen2021 opened this issue Jun 5, 2022 · 0 comments

Comments

@diyasen2021
Copy link

Hi Bernat,

I was revisiting this figure and in going through it in more detail, I found that the heatmap colors were not consistent with the copy number values and some values were not being printed.

Here is the code.

for (f in 1:2){
  df <-read.table(myFiles[f], header = TRUE)
  CN<-toGRanges(df[,-1])
  print (myFiles[f])
  print (id[f])
  at <- autotrack(current.track = f, total.tracks = 2)
  #kpDataBackground(kp, r0=at$r0, r1=at$r1)
  kpAddLabels(kp, labels = id[f], r0=at$r0, r1=at$r1, cex=0.5, side="right")
  kpHeatmap(kp, data=CN, y=CN$Copy_number, ymin=min(CN$Copy_number), ymax = max(CN$Copy_number), colors = c("red", "white", "blue"),  r0=at$r0, r1=at$r1, cex=0.3)
}

Head of CN dataframe for 3770, where column 4 is copy number
Pag3770_1 1445001 1495000 6.186963177
Pag3770_1 3070001 3125000 2.815778549
Pag3770_1 4385001 4475000 2.578674358
Pag3770_1 6745001 6860000 10.48400049
Pag3770_1 9375001 9560000 6.840217837

Here is the figure.
Rplot-demo-heatmap

Chromosome 1 of 3770 is missing the CNV at 3 Mb and 1 CNV on chromsome 7 has been labelled "red", when it should have been "blue".

Is there a way to control the colors so that all copy numbers <2 get labelled red and those >2 labelled blue? I thought this is what was happening, but it seems not.

I am happy to share the copy number file, if it helps.

As always, your help is much appreciated.

Diya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant