Colour function

define_color_function(dataset, scale_limits = NULL, cmap_name = NULL)

hdx_to_pdb_colours(
  dataset,
  pdb_filepath,
  scale_limits = NULL,
  cmap_name = NULL
)

view_structure(
  pdb_filepath,
  representation = "cartoon",
  quality = "high",
  color_parameters
)

Arguments

dataset

A list of estimated protection (positive) and deprotection (negative) values per residue

scale_limits

You can force a range of numerical values to be mapped only

cmap_name

Specifies the name of the color map. Current options: "ProtDeprot, "viridis", "CSA", "ProbProtDeProt"

pdb_filepath

The path to the PDB file that you wish to view

representation

A character representing the representation. Default is "cartoon".

quality

The quality of the plot (default is "high").

color_parameters

A list of colours and residue numbers to be inputted into NGLViewer. This is the output of the hdx_to_pdb_colours function.

Value

Returns a color function

Returns a list of colours and residue numbers to be inputted into NGLVieweR, with protection values in Red and deprotection values in Blue, and NA values in Grey.

Returns a structure in the viewer panel

Author

Broncio Aguilar-Sanjuan and Oliver Crook

Examples


v <- matrix(rnorm(n = 477), nrow = 1)
colnames(v) <- seq.int(ncol(v))

v2 <- v[,seq.int(344, 477), drop = FALSE]
colnames(v2) <- seq.int(ncol(v2)) 

pdb_filepath <- system.file("extdata", "test_BRD4.pdb", mustWork = TRUE,
 package = "RexMS")

mycolor_parameters <- hdx_to_pdb_colours(v2, pdb = pdb_filepath,
 cmap_name = "ProtDeprot")
#> 2024-06-02 13:23:13.649604 [INFO]  Your HDX input dataset has 134 entries
#> 2024-06-02 13:23:13.649957 [INFO]  And excluding NA data you only have 134 entries
#> 2024-06-02 13:23:13.650048 [INFO]  However, your input PDB has only 140 residues in total
#> 2024-06-02 13:23:13.650519 [INFO]  Your scale limits are  -2.94
#>  2024-06-02 13:23:13.650519 [INFO]  Your scale limits are  2.1
#> 2024-06-02 13:23:13.650616 [INFO]  Negative values will be coloured in Blue, and positive ones on Red




library(NGLVieweR)
v <- matrix(rnorm(n = 477), nrow = 1)
colnames(v) <- seq.int(ncol(v))

v2 <- v[,seq.int(344, 477), drop = FALSE]
colnames(v2) <- seq.int(ncol(v2)) 

pdb_filepath <- system.file("extdata", "test_BRD4.pdb", mustWork = TRUE,
 package = "RexMS")

mycolor_parameters <- hdx_to_pdb_colours(v2, pdb = pdb_filepath,
 cmap_name = "ProtDeprot")
#> 2024-06-02 13:23:13.702556 [INFO]  Your HDX input dataset has 134 entries
#> 2024-06-02 13:23:13.702667 [INFO]  And excluding NA data you only have 134 entries
#> 2024-06-02 13:23:13.702752 [INFO]  However, your input PDB has only 140 residues in total
#> 2024-06-02 13:23:13.70301 [INFO]  Your scale limits are  -2.36
#>  2024-06-02 13:23:13.70301 [INFO]  Your scale limits are  2.69
#> 2024-06-02 13:23:13.703103 [INFO]  Negative values will be coloured in Blue, and positive ones on Red

view_structure(pdb_filepath = pdb_filepath,
 color_parameters = mycolor_parameters)