pierrepo / PBxplore

A suite of tools to explore protein structures with Protein Blocks :snake:
https://pbxplore.readthedocs.org/en/latest/
MIT License
28 stars 17 forks source link

Improve defintion of color scheme in PB maps #52

Closed pierrepo closed 9 years ago

pierrepo commented 9 years ago

So far, definition of color scheme is defined in PBstats.py:

grad = matrix(nrow=848, ncol=3)
grad[1,1] = 20
grad[1,2] = 20
grad[1,3] = 232
for(i in 2:212){
grad[i,1] = grad[i-1,1]
grad[i,2] = grad[i-1,2]+1
grad[i,3] = grad[i-1,3]
}
for(i in 213:424){
grad[i,1] = grad[i-1,1]
grad[i,2] = grad[i-1,2]
grad[i,3] = grad[i-1,3]-1
}
for(i in 425:636){
grad[i,1] = grad[i-1,1]+1
grad[i,2] = grad[i-1,2]
grad[i,3] = grad[i-1,3]
}
for(i in 637:848){
grad[i,1] = grad[i-1,1]
grad[i,2] = grad[i-1,2]-1
grad[i,3] = grad[i-1,3]
}
colorpal = rgb(grad[,1]/255,grad[,2]/255,grad[,3]/255)

R has buit-in color schemes.

jbarnoud commented 9 years ago

If we get rid of R (#13), then the definition should be in python :wink:

alexdb27 commented 9 years ago

Is it needed now (or later) ?

alexdb27 commented 9 years ago

had it been done ?

pierrepo commented 9 years ago

I am currently dealing with this issue. Here are the requirements for the improved color scheme :

pierrepo commented 9 years ago

Color scheme for PB frequencies map has been taken from ColorBrewer : http://colorbrewer2.org/?type=diverging&scheme=RdYlBu&n=5

Now in the get_rid_of_R branch.

alexdb27 commented 9 years ago

Do you have enough variations for the colors?

pierrepo commented 9 years ago

Yes, it should. I transformed the discrete color scheme taken from ColorBrewer to a continuous colormap.