View source: R/map_peptides_on_structure.R
map_peptides_on_structure | R Documentation |
Peptides are mapped onto PDB structures or AlphaFold prediction based on their positions. This is accomplished by replacing the B-factor information in the structure file with values that allow highlighting of peptides, protein regions or amino acids when the structure is coloured by B-factor. In addition to simply highlighting peptides, protein regions or amino acids, a continuous variable such as fold changes associated with them can be mapped onto the structure as a colour gradient.
map_peptides_on_structure(
peptide_data,
uniprot_id,
pdb_id,
chain,
auth_seq_id,
map_value,
file_format = ".cif",
scale_per_structure = TRUE,
export_location = NULL,
structure_file = NULL,
show_progress = TRUE
)
peptide_data |
a data frame that contains the input columns to this function. If structure
or prediction files should be fetched automatically, please provide column names to the following
arguments: uniprot_id, pdb_id, chain, auth_seq_id,
map_value. If no PDB structure for a protein is available the |
uniprot_id |
a character column in the |
pdb_id |
a character column in the |
chain |
a character column in the |
auth_seq_id |
optional, a character (or numeric) column in the |
map_value |
a numeric column in the |
file_format |
a character vector containing the file format of the structure that will be
fetched from the database for the PDB identifiers provided in the |
scale_per_structure |
a logical value that specifies if scaling should be performed for each structure independently (TRUE) or over the whole data set (FALSE). The default is TRUE, which scales the scores of each structure independently so that each structure has a score range from 50 to 100. |
export_location |
optional, a character argument specifying the path to the location in which the fetched and altered structure files should be saved. If left empty, they will be saved in the current working directory. The location should be provided in the following format "folderA/folderB". |
structure_file |
optional, a character argument specifying the path to the location and
name of a structure file in ".cif" or ".pdb" format. If a structure is provided the |
show_progress |
a logical, if |
The function exports a modified ".pdb" or ".cif" structure file. B-factors have been
replaced with scaled (50-100) values provided in the map_value
column.
# Load libraries
library(dplyr)
# Create example data
peptide_data <- data.frame(
uniprot_id = c("P0A8T7", "P0A8T7", "P60906"),
peptide_sequence = c(
"SGIVSFGKETKGKRRLVITPVDGSDPYEEMIPKWRQLNV",
"NVFEGERVER",
"AIGEVTDVVEKE"
),
start = c(1160, 1197, 55),
end = c(1198, 1206, 66),
map_value = c(70, 100, 100)
)
# Find peptide positions in structures
positions_structure <- find_peptide_in_structure(
peptide_data = peptide_data,
peptide = peptide_sequence,
start = start,
end = end,
uniprot_id = uniprot_id,
retain_columns = c(map_value)) %>%
filter(pdb_ids %in% c("6UU2", "2EL9"))
# Map peptides on structures
# You can determine the preferred output location
# with the export_location argument. Currently it
# is saved in the working directory.
map_peptides_on_structure(
peptide_data = positions_structure,
uniprot_id = uniprot_id,
pdb_id = pdb_ids,
chain = auth_asym_id,
auth_seq_id = auth_seq_id,
map_value = map_value,
file_format = ".pdb",
export_location = getwd()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.